1
1
import React , { Component } from 'react'
2
2
import ReactDOM from 'react-dom'
3
- import { ModalPortal , ModalBackground , ModalDialog } from 'react-modal-dialog '
3
+ import Modal from 'react-modal'
4
4
import { inject , observer } from 'mobx-react'
5
5
import AppStyles from '../Theme/AppStyles'
6
6
import Colors from '../Theme/Colors'
@@ -19,7 +19,6 @@ const Styles = {
19
19
dialog : {
20
20
borderRadius : 4 ,
21
21
padding : 4 ,
22
- width : 450 ,
23
22
backgroundColor : Colors . background ,
24
23
color : Colors . foreground
25
24
} ,
@@ -107,7 +106,7 @@ class SendCustomDialog extends Component {
107
106
session . ui . setCustomMessage ( e . target . value )
108
107
}
109
108
110
- componentDidUpdate ( ) {
109
+ componentDidUpdate ( ) {
111
110
const field = ReactDOM . findDOMNode ( this . field )
112
111
113
112
field && field . focus ( )
@@ -120,51 +119,51 @@ class SendCustomDialog extends Component {
120
119
e . preventDefault ( )
121
120
}
122
121
123
- render ( ) {
122
+ render ( ) {
124
123
const { ui } = this . props . session
125
124
if ( ! ui . showSendCustomDialog ) return null
126
125
127
126
return (
128
- < ModalPortal >
129
- < ModalBackground onClose = { ui . closeSendCustomDialog } >
130
- < ModalDialog style = { Styles . dialog } >
131
- < div style = { Styles . container } >
132
- < div style = { Styles . header } >
133
- < h1 style = { Styles . title } > { DIALOG_TITLE } </ h1 >
134
- < div style = { Styles . subtitle } > { INSTRUCTIONS } </ div >
135
- </ div >
136
- < div style = { Styles . body } >
137
- < label style = { Styles . fieldLabel } > { FIELD_LABEL } </ label >
138
- < input
139
- placeholder = { INPUT_PLACEHOLDER }
140
- style = { Styles . textField }
141
- type = 'text'
142
- ref = { node => ( this . field = node ) }
143
- value = { ui . customMessage }
144
- onKeyPress = { this . handleKeyPress }
145
- onChange = { this . handleChange }
146
- />
147
- < small style = { Styles . moreInfo } >
148
- See{ ' ' }
149
- < a style = { Styles . link } onClick = { this . onMoreInfo } >
150
- this tip
127
+ < Modal
128
+ isOpen
129
+ onRequestClose = { ui . closeSendCustomDialog }
130
+ style = { { content : Styles . dialog , overlay : { zIndex : 5 } } }
131
+ >
132
+ < div style = { Styles . container } >
133
+ < div style = { Styles . header } >
134
+ < h1 style = { Styles . title } > { DIALOG_TITLE } </ h1 >
135
+ < div style = { Styles . subtitle } > { INSTRUCTIONS } </ div >
136
+ </ div >
137
+ < div style = { Styles . body } >
138
+ < label style = { Styles . fieldLabel } > { FIELD_LABEL } </ label >
139
+ < input
140
+ placeholder = { INPUT_PLACEHOLDER }
141
+ style = { Styles . textField }
142
+ type = 'text'
143
+ ref = { node => ( this . field = node ) }
144
+ value = { ui . customMessage }
145
+ onKeyPress = { this . handleKeyPress }
146
+ onChange = { this . handleChange }
147
+ />
148
+ < small style = { Styles . moreInfo } >
149
+ See{ ' ' }
150
+ < a style = { Styles . link } onClick = { this . onMoreInfo } >
151
+ this tip
151
152
</ a > { ' ' }
152
- for creating your own middleware.
153
+ for creating your own middleware.
153
154
</ small >
154
- </ div >
155
+ </ div >
155
156
156
- < div style = { Styles . keystrokes } >
157
- < div style = { Styles . hotkey } >
158
- < span style = { Styles . keystroke } > { ESCAPE_KEYSTROKE } </ span > { ESCAPE_HINT }
159
- </ div >
160
- < div style = { Styles . hotkey } >
161
- < span style = { Styles . keystroke } > { ENTER_KEYSTROKE } </ span > { ENTER_HINT }
162
- </ div >
163
- </ div >
157
+ < div style = { Styles . keystrokes } >
158
+ < div style = { Styles . hotkey } >
159
+ < span style = { Styles . keystroke } > { ESCAPE_KEYSTROKE } </ span > { ESCAPE_HINT }
164
160
</ div >
165
- </ ModalDialog >
166
- </ ModalBackground >
167
- </ ModalPortal >
161
+ < div style = { Styles . hotkey } >
162
+ < span style = { Styles . keystroke } > { ENTER_KEYSTROKE } </ span > { ENTER_HINT }
163
+ </ div >
164
+ </ div >
165
+ </ div >
166
+ </ Modal >
168
167
)
169
168
}
170
169
}
0 commit comments