Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3012 Rev 3719
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react';
2
import { NavigateBefore } from '@mui/icons-material'
2
import { NavigateBefore } from '@mui/icons-material';
3
import { Box, IconButton, Typography } from '@mui/material'
3
import { Box, IconButton, Typography } from '@mui/material';
4
import { useNavigate } from 'react-router-dom'
4
import { useNavigate } from 'react-router-dom';
5
 
5
 
6
export default function GoBackLayout({ title, children }) {
6
export default function GoBackLayout({ title, children }) {
7
  const navigate = useNavigate()
7
  const navigate = useNavigate();
8
 
8
 
9
  const navigateBefore = () => {
9
  const navigateBefore = () => {
10
    navigate(-1)
10
    navigate(-1);
11
  }
11
  };
12
 
12
 
13
  return (
13
  return (
14
    <>
14
    <>
15
      <Box
15
      <Box
16
        sx={{
16
        sx={{
17
          display: 'flex',
17
          display: 'flex',
18
          alignItems: 'center',
18
          alignItems: 'center',
19
          gap: (theme) => theme.spacing(0.5),
19
          gap: (theme) => theme.spacing(0.5),
20
          marginBottom: (theme) => theme.spacing(1),
20
          marginBottom: (theme) => theme.spacing(1),
21
          padding: (theme) => theme.spacing(0, 0.5)
21
          padding: (theme) => theme.spacing(0, 0.5)
22
        }}
22
        }}
23
      >
23
      >
24
        <IconButton
-
 
25
          onClick={navigateBefore}
-
 
26
          sx={{ padding: (theme) => theme.spacing(0.3) }}
24
        <IconButton onClick={navigateBefore} sx={{ padding: (theme) => theme.spacing(0.3) }}>
27
        >
-
 
28
          <NavigateBefore />
25
          <NavigateBefore />
29
        </IconButton>
26
        </IconButton>
30
 
27
 
31
        <Typography variant='h1' sx={{ marginBottom: 0 }}>
28
        <Typography variant='h1' sx={{ marginBottom: 0 }}>
32
          {title}
29
          {title}
33
        </Typography>
30
        </Typography>
34
      </Box>
31
      </Box>
35
      {children}
32
      {children}
36
    </>
33
    </>
37
  )
34
  );
38
}
35
}