Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Synonym link to NavBar for moderators #2619

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions app/root/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { useClickAnyWhere, useWindowSize } from 'usehooks-ts'

import { Meatball } from '~/components/meatball/Meatball'
import { useEmail, useUserIdp } from '~/root'
import { useEmail, useModStatus, useUserIdp } from '~/root'

Check warning on line 20 in app/root/header/Header.tsx

View check run for this annotation

Codecov / codecov/patch

app/root/header/Header.tsx#L20

Added line #L20 was not covered by tests

import styles from './header.module.css'

Expand Down Expand Up @@ -74,6 +74,7 @@
const [expanded, setExpanded] = useState(false)
const [userMenuIsOpen, setUserMenuIsOpen] = useState(false)
const isMobile = useWindowSize().width < 1024
const isModerator = useModStatus()

Check warning on line 77 in app/root/header/Header.tsx

View check run for this annotation

Codecov / codecov/patch

app/root/header/Header.tsx#L77

Added line #L77 was not covered by tests

function toggleMobileNav() {
setExpanded((expanded) => !expanded)
Expand Down Expand Up @@ -110,7 +111,7 @@
<USWDSHeader basic className={`usa-header--dark ${styles.header}`}>
<div className="usa-nav-container">
<div className="usa-navbar">
<Title>
<Title style={{ width: 'max-content' }}>
<Link to="/">
<Meatball className="width-auto" />
<span>General Coordinates Network</span>
Expand Down Expand Up @@ -139,6 +140,15 @@
>
Circulars
</NavLink>,
isModerator ? (
<NavLink
className="usa-nav__link"
to="/synonyms"
key="/synonyms"
>
Synonyms
</NavLink>
) : null,
<NavLink className="usa-nav__link" to="/docs" key="/docs">
Documentation
</NavLink>,
Expand Down
Loading