Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3719 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3719 Rev 3741
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { Box, Modal as MuiModal, IconButton } from '@mui/material';
2
import { Modal as MuiModal, IconButton } from '@mui/material';
3
import Close from '@mui/icons-material/Close';
3
import Close from '@mui/icons-material/Close';
Línea 4... Línea 4...
4
 
4
 
5
import { useModal } from '@shared/hooks';
5
import { useModal } from '@shared/hooks';
Línea 6... Línea 6...
6
import { Card, CardHeader, CardContent } from './card';
6
import { Card, CardHeader, CardContent } from './card';
7
 
7
 
Línea 8... Línea 8...
8
export function Modal() {
8
export function Modal() {
9
  const { show, title, content, closeModal } = useModal();
9
  const { show, title, content, closeModal } = useModal();
10
 
10
 
11
  return (
11
  return (
12
    <MuiModal open={show} onClose={closeModal}>
12
    <MuiModal open={show} onClose={closeModal}>
13
      <Box
13
      <Card
14
        sx={{
14
        sx={{
15
          position: 'fixed',
15
          position: 'absolute',
16
          top: '50%',
-
 
17
          left: '50%',
-
 
18
          transform: 'translate(-50%, -50%)',
16
          top: '50%',
19
          display: 'flex',
17
          left: '50%',
20
          justifyContent: 'center',
-
 
21
          alignItems: 'center',
18
          transform: 'translate(-50%, -50%)',
22
          width: '100%',
19
          maxWidth: { xs: '90vw', md: '500px' },
23
          height: '100%'
-
 
24
        }}
20
          width: '100%'
25
      >
21
        }}
26
        <Card sx={{ width: '100%', maxWidth: { xs: '90vw', md: '500px' } }}>
22
      >
27
          <CardHeader
23
        <CardHeader
28
            title={title}
24
          title={title}
29
            renderAction={() => (
25
          renderAction={() => (
30
              <IconButton onClick={closeModal}>
26
            <IconButton onClick={closeModal}>
31
                <Close />
27
              <Close />
32
              </IconButton>
28
            </IconButton>
33
            )}
29
          )}
34
          />
-
 
35
          <CardContent styles={{ maxHeight: '70vh', overflowY: 'auto' }}>{content}</CardContent>
30
        />
36
        </Card>
31
        <CardContent styles={{ maxHeight: '70vh', overflowY: 'auto' }}>{content}</CardContent>
37
      </Box>
32
      </Card>