Skip to content

Commit cbbb4ab

Browse files
comments
1 parent a65cd17 commit cbbb4ab

File tree

7 files changed

+9
-14
lines changed

7 files changed

+9
-14
lines changed

src/components/appointments/Appointments.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,7 @@ class Appointments extends Component {
203203
update={this.update}
204204
signin={this.signin}
205205
signout={this.signout}
206-
history={props.history}
207-
parent_el={this.props.config.modal_parent}/>
206+
history={props.history}/>
208207
)}/>
209208
</div>
210209
)

src/components/appointments/AptModal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class AptModal extends Component {
165165
render () {
166166
if (!this.props.got_data) {
167167
return (
168-
<Modal history={this.props.history} title='' parent_el={this.props.config.modal_parent}>
168+
<Modal history={this.props.history} title='' config={this.props.config}>
169169
<p>Loading...</p>
170170
</Modal>
171171
)
@@ -196,7 +196,7 @@ class AptModal extends Component {
196196
title={title}
197197
last_url={this.props.last_url}
198198
flex={false}
199-
parent_el={this.props.config.modal_parent}>
199+
config={this.props.config}>
200200
<AptDetails apt={apt}
201201
spaces_available={spaces_available}
202202
attending={Boolean(this.state.display_data && this.state.attendees)}

src/components/contractors/ConModal.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,22 @@ class ConModal extends Component {
3838
render () {
3939
if (!this.props.got_contractors) {
4040
return (
41-
<Modal history={this.props.history} title='' parent_el={this.props.config.modal_parent}>
41+
<Modal history={this.props.history} title='' config={this.props.config}>
4242
<p>Loading...</p>
4343
</Modal>
4444
)
4545
}
4646
const _con = this.get_contractor()
4747
if (!_con) {
4848
return (
49-
<Modal history={this.props.history} parent_el={this.props.config.modal_parent} title='Contractor not Found'>
49+
<Modal history={this.props.history} config={this.props.config} title='Contractor not Found'>
5050
<p>No Contractor found with id {this.props.id}.</p>
5151
</Modal>
5252
)
5353
}
5454
const {contractor, contractor_extra} = _con
5555
return (
56-
<Modal history={this.props.history} title={contractor.name} last_url={this.props.last_url}>
56+
<Modal history={this.props.history} title={contractor.name} last_url={this.props.last_url} config={this.props.config}>
5757
<div className="tcs-extra">
5858
<Photo contractor={contractor} config={this.props.config}/>
5959
<Stars contractor={contractor} config={this.props.config}/>

src/components/contractors/Contractors.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ class Contractors extends Component {
201201
get_contractor_details={this.get_contractor_details}
202202
root={this.props.root}
203203
config={this.props.config}
204-
parent_el={this.props.config.modal_parent}
205204
history={props.history}/>
206205
)}/>
207206
</div>

src/components/enquiry/EnquiryModal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Modal from '../shared/Modal'
33
import EnquiryForm from '../shared/EnquiryForm'
44

55
const EnquiryModal = ({root, config, history}) => (
6-
<Modal history={history} title={config.get_text('enquiry_title')} parent_el={config.modal_parent}>
6+
<Modal history={history} title={config.get_text('enquiry_title')} config={config}>
77
<div className="tcs-content">
88
<EnquiryForm root={root} config={config} mode='enquiry-modal'/>
99
</div>

src/components/shared/Modal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ class Modal extends Component {
6363
</div>
6464
</div>
6565
)
66-
if (this.props.parent_el) {
67-
return ReactDOM.createPortal(el, document.getElementById(this.props.parent_el))
66+
if (this.props.config.parent_el) {
67+
return ReactDOM.createPortal(el, document.getElementById(this.props.config.parent_el))
6868
} else {
6969
return el
7070
}

src/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,6 @@ window.socket = async function (public_key, config) {
151151
if (!config.element) {
152152
config.element = '#socket'
153153
}
154-
if (!config.modal_parent) {
155-
config.modal_parent = null
156-
}
157154

158155
config.contractor_filter = {}
159156
if (config.labels_include) {

0 commit comments

Comments
 (0)