Skip to content

Commit 7c3a3fb

Browse files
billy-lekylemh
andauthored
Chore/nav tw (#1912)
* replace Nav css modules to tw * replace NavMobile css modules to tw * add NavLink type * less types --------- Co-authored-by: Kyle Holmberg <kylemh.email@gmail.com>
1 parent 86de0fc commit 7c3a3fb

11 files changed

Lines changed: 163 additions & 442 deletions

File tree

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import flattenDepth from 'lodash/flattenDepth';
2-
31
const donate = {
42
href: '/donate',
53
name: 'Donate',
@@ -110,12 +108,12 @@ const getInvolvedGroup = {
110108
export const desktopNavItems = [aboutUsGroup, servicesGroup, getInvolvedGroup];
111109

112110
// Extracts sublinks to list everything as a single, top-level list
113-
export const mobileNavItems = flattenDepth(
114-
[about, getInvolved, ...servicesGroup.sublinks, ...getInvolvedGroup.sublinks].map(
115-
({ sublinks = [], ...item }) => [item, sublinks],
116-
),
117-
2,
118-
);
111+
export const mobileNavItems = [
112+
about,
113+
getInvolved,
114+
servicesGroup.sublinks,
115+
getInvolvedGroup.sublinks,
116+
].flat();
119117

120118
export const footerItems = {
121119
items: [

components/Nav/Nav.module.css

Lines changed: 0 additions & 84 deletions
This file was deleted.

components/Nav/Nav.tsx

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import { desktopNavItems, mobileNavItems } from 'common/constants/navigation';
77
import NavMobile from 'components/Nav/NavMobile/NavMobile';
88
import dynamic from 'next/dynamic';
99
import { cx } from 'common/utils/cva';
10-
import UserLogo from '../../public/static/images/icons/FontAwesome/user.svg';
11-
import styles from './Nav.module.css';
1210

1311
const NavListItem = dynamic(() => import('components/Nav/NavListItem/NavListItem'), { ssr: false });
1412

@@ -43,42 +41,38 @@ export const Nav = () => {
4341
navItems={mobileNavItems}
4442
/>
4543

46-
<header className={styles.NavDesktop}>
47-
<div className={styles.desktopNavContainer} data-testid="Desktop Nav Container">
48-
<nav data-testid="Desktop Nav">
44+
<header className="hidden absolute top-4 w-full z-10 sm:block">
45+
<div className="mx-auto max-w-[1400px]" data-testid="Desktop Nav Container">
46+
<nav
47+
className="font-bold h-16 bg-white rounded-sm flex justify-between"
48+
data-testid="Desktop Nav"
49+
>
4950
<Link href="/" key="Home">
5051
<a
51-
className={cx(styles.logoLink, styles.link, '[&>svg]:-bottom-2 [&>svg]:right-3')}
52+
className="mx-4 flex items-center"
5253
onContextMenu={event => {
5354
event.preventDefault();
5455
Router.push('/branding');
5556
}}
5657
>
57-
<Logo className={styles.logo} style={{ width: 224, height: 42 }} fill="#f7f7f7" />
58+
<Logo className="w-56 fill-white" />
5859
</a>
5960
</Link>
6061

61-
<ul className={cx(styles.link, '[&>svg]:-bottom-2 [&>svg]:right-3')}>
62+
<ul className="flex">
6263
{desktopNavItems.map(navItem => (
63-
<NavListItem
64-
key={navItem.name}
65-
{...navItem}
66-
icon={
67-
'icon' in navItem && navItem.icon === 'UserLogo' ? (
68-
<UserLogo className={styles.navIcon} />
69-
) : null
70-
}
71-
/>
64+
<NavListItem key={navItem.name} {...navItem} />
7265
))}
7366

7467
{/* stylistic one-off */}
7568
<li key="Donate">
7669
<Link href="/donate">
7770
<a
7871
className={cx(
79-
styles.link,
80-
'[&>svg]:-bottom-2 [&>svg]:right-3',
81-
styles.donateLink,
72+
'pt-1 px-8 font-bold bg-primary text-secondary no-underline',
73+
'flex items-center justify-center h-full',
74+
'transition-colors duration-200 ease-linear',
75+
'rounded-r-sm cursor-pointer hover:text-white focus-visible:text-white',
8276
)}
8377
>
8478
Donate

components/Nav/NavListItem/NavListItem.module.css

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)