Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev Autor Línea Nro. Línea
1368 stevensc 1
import React from 'react'
2
import { NavLink as Link } from 'react-router-dom'
1370 stevensc 3
import { Typography, Container, styled, Chip, Breadcrumbs } from '@mui/material'
1368 stevensc 4
 
5
import useFetch from '../../hooks/useFetch'
6
 
7
import styles from './PoliciesLayout.module.scss'
8
 
9
const StyledBreadcrumb = styled(Chip)(({ theme }) => {
10
  return {
11
    '&:active': {
1369 stevensc 12
      display: 'none'
1368 stevensc 13
    }
14
  }
15
})
16
 
17
const PoliciesLayout = ({ children, title }) => {
18
  return (
19
    <Container className={styles.policies__page}>
20
      <PoliciesNavigation />
21
 
22
      <Typography variant='h1'>{title}</Typography>
23
      {children}
24
    </Container>
25
  )
26
}
27
 
28
const PoliciesNavigation = () => {
29
  const { data, isLoading } = useFetch('/helpers/footer')
30
 
31
  if (isLoading) return null
32
 
33
  return (
34
    <Breadcrumbs aria-label='breadcrumb'>
35
      <StyledBreadcrumb to='/' component={Link} label='Inicio' />
36
 
37
      {Object.entries(data).map(([href, label]) => (
38
        <StyledBreadcrumb
39
          key={`${href}-${label}`}
40
          to={href}
41
          component={Link}
42
          label={label}
43
        />
44
      ))}
45
    </Breadcrumbs>
46
  )
47
}
48
 
49
export default PoliciesLayout