diff --git a/src/app/components/Header/Header.module.scss b/src/app/components/Header/Header.module.scss index d5a9546..95e47b4 100644 --- a/src/app/components/Header/Header.module.scss +++ b/src/app/components/Header/Header.module.scss @@ -17,10 +17,7 @@ &::before { content: ''; position: absolute; - top: -20%; - left: -10%; - right: -10%; - bottom: 0; + inset: -20% -10% 0; background: linear-gradient( 90deg, rgba(76, 43, 100, 0.85) 12%, @@ -35,15 +32,27 @@ } :global { - .usa-navbar { + .usa-navbar, + .usa-hero { position: relative; z-index: 1; } } - section h1, section p { - z-index: 1; color: white; + z-index: 1; } } + +.navbarLogoText { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +} diff --git a/src/app/components/Header/Header.tsx b/src/app/components/Header/Header.tsx index 070469b..66c34e4 100644 --- a/src/app/components/Header/Header.tsx +++ b/src/app/components/Header/Header.tsx @@ -1,13 +1,13 @@ 'use client'; +import { useState } from 'react'; import { Header as USWDSHeader, PrimaryNav } from '@trussworks/react-uswds'; import Image from 'next/image'; -import React from 'react'; +import { usePathname } from 'next/navigation'; import classNames from 'classnames'; +import styles from './Header.module.scss'; import { basePath } from '../../utils/constants'; import { NavigationLink } from '../NavigationLink/NavigationLink'; -import styles from './Header.module.scss'; import Hero from '../Hero/Hero'; -import { usePathname } from 'next/navigation'; interface HeroContent { heroClass?: string; @@ -15,7 +15,7 @@ interface HeroContent { heroSubheader: string; } -type SpecialContent = Record; +type SpecialContent = Record; const specialContent: SpecialContent = { '/': { @@ -28,44 +28,57 @@ const specialContent: SpecialContent = { }, }; +const navigationItems = [ + { + key: 'products', + href: '/our-products', + text: 'Our products', + }, + { + key: 'case-studies', + href: '/case-studies', + text: 'Case studies', + }, + { + key: 'engage', + href: '/engage-with-us', + text: 'Engage with us', + }, +]; + export default function Header() { const pathname = usePathname(); const customContent = specialContent[pathname]; + const [expanded, setExpanded] = useState(false); - const [expanded, setExpanded] = React.useState(false); - const onClick = () => { - if (window.innerWidth < 1024) setExpanded((prvExpanded) => !prvExpanded); + const handleClick = () => { + if (window.innerWidth < 1024) { + setExpanded((prev) => !prev); + } }; - const testItemsMenu = [ - - Our products - , - - Case studies - , - - Engage with us - , - ]; + const navigationLinks = navigationItems.map(({ key, href, text }) => ( + + {text} + + )); return (
Skip to main content - +