Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3432 Rev 3585
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
 
5
import { useFetch } from '@hooks'
-
 
6
 
5
import { useFetch } from '@hooks';
Línea 7... Línea 6...
7
import styles from './PoliciesLayout.module.scss'
6
import colors from '@styles/colors';
8
 
7
 
9
const StyledBreadcrumbs = styled(Breadcrumbs)`
8
const StyledBreadcrumbs = styled(Breadcrumbs)`
10
  li a {
9
  li a {
Línea 14... Línea 13...
14
    border-radius: 20px;
13
    border-radius: 20px;
15
    &.active {
14
    &.active {
16
      display: none;
15
      display: none;
17
    }
16
    }
18
  }
17
  }
19
`
18
`;
-
 
19
 
-
 
20
const StyledPoliciesPage = styled('div')`
-
 
21
  h1 {
-
 
22
    margin-bottom: 1rem;
-
 
23
  }
-
 
24
 
-
 
25
  h2,
-
 
26
  h3,
-
 
27
  h4,
-
 
28
  h5,
-
 
29
  h6 {
-
 
30
    margin-bottom: 0.5rem;
-
 
31
  }
-
 
32
 
-
 
33
  > p {
-
 
34
    margin-bottom: 0.5rem;
-
 
35
  }
-
 
36
 
-
 
37
  table {
-
 
38
    background-color: ${colors.bg.primary};
-
 
39
 
-
 
40
    &,
-
 
41
    tr,
-
 
42
    td {
-
 
43
      border: 1px solid ${colors.border.primary};
-
 
44
    }
-
 
45
 
-
 
46
    td {
-
 
47
      padding: 5px;
-
 
48
    }
-
 
49
  }
-
 
50
`;
Línea 20... Línea 51...
20
 
51
 
21
const PoliciesLayout = ({ children, title }) => {
52
const PoliciesLayout = ({ children, title }) => {
22
  return (
53
  return (
23
    <>
54
    <>
24
      <PoliciesNavigation />
55
      <PoliciesNavigation />
25
      <Typography variant='h1'>{title}</Typography>
56
      <Typography variant='h1'>{title}</Typography>
26
      <div className={styles.policies__page}>{children}</div>
57
      <StyledPoliciesPage>{children}</StyledPoliciesPage>
27
    </>
58
    </>
28
  )
59
  );
Línea 29... Línea 60...
29
}
60
};
30
 
61
 
31
const PoliciesNavigation = () => {
62
const PoliciesNavigation = () => {
Línea 32... Línea 63...
32
  const { data, isLoading } = useFetch('/helpers/footer')
63
  const { data, isLoading } = useFetch('/helpers/footer');
Línea 33... Línea 64...
33
  const { pathname } = useLocation()
64
  const { pathname } = useLocation();
34
 
65
 
35
  if (isLoading) return null
66
  if (isLoading) return null;
36
 
67
 
37
  return (
68
  return (
Línea 38... Línea 69...
38
    <StyledBreadcrumbs sx={{ my: 2 }} aria-label='breadcrumb'>
69
    <StyledBreadcrumbs sx={{ my: 2 }} aria-label='breadcrumb'>
39
      <Link exact to='/'>
70
      <Link exact to='/'>
40
        Inicio
71
        Inicio
41
      </Link>
72
      </Link>
Línea 42... Línea 73...
42
 
73
 
43
      {Object.entries(data).map(([href, label]) => {
74
      {Object.entries(data).map(([href, label]) => {
44
        if (pathname.includes(href)) {
75
        if (pathname.includes(href)) {
45
          return null
76
          return null;
46
        }
77
        }
47
 
78
 
48
        return (
79
        return (
49
          <Link key={`${href}-${label}`} to={href}>
80
          <Link key={`${href}-${label}`} to={href}>
50
            {label}
81
            {label}
Línea 51... Línea 82...
51
          </Link>
82
          </Link>