File tree Expand file tree Collapse file tree 1 file changed +18
-12
lines changed
web/src/modules/shared/components/client Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,7 @@ import { Fragment } from 'react';
7
7
8
8
export default function GenericModal ( {
9
9
isOpen,
10
- setIsOpen = ( ) => {
11
- return ;
12
- } ,
10
+ setIsOpen,
13
11
title,
14
12
children,
15
13
} : {
@@ -23,7 +21,13 @@ export default function GenericModal({
23
21
< Dialog
24
22
as = 'div'
25
23
className = 'relative z-10'
26
- onClose = { ( ) => setIsOpen ( false ) }
24
+ onClose = {
25
+ setIsOpen
26
+ ? ( ) => setIsOpen ( false )
27
+ : ( ) => {
28
+ return ;
29
+ }
30
+ }
27
31
>
28
32
< Transition . Child
29
33
as = { Fragment }
@@ -57,14 +61,16 @@ export default function GenericModal({
57
61
</ Dialog . Title >
58
62
59
63
{ /* X button */ }
60
- < button
61
- type = 'button'
62
- aria-label = 'Close'
63
- className = 'absolute top-3 right-4 w-4 h-4 text-white text-xl'
64
- onClick = { ( ) => setIsOpen ( false ) }
65
- >
66
- < FontAwesomeIcon icon = { faClose } />
67
- </ button >
64
+ { setIsOpen && (
65
+ < button
66
+ type = 'button'
67
+ aria-label = 'Close'
68
+ className = 'absolute top-3 right-4 w-4 h-4 text-white text-xl'
69
+ onClick = { ( ) => setIsOpen ( false ) }
70
+ >
71
+ < FontAwesomeIcon icon = { faClose } />
72
+ </ button >
73
+ ) }
68
74
69
75
{ children }
70
76
</ Dialog . Panel >
You can’t perform that action at this time.
0 commit comments