Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2990 | Rev 3012 | 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),
20
          marginBottom: (theme) => theme.spacing(1)
21
        }}
22
      >
23
        <IconButton
24
          onClick={navigateBefore}
25
          sx={{ padding: (theme) => theme.spacing(0.3) }}
26
        >
2984 stevensc 27
          <NavigateBefore />
28
        </IconButton>
2983 stevensc 29
 
3001 stevensc 30
        <Typography variant='h1' sx={{ marginBottom: 0 }}>
2984 stevensc 31
          {title}
32
        </Typography>
33
      </Box>
34
      {children}
35
    </>
2983 stevensc 36
  )
37
}