Skip to content

Commit 869d202

Browse files
committed
fix: remove close button from upload complete modal
1 parent 531e49d commit 869d202

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

web/src/modules/shared/components/client/GenericModal.tsx

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import { Fragment } from 'react';
77

88
export default function GenericModal({
99
isOpen,
10-
setIsOpen = () => {
11-
return;
12-
},
10+
setIsOpen,
1311
title,
1412
children,
1513
}: {
@@ -23,7 +21,13 @@ export default function GenericModal({
2321
<Dialog
2422
as='div'
2523
className='relative z-10'
26-
onClose={() => setIsOpen(false)}
24+
onClose={
25+
setIsOpen
26+
? () => setIsOpen(false)
27+
: () => {
28+
return;
29+
}
30+
}
2731
>
2832
<Transition.Child
2933
as={Fragment}
@@ -57,14 +61,16 @@ export default function GenericModal({
5761
</Dialog.Title>
5862

5963
{/* 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+
)}
6874

6975
{children}
7076
</Dialog.Panel>

0 commit comments

Comments
 (0)