Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3001 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
2983 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
 
2984 stevensc 6
export default function GoBackLayout({ title, children }) {
2983 stevensc 7
  const navigate = useNavigate()
8
 
9
  const navigateBefore = () => {
10
    navigate(-1)
11
  }
12
 
13
  return (
2984 stevensc 14
    <>
2990 stevensc 15
      <Box
16
        sx={{
17
          display: 'flex',
18
          alignItems: 'center',
19
          gap: (theme) => theme.spacing(0.5),
3012 stevensc 20
          marginBottom: (theme) => theme.spacing(1),
21
          padding: (theme) => theme.spacing(0, 0.5)
2990 stevensc 22
        }}
23
      >
24
        <IconButton
25
          onClick={navigateBefore}
26
          sx={{ padding: (theme) => theme.spacing(0.3) }}
27
        >
2984 stevensc 28
          <NavigateBefore />
29
        </IconButton>
2983 stevensc 30
 
3001 stevensc 31
        <Typography variant='h1' sx={{ marginBottom: 0 }}>
2984 stevensc 32
          {title}
33
        </Typography>
34
      </Box>
35
      {children}
36
    </>
2983 stevensc 37
  )
38
}