File tree Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -33,23 +33,26 @@ function Modal(props) {
3333
3434 return (
3535 < React . Fragment >
36- < div className = "container p-1" style = { { display : openButton ? "block" : "none" } } >
37- < button className = "btn" onClick = { handleOpenButtonClick } > Open modal</ button >
38- </ div >
36+ { openButton &&
37+ < div className = "container p-1" >
38+ < button className = "btn" onClick = { handleOpenButtonClick } > Open modal</ button >
39+ </ div >
40+ }
3941
40- < div
41- style = { { display : ! isOpen ? "none" : "flex" } }
42- className = { classes . modalWrapper }
43- ref = { wrapperRef }
44- onClick = { handleWrapperClick }
45- >
46- < div className = { classes . modalBody } >
47- < div className = "rounded container p-3 bg-light" >
48- { props . children }
42+ { isOpen &&
43+ < div
44+ style = { { display : "flex" } }
45+ className = { classes . modalWrapper }
46+ ref = { wrapperRef }
47+ onClick = { handleWrapperClick }
48+ >
49+ < div className = { classes . modalBody } >
50+ < div className = "rounded container p-3 bg-light" >
51+ { props . children }
52+ </ div >
4953 </ div >
5054 </ div >
51- </ div >
52-
55+ }
5356 </ React . Fragment >
5457 )
5558}
You can’t perform that action at this time.
0 commit comments