|
1 | 1 | import { Button } from '@/lib/components/ui/Button'; |
| 2 | +import { Dialog, DialogContent, DialogTitle } from '@/lib/components/ui/Modal'; |
| 3 | +import { VisuallyHidden } from '@radix-ui/react-visually-hidden'; |
2 | 4 |
|
3 | 5 | type WindowUnfocusedModalProps = { |
4 | 6 | open: boolean; |
5 | 7 | onAcknowledge: () => void; |
6 | 8 | }; |
7 | 9 |
|
8 | 10 | export function WindowUnfocusedModal({ open, onAcknowledge }: WindowUnfocusedModalProps) { |
9 | | - if (!open) return null; |
10 | | - |
11 | 11 | return ( |
12 | | - <div className="fixed inset-0 z-50 flex items-center justify-center bg-white/25 p-4 backdrop-blur-md"> |
13 | | - <div className="bg-sarge-gray-0 border-sarge-gray-200 flex w-full max-w-[380px] flex-col items-center gap-4 rounded-lg border px-8 py-7 text-center shadow-lg"> |
14 | | - <div className="space-y-3"> |
15 | | - <h2 className="text-sarge-gray-900 text-base leading-snug font-bold"> |
16 | | - You can't unfocus your assessment window during the exam |
17 | | - </h2> |
18 | | - <p className="text-sarge-gray-600 text-sm">The admin has been notified.</p> |
| 12 | + <Dialog open={open} onOpenChange={() => {}}> |
| 13 | + <DialogContent |
| 14 | + className="h-[184px] w-[361px] gap-4" |
| 15 | + backgroundClassName="bg-white/25 backdrop-blur-md" |
| 16 | + showCloseButton={false} |
| 17 | + > |
| 18 | + <VisuallyHidden> |
| 19 | + <DialogTitle>Window Unfocused</DialogTitle> |
| 20 | + </VisuallyHidden> |
| 21 | + <div className="flex h-full flex-col items-center justify-center gap-4 px-6 text-center"> |
| 22 | + <div className="space-y-1"> |
| 23 | + <p className="text-md font-semibold tracking-wide"> |
| 24 | + You can't unfocus your window during the exam |
| 25 | + </p> |
| 26 | + <p className="text-sm">The admin has been notified.</p> |
| 27 | + </div> |
| 28 | + <Button className="h-9 min-w-28 px-5" onClick={onAcknowledge}> |
| 29 | + I understand |
| 30 | + </Button> |
19 | 31 | </div> |
20 | | - <Button className="h-9 min-w-28 px-5" onClick={onAcknowledge}> |
21 | | - I understand |
22 | | - </Button> |
23 | | - </div> |
24 | | - </div> |
| 32 | + </DialogContent> |
| 33 | + </Dialog> |
25 | 34 | ); |
26 | 35 | } |
0 commit comments