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

fix: Remove the USWDS button from the old page header #1448

Merged
merged 1 commit into from
Feb 10, 2025
Merged
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
40 changes: 32 additions & 8 deletions app/scripts/components/common/page-header-legacy/nav-menu-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
} from '../page-header/types';
import { InternalNavLink, ExternalNavLink } from '../types';
import { useFeedbackModal } from '../layout-root';
import { USWDSButton } from '$uswds';
import GlobalMenuLinkCSS from '$styles/menu-link';
import { useMediaQuery } from '$utils/use-media-query';
import { LinkProperties } from '$types/veda';
Expand Down Expand Up @@ -120,6 +119,32 @@ function LinkDropMenuNavItem({
}
}

interface BtnMediaProps {
active?: boolean;
}

// Global menu link style
const ButtonAsNavLink = styled(Button)`
${media.mediumUp<BtnMediaProps>`
background-color: ${themeVal('color.primary-700')};
&:hover {
background-color: ${themeVal('color.primary-800')};
}
/* Print & when prop is passed */
${({ active }) => active && '&,'}
&:active,
&.active {
background-color: ${themeVal('color.primary-900')};
}
&:focus-visible {
background-color: ${themeVal('color.primary-200a')};
}
`}
${media.mediumDown`
${GlobalMenuLinkCSS}
`}
`;

export default function NavMenuItem({
item,
alignment,
Expand Down Expand Up @@ -164,15 +189,14 @@ export default function NavMenuItem({
} else if (item.type === NavItemType.ACTION) {
return (
<li>
<USWDSButton
onClick={show}
<ButtonAsNavLink
type='button'
size='small'
inverse={true}
outline={false}
size='large'
onClick={show}
style={{ color: 'white' }}
>
{item.title}
</USWDSButton>
{title}
</ButtonAsNavLink>
{process.env.GOOGLE_FORM && (
<GoogleForm
src={process.env.GOOGLE_FORM}
Expand Down
Loading