Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 4999 | Rev 6471 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
4946 stevensc 1
/* eslint-disable react/prop-types */
2
import React from 'react'
3
 
4
const ListItemDropdown = ({ options = [], isShow }) => {
5266 stevensc 5
  if (!options.length) return null
6
  return (
4946 stevensc 7
        <nav className={`nav__options-dropdown ${isShow && 'show'}`}>
8
            <ul>{options.map((linkOption, index) =>
9
                <li key={index}>
10
                    {linkOption.childs?.length
5266 stevensc 11
                      ? <a href='/' onClick={(e) => e.preventDefault()}>{linkOption.label}</a>
12
                      : <a href={linkOption.href[0] === '/' ? linkOption.href : `/${linkOption.href}`} target='framename'>{linkOption.label}</a>
4946 stevensc 13
                    }
14
                    {!!linkOption.childs?.length &&
5266 stevensc 15
                        <nav className='navigation-level_three'>
4946 stevensc 16
                            <ul>
17
                                {linkOption.childs?.map((optionsChild, index) =>
18
                                    <li key={index}>
19
                                        <a href={`/${optionsChild.href}`} target='framename'>{optionsChild.label}</a>
20
                                    </li>
21
                                )}
22
                            </ul>
23
                        </nav>
24
                    }
25
                </li>
26
            )}
27
            </ul>
28
        </nav>
5266 stevensc 29
  )
4946 stevensc 30
}
31
 
5266 stevensc 32
export default ListItemDropdown