Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3012 | | Comparar con el anterior | Ultima modificación | Ver Log |

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