diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-10-19 19:30:54 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-11 18:14:41 +0100 |
| commit | c3cde71e60ae22d17c1d162f678f592915ac5398 (patch) | |
| tree | 770856e0876b8c613a21fa79199d6d40609d73e6 /src/components/molecules/nav/nav-list.tsx | |
| parent | 94448fa278ab352a741ff13f22d6104869571144 (diff) | |
refactor(components): rewrite NavLink component
* handle style variants to avoid declaring the styles in consumers
Diffstat (limited to 'src/components/molecules/nav/nav-list.tsx')
| -rw-r--r-- | src/components/molecules/nav/nav-list.tsx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/components/molecules/nav/nav-list.tsx b/src/components/molecules/nav/nav-list.tsx index b3c7138..a6acdcf 100644 --- a/src/components/molecules/nav/nav-list.tsx +++ b/src/components/molecules/nav/nav-list.tsx @@ -49,8 +49,7 @@ export const NavList: FC<NavListProps> = ({ listClassName = '', ...props }) => { - const kindClass = `nav--${kind}`; - const navClass = `${styles.nav} ${styles[kindClass]} ${className}`; + const navClass = [styles[`nav--${kind}`], className].join(' '); /** * Get the nav items. @@ -60,7 +59,7 @@ export const NavList: FC<NavListProps> = ({ items.map(({ id, href, label, logo }) => ( <ListItem key={id} className={styles.nav__item}> {kind === 'main' ? ( - <NavLink href={href} label={label} logo={logo} /> + <NavLink href={href} label={label} logo={logo} variant="main" /> ) : ( <Link href={href}>{label}</Link> )} |
