Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 4253 Rev 4427
Línea 1... Línea 1...
1
/* eslint-disable react/prop-types */
1
/* eslint-disable react/prop-types */
2
import React from 'react'
2
import React from 'react'
3
import './HeaderOptions.scss'
3
import './HeaderOptions.scss'
Línea 4... Línea 4...
4
 
4
 
Línea 5... Línea 5...
5
const HeaderOptions = ({ Icon, title, url }) => {
5
const HeaderOptions = ({ Icon, title, url, childs = [] }) => {
6
 
6
 
7
    return (
7
    return (
8
        <li>
8
        <li>
9
            <a href={url} className="header__option">
9
            <a href={url} className="header__option">
10
                {Icon && <Icon className="header__option-icon" />}
10
                {Icon && <Icon className="header__option-icon" />}
-
 
11
                <span>{title}</span>
-
 
12
            </a>
-
 
13
            {!!childs.length &&
-
 
14
                <nav className='user__options-dropdown'>
-
 
15
                    <ul>{childs.map((linkOption, index) =>
-
 
16
                        <li key={index}>
-
 
17
                            {linkOption.childs.length
-
 
18
                                ? <a href='/' onClick={(e) => e.preventDefault()}>{linkOption.label}</a>
-
 
19
                                : <a href={linkOption.href}>{linkOption.label}</a>
-
 
20
                            }
-
 
21
                            {!!linkOption.childs.length &&
-
 
22
                                <nav className='navLinkLevelThree'>
-
 
23
                                    <ul>
-
 
24
                                        {linkOption.childs?.map((optionsChild, index) =>
-
 
25
                                            <li key={index}>
-
 
26
                                                <a href={optionsChild.href}>{optionsChild.label}</a>
-
 
27
                                            </li>
-
 
28
                                        )}
-
 
29
                                    </ul>
-
 
30
                                </nav>
-
 
31
                            }
-
 
32
                        </li>
-
 
33
                    )}
-
 
34
                    </ul>
11
                <span>{title}</span>
35
                </nav>
12
            </a>
36
            }
13
        </li>
37
        </li>
Línea 14... Línea 38...
14
    )
38
    )
15
}
39
}