diff --git a/src/app/components/Footer.tsx b/src/app/components/Footer.tsx index 2a7dfbb..6fbcdca 100644 --- a/src/app/components/Footer.tsx +++ b/src/app/components/Footer.tsx @@ -4,11 +4,11 @@ import Link from 'next/link'; import Image from 'next/image'; import React from 'react'; import styles from '../styles/Home.module.scss'; -import { NavigationLink } from './Header'; +import { NavigationLink } from './NavigationLink'; +import classNames from 'classnames'; +import { basePath } from '../utils/constants'; export default function Footer() { - const basePath = '/dibbs-site'; - const [expanded, setExpanded] = React.useState(false); const onClick = () => { if (window.innerWidth < 1024) setExpanded((prvExpanded) => !prvExpanded); @@ -17,22 +17,21 @@ export default function Footer() { const testItemsMenu = [ Home , - + Home , - + Our products , - + Case studies , - + Engage with us , ]; @@ -45,14 +44,16 @@ export default function Footer() {
- + CDC US center for disease control and prevention diff --git a/src/app/components/Header.tsx b/src/app/components/Header.tsx index fefc23b..2f0711e 100644 --- a/src/app/components/Header.tsx +++ b/src/app/components/Header.tsx @@ -1,32 +1,26 @@ 'use client'; -import { Header, PrimaryNav } from '@trussworks/react-uswds'; -import Link from 'next/link'; +import { Header as USWDSHeader, PrimaryNav } from '@trussworks/react-uswds'; import Image from 'next/image'; -import { usePathname } from 'next/navigation'; import React from 'react'; import styles from '../styles/Home.module.scss'; -import { LinkProps } from 'next/link'; - -interface NavigationLinkProps extends Pick { - children: React.ReactNode; -} - -export default function Navbar() { - const basePath = '/dibbs-site'; +import classNames from 'classnames'; +import { basePath } from '../utils/constants'; +import { NavigationLink } from './NavigationLink'; +export default function Header() { const [expanded, setExpanded] = React.useState(false); const onClick = () => { if (window.innerWidth < 1024) setExpanded((prvExpanded) => !prvExpanded); }; const testItemsMenu = [ - + Our products , - + Case studies , - + Engage with us , ]; @@ -37,20 +31,22 @@ export default function Navbar() { Skip to main content -
+
- + Data Integration Building Blocks @@ -66,27 +62,7 @@ export default function Navbar() { onToggleMobileNav={onClick} />
-
+ ); } - -export function NavigationLink({ - href, - children, - onClick, -}: NavigationLinkProps) { - const pathname = usePathname(); // Use usePathname hook to get the current path - const isActive = pathname === href; - return ( - - - {children} - - - ); -} diff --git a/src/app/components/NavigationLink.tsx b/src/app/components/NavigationLink.tsx new file mode 100644 index 0000000..baf5df1 --- /dev/null +++ b/src/app/components/NavigationLink.tsx @@ -0,0 +1,28 @@ +import classNames from 'classnames'; +import Link, { LinkProps } from 'next/link'; +import { usePathname } from 'next/navigation'; +import styles from '../styles/Home.module.scss'; + +interface NavigationLinkProps extends Pick { + children: React.ReactNode; +} + +export function NavigationLink({ + href, + children, + onClick, +}: NavigationLinkProps) { + const pathname = usePathname(); // Use usePathname hook to get the current path + const isActive = pathname === href; + return ( + + + {children} + + + ); +} diff --git a/src/app/components/UsaBanner.tsx b/src/app/components/UsaBanner.tsx index 217638e..0738f4c 100644 --- a/src/app/components/UsaBanner.tsx +++ b/src/app/components/UsaBanner.tsx @@ -11,13 +11,10 @@ import { MediaBlockBody, Icon, } from '@trussworks/react-uswds'; +import { dotGovIcon, flagImg, httpsIcon } from '../utils/constants'; export default function USABanner() { - const basePath: string = '/dibbs-site'; const [isOpen, setIsOpen] = useState(false); - const flagImg: string = `${basePath}/images/us-flag.png`; - const dotGovIcon: string = `${basePath}/images/us-gov-icon.svg`; - const httpsIcon: string = `${basePath}/images/https-icon.svg`; return ( ) { return ( -
- +
{children}
diff --git a/src/app/page.tsx b/src/app/page.tsx index 34472ca..6667fc4 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,10 +1,9 @@ import MarkdownContent from './components/MarkdownComponent'; import { Grid } from '@trussworks/react-uswds'; import Image from 'next/image'; +import { basePath } from './utils/constants'; export default async function Home() { - const basePath = '/dibbs-site'; - return ( <>
diff --git a/src/app/utils/constants.ts b/src/app/utils/constants.ts new file mode 100644 index 0000000..d37743d --- /dev/null +++ b/src/app/utils/constants.ts @@ -0,0 +1,6 @@ +const basePath = '/dibbs-site'; +const flagImg = `${basePath}/images/us-flag.png`; +const dotGovIcon = `${basePath}/images/us-gov-icon.svg`; +const httpsIcon = `${basePath}/images/https-icon.svg`; + +export { basePath, flagImg, dotGovIcon, httpsIcon };