Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6797 Rev 6798
Línea 4... Línea 4...
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(({ label, href, childs, count }, index) => (
10
          <li key={index}>
10
          <li key={index}>
11
            {linkOption.childs?.length ? (
-
 
12
              <Link href="/" onClick={(e) => e.preventDefault()}>
-
 
13
                {linkOption.label}
-
 
14
              </Link>
-
 
15
            ) : (
-
 
16
              <Link
11
            <Link
17
                href={
-
 
18
                  linkOption.href[0] === '/'
-
 
19
                    ? linkOption.href
12
              to={href[0] === '/' ? href : `/${href}`}
20
                    : `/${linkOption.href}`
13
              onClick={(e) => childs.length && e.preventDefault()}
21
                }
-
 
22
              >
14
            >
23
                {linkOption.label}
15
              {label}
24
                {Boolean(linkOption.count) && (
16
              {Boolean(count) && (
25
                  <span
17
                <span
26
                    className="badge position-relative ml-2"
18
                  className="badge position-relative ml-2"
27
                    style={{ left: 'auto', transform: 'none' }}
19
                  style={{ left: 'auto', transform: 'none' }}
28
                  >
20
                >
29
                    {linkOption.count}
21
                  {count}
30
                  </span>
22
                </span>
31
                )}
23
              )}
32
              </Link>
24
            </Link>
33
            )}
-
 
34
            {!!linkOption.childs?.length && (
25
            {childs?.length && (
35
              <nav className="navigation-level_three">
26
              <nav className="navigation-level_three">
36
                <ul>
27
                <ul>
37
                  {linkOption.childs?.map((optionsChild, index) => (
28
                  {childs?.map((optionsChild, index) => (
38
                    <li key={index}>
29
                    <li key={index}>
39
                      <Link href={`/${optionsChild.href}`} target="framename">
30
                      <Link href={`/${optionsChild.href}`} target="framename">
40
                        {optionsChild.label}
31
                        {optionsChild.label}
41
                      </Link>
32
                      </Link>
42
                    </li>
33
                    </li>