forked from tilt-dev/tilt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ErrorModal.tsx
50 lines (48 loc) · 1.4 KB
/
ErrorModal.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import React, { PureComponent } from "react"
import Modal from "react-modal"
import { linkToTiltDocs, TiltDocsPage } from "./constants"
import "./FatalErrorModal.scss"
import { ShowErrorModal } from "./types"
type props = {
error: string | undefined
showErrorModal: ShowErrorModal
handleClose: () => void
}
export default class ErrorModal extends PureComponent<props> {
render() {
let showModal =
Boolean(this.props.error) &&
(this.props.showErrorModal === ShowErrorModal.Default ||
this.props.showErrorModal === ShowErrorModal.Show)
return (
<Modal
isOpen={showModal}
className="FatalErrorModal"
onRequestClose={this.props.handleClose}
>
<h2 className="FatalErrorModal-title">Error</h2>
<div className="FatalErrorModal-pane">
<p>Tilt has encountered an error: {this.props.error}</p>
</div>
<div className="FatalErrorModal-pane">
<p>
To get help try{" "}
<a href="https://github.com/tilt-dev/tilt/issues/new">
opening a GitHub issue
</a>{" "}
or{" "}
<a
href={linkToTiltDocs(
TiltDocsPage.DebugFaq,
"#where-can-i-ask-questions"
)}
>
contacting us on Slack
</a>
.
</p>
</div>
</Modal>
)
}
}