Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3416 | Rev 3585 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3416 Rev 3432
Línea 1... Línea 1...
1
import React from "react";
1
import React from 'react'
2
import { NavLink as Link, useLocation } from "react-router-dom";
2
import { NavLink as Link, useLocation } from 'react-router-dom'
3
import { Typography, styled, Breadcrumbs } from "@mui/material";
3
import { Typography, styled, Breadcrumbs } from '@mui/material'
Línea 4... Línea 4...
4
 
4
 
Línea 5... Línea 5...
5
import { useFetch } from "@hooks";
5
import { useFetch } from '@hooks'
Línea 6... Línea 6...
6
 
6
 
7
import styles from "./PoliciesLayout.module.scss";
7
import styles from './PoliciesLayout.module.scss'
8
 
8
 
9
const StyledBreadcrumbs = styled(Breadcrumbs)`
9
const StyledBreadcrumbs = styled(Breadcrumbs)`
Línea 14... Línea 14...
14
    border-radius: 20px;
14
    border-radius: 20px;
15
    &.active {
15
    &.active {
16
      display: none;
16
      display: none;
17
    }
17
    }
18
  }
18
  }
19
`;
19
`
Línea 20... Línea 20...
20
 
20
 
21
const PoliciesLayout = ({ children, title }) => {
21
const PoliciesLayout = ({ children, title }) => {
22
  return (
22
  return (
23
    <>
23
    <>
24
      <PoliciesNavigation />
24
      <PoliciesNavigation />
25
      <Typography variant="h1">{title}</Typography>
25
      <Typography variant='h1'>{title}</Typography>
26
      <div className={styles.policies__page}>{children}</div>
26
      <div className={styles.policies__page}>{children}</div>
27
    </>
27
    </>
28
  );
28
  )
Línea 29... Línea 29...
29
};
29
}
30
 
30
 
31
const PoliciesNavigation = () => {
31
const PoliciesNavigation = () => {
Línea 32... Línea 32...
32
  const { data, loading } = useFetch("/helpers/footer");
32
  const { data, isLoading } = useFetch('/helpers/footer')
Línea 33... Línea 33...
33
  const { pathname } = useLocation();
33
  const { pathname } = useLocation()
34
 
34
 
35
  if (loading) return null;
35
  if (isLoading) return null
36
 
36
 
37
  return (
37
  return (
Línea 38... Línea 38...
38
    <StyledBreadcrumbs sx={{ my: 2 }} aria-label="breadcrumb">
38
    <StyledBreadcrumbs sx={{ my: 2 }} aria-label='breadcrumb'>
39
      <Link exact to="/">
39
      <Link exact to='/'>
40
        Inicio
40
        Inicio
41
      </Link>
41
      </Link>
Línea 42... Línea 42...
42
 
42
 
43
      {Object.entries(data).map(([href, label]) => {
43
      {Object.entries(data).map(([href, label]) => {
44
        if (pathname.includes(href)) {
44
        if (pathname.includes(href)) {
45
          return null;
45
          return null
46
        }
46
        }
47
 
47
 
48
        return (
48
        return (
49
          <Link key={`${href}-${label}`} to={href}>
49
          <Link key={`${href}-${label}`} to={href}>
50
            {label}
50
            {label}
Línea 51... Línea 51...
51
          </Link>
51
          </Link>