Skip to content

Commit 10f36b0

Browse files
committed
Fix this dialog
1 parent c5e2b80 commit 10f36b0

File tree

1 file changed

+39
-40
lines changed

1 file changed

+39
-40
lines changed

packages/reactotron-app/App/Dialogs/SendCustomDialog.js

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react'
22
import ReactDOM from 'react-dom'
3-
import { ModalPortal, ModalBackground, ModalDialog } from 'react-modal-dialog'
3+
import Modal from 'react-modal'
44
import { inject, observer } from 'mobx-react'
55
import AppStyles from '../Theme/AppStyles'
66
import Colors from '../Theme/Colors'
@@ -19,7 +19,6 @@ const Styles = {
1919
dialog: {
2020
borderRadius: 4,
2121
padding: 4,
22-
width: 450,
2322
backgroundColor: Colors.background,
2423
color: Colors.foreground
2524
},
@@ -107,7 +106,7 @@ class SendCustomDialog extends Component {
107106
session.ui.setCustomMessage(e.target.value)
108107
}
109108

110-
componentDidUpdate () {
109+
componentDidUpdate() {
111110
const field = ReactDOM.findDOMNode(this.field)
112111

113112
field && field.focus()
@@ -120,51 +119,51 @@ class SendCustomDialog extends Component {
120119
e.preventDefault()
121120
}
122121

123-
render () {
122+
render() {
124123
const { ui } = this.props.session
125124
if (!ui.showSendCustomDialog) return null
126125

127126
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
151152
</a>{' '}
152-
for creating your own middleware.
153+
for creating your own middleware.
153154
</small>
154-
</div>
155+
</div>
155156

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}
164160
</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>
168167
)
169168
}
170169
}

0 commit comments

Comments
 (0)