-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4a4f22
commit 2767fbd
Showing
7 changed files
with
68 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<LinkProps, 'href' | 'onClick'> { | ||
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 ( | ||
<Link href={href} passHref className="usa-nav__link" onClick={onClick}> | ||
<span | ||
className={classNames(styles.navbarItemText, { | ||
'navbar-item-active': isActive, | ||
})} | ||
> | ||
{children} | ||
</span> | ||
</Link> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }; |