File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ class AptModal extends Component {
174174 if ( ! apt ) {
175175 return (
176176 < Modal history = { this . props . history }
177- parent_el = { this . props . config . modal_parent }
177+ config = { this . props . config }
178178 title = { this . props . config . get_text ( 'appointment_not_found' ) } >
179179 < p > { this . props . config . get_text ( 'appointment_not_found_id' , { apt_id : this . props . id } ) } </ p >
180180 </ Modal >
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ class Modal extends Component {
4545
4646 render ( ) {
4747 const flex = this . props . flex !== undefined ? Boolean ( this . props . flex ) : true
48- const el = (
48+ const modal_content = (
4949 < div className = { 'tcs-modal-mask' + ( this . state . show ? ' tcs-show' : '' ) } onClick = { this . close } >
5050 < div className = "tcs-modal" onClick = { e => e . stopPropagation ( ) } >
5151 < div className = "tcs-header" >
@@ -63,10 +63,11 @@ class Modal extends Component {
6363 </ div >
6464 </ div >
6565 )
66- if ( this . props . config . parent_el ) {
67- return ReactDOM . createPortal ( el , document . getElementById ( this . props . config . parent_el ) )
66+ const container_id = this . props . config . modal_container
67+ if ( container_id ) {
68+ return ReactDOM . createPortal ( modal_content , document . getElementById ( container_id ) )
6869 } else {
69- return el
70+ return modal_content
7071 }
7172 }
7273}
You can’t perform that action at this time.
0 commit comments