Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6840 Rev 6842
Línea 2... Línea 2...
2
import { Link } from 'react-router-dom'
2
import { Link } from 'react-router-dom'
3
import Badge from '../../UI/Badge'
3
import Badge from '../../UI/Badge'
Línea 4... Línea 4...
4
 
4
 
5
const ListItemDropdown = ({ options = [], isShow }) => {
5
const ListItemDropdown = ({ options = [], isShow }) => {
-
 
6
  if (!options.length) return null
6
  if (!options.length) return null
7
 
7
  return (
8
  return (
8
    <nav className={`nav__options-dropdown ${isShow && 'show'}`}>
9
    <nav className={`nav__options-dropdown ${isShow && 'show'}`}>
9
      <ul>
10
      <ul>
10
        {options.map(({ label, href, childs, count }, index) => (
11
        {options.map(({ label, href, childs, count }, index) => (
11
          <li key={index}>
12
          <li key={index}>
12
            <Link
13
            <Link
13
              to={href[0] === '/' ? href : `/${href}`}
14
              to={href[0] === '/' ? href : `/${href}`}
14
              onClick={(e) => childs.length && e.preventDefault()}
15
              onClick={(e) => childs.length && e.preventDefault()}
15
            >
16
            >
16
              {label}
17
              {label}
17
              {count && <Badge count={count} />}
18
              {count && <Badge count={count} className="position-relative" />}
18
            </Link>
19
            </Link>
19
            {childs?.length && (
20
            {Boolean(childs.length) && (
20
              <nav className="navigation-level_three">
21
              <nav className="navigation-level_three">
21
                <ul>
22
                <ul>
22
                  {childs?.map((optionsChild, index) => (
23
                  {childs?.map((optionsChild, index) => (
23
                    <li key={index}>
24
                    <li key={index}>