|
1 | 1 | 'use client'; |
2 | | -import { Box, Button, Modal, Typography } from '@mui/material'; |
| 2 | + |
3 | 3 | import { useState } from 'react'; |
4 | 4 |
|
5 | | -const style = { |
6 | | - position: 'absolute', |
7 | | - top: '50%', |
8 | | - left: '50%', |
9 | | - transform: 'translate(-50%, -50%)', |
10 | | - width: { xs: '80%', sm: '60%' }, |
11 | | - bgcolor: 'background.paper', |
12 | | - border: '2px solid #000', |
13 | | - boxShadow: 24, |
14 | | - p: 4, |
15 | | -} as const; |
| 5 | +import { |
| 6 | + Dialog, |
| 7 | + DialogContent, |
| 8 | + DialogHeader, |
| 9 | + DialogTitle, |
| 10 | +} from '@/components/ui/dialog'; |
| 11 | +import { Button } from '@/components/ui/button'; |
16 | 12 |
|
17 | 13 | export default function TACModal() { |
18 | 14 | const [open, setOpen] = useState(false); |
19 | 15 | const handleOpen = () => setOpen(true); |
20 | | - const handleClose = () => setOpen(false); |
21 | 16 |
|
22 | 17 | return ( |
23 | 18 | <div> |
24 | | - <Button onClick={handleOpen}>View Terms and Conditions</Button> |
25 | | - <Modal |
26 | | - open={open} |
27 | | - onClose={handleClose} |
28 | | - aria-labelledby='modal-modal-title' |
29 | | - aria-describedby='modal-modal-description' |
30 | | - > |
31 | | - <Box sx={style}> |
32 | | - <Typography id='modal-modal-title' variant='h6' component='h2' align='center'> |
33 | | - Terms and Conditions |
34 | | - </Typography> |
35 | | - <Typography id='modal-modal-description' sx={{ mt: 2 }}> |
36 | | - <ol className='list-decimal'> |
| 19 | + <Button variant='link' onClick={handleOpen}> |
| 20 | + VIEW |
| 21 | + </Button> |
| 22 | + <Dialog open={open} onOpenChange={setOpen}> |
| 23 | + <DialogContent className='max-w-xl'> |
| 24 | + <DialogHeader> |
| 25 | + <DialogTitle className='text-center'>Terms and Conditions</DialogTitle> |
| 26 | + </DialogHeader> |
| 27 | + <div className='space-y-4 text-sm text-muted-foreground mt-2 max-h-[70vh] overflow-y-auto'> |
| 28 | + <ol className='list-decimal list-inside space-y-2'> |
37 | 29 | <li>You can use Polygon to develop problems only.</li> |
38 | 30 | <li> |
39 | 31 | You should use your real name and all information about you should be |
40 | 32 | correct and accurate. |
41 | 33 | </li> |
42 | 34 | <li> |
43 | 35 | You should not submit files containing malicious code: |
44 | | - <ul className='list-disc list-inside'> |
45 | | - <li>trojan horses;</li> |
46 | | - <li>rootkits;</li> |
47 | | - <li>backdoors;</li> |
48 | | - <li>viruses.</li> |
| 36 | + <ul className='list-disc list-inside ml-6'> |
| 37 | + <li>trojan horses</li> |
| 38 | + <li>rootkits</li> |
| 39 | + <li>backdoors</li> |
| 40 | + <li>viruses</li> |
49 | 41 | </ul> |
50 | 42 | </li> |
51 | 43 | <li> |
52 | | - Your code not allowed to: |
53 | | - <ul className='list-disc list-inside'> |
54 | | - <li>access the network;</li> |
| 44 | + Your code is not allowed to: |
| 45 | + <ul className='list-disc list-inside ml-6'> |
| 46 | + <li>access the network</li> |
55 | 47 | <li> |
56 | 48 | work with any files except those explicitly specified in the problem |
57 | | - statement; |
| 49 | + statement |
58 | 50 | </li> |
59 | | - <li>attack system security;</li> |
60 | | - <li>execute other programs and create new processes;</li> |
61 | | - <li>change file system permissions;</li> |
62 | | - <li>work with subdirectories;</li> |
| 51 | + <li>attack system security</li> |
| 52 | + <li>execute other programs and create new processes</li> |
| 53 | + <li>change file system permissions</li> |
| 54 | + <li>work with subdirectories</li> |
63 | 55 | <li> |
64 | | - create or manipulate any GUI items (windows, dialog boxes, etc); |
| 56 | + create or manipulate any GUI items (windows, dialog boxes, etc) |
65 | 57 | </li> |
66 | | - <li>work with external devices (sound, printer, etc);</li> |
67 | | - <li>work with OS registry;</li> |
68 | | - <li>do anything else that can stir Polygon functioning.</li> |
| 58 | + <li>work with external devices (sound, printer, etc)</li> |
| 59 | + <li>work with OS registry</li> |
| 60 | + <li>do anything else that can stir Polygon functioning</li> |
69 | 61 | </ul> |
70 | 62 | </li> |
71 | 63 | </ol> |
72 | | - </Typography> |
73 | | - </Box> |
74 | | - </Modal> |
| 64 | + </div> |
| 65 | + </DialogContent> |
| 66 | + </Dialog> |
75 | 67 | </div> |
76 | 68 | ); |
77 | 69 | } |
0 commit comments