Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6632 Rev 6797
Línea 1... Línea -...
1
/* eslint-disable react/prop-types */
-
 
2
import React from 'react'
1
import React from 'react'
-
 
2
import { Link } from 'react-router-dom'
Línea 3... Línea 3...
3
 
3
 
4
const ListItemDropdown = ({ options = [], isShow }) => {
4
const ListItemDropdown = ({ options = [], isShow }) => {
5
  if (!options.length) return null
5
  if (!options.length) return null
6
  return (
6
  return (
7
    <nav className={`nav__options-dropdown ${isShow && 'show'}`}>
7
    <nav className={`nav__options-dropdown ${isShow && 'show'}`}>
8
      <ul>
8
      <ul>
9
        {options.map((linkOption, index) => (
9
        {options.map((linkOption, index) => (
10
          <li key={index}>
10
          <li key={index}>
11
            {linkOption.childs?.length ? (
11
            {linkOption.childs?.length ? (
12
              <a href="/" onClick={(e) => e.preventDefault()}>
12
              <Link href="/" onClick={(e) => e.preventDefault()}>
13
                {linkOption.label}
13
                {linkOption.label}
14
              </a>
14
              </Link>
15
            ) : (
15
            ) : (
16
              <a
16
              <Link
17
                href={
17
                href={
18
                  linkOption.href[0] === '/'
18
                  linkOption.href[0] === '/'
19
                    ? linkOption.href
19
                    ? linkOption.href
20
                    : `/${linkOption.href}`
20
                    : `/${linkOption.href}`
21
                }
-
 
22
                target="framename"
21
                }
23
              >
22
              >
24
                {linkOption.label}
23
                {linkOption.label}
25
                {Boolean(linkOption.count) && (
24
                {Boolean(linkOption.count) && (
26
                  <span
25
                  <span
27
                    className="badge position-relative ml-2"
26
                    className="badge position-relative ml-2"
28
                    style={{ left: 'auto', transform: 'none' }}
27
                    style={{ left: 'auto', transform: 'none' }}
29
                  >
28
                  >
30
                    {linkOption.count}
29
                    {linkOption.count}
31
                  </span>
30
                  </span>
32
                )}
31
                )}
33
              </a>
32
              </Link>
34
            )}
33
            )}
35
            {!!linkOption.childs?.length && (
34
            {!!linkOption.childs?.length && (
36
              <nav className="navigation-level_three">
35
              <nav className="navigation-level_three">
37
                <ul>
36
                <ul>
38
                  {linkOption.childs?.map((optionsChild, index) => (
37
                  {linkOption.childs?.map((optionsChild, index) => (
39
                    <li key={index}>
38
                    <li key={index}>
40
                      <a href={`/${optionsChild.href}`} target="framename">
39
                      <Link href={`/${optionsChild.href}`} target="framename">
41
                        {optionsChild.label}
40
                        {optionsChild.label}
42
                      </a>
41
                      </Link>
43
                    </li>
42
                    </li>
44
                  ))}
43
                  ))}
45
                </ul>
44
                </ul>
46
              </nav>
45
              </nav>