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

Create LinkButton component #44

Merged
merged 3 commits into from
Nov 7, 2024
Merged

Create LinkButton component #44

merged 3 commits into from
Nov 7, 2024

Conversation

jakewheeler
Copy link
Collaborator

@jakewheeler jakewheeler commented Nov 7, 2024

Issue: CDCgov/phdi#2872

This PR adds the LinkButton component, which is a Next.js link stylized to look like a USWDS Button component. This component will be used on the following pages:

  • Home
  • Our products
  • Case studies (once completed)

I've updated both the "home" and "our products" pages to make use of this new component.

Note that the Send inquiry button on the "Engage with us" page is a form submission button rather than a link, so this component won't be used there.

Additionally, I made a small correction to the NavigationLink component so that the nav link of the page we're currently looking at will be underlined, which matches the Figma design.

Here's an example:
image

return (
<Link
href={href}
className="usa-button hover:bg-red items-center justify-start gap-2.5 rounded border-2 border-[#224a58] bg-white px-5 py-3 hover:border-2"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to tell in Figma what the hover state of the button should look like? I put very obvious placeholders (like the hover:bg-red here) that I figured we could update later. If we already have this info somewhere, let me know and I can make the update!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is. The way i've seen designers do it is they specifically have a section with all the button states. I don't see that on figma for this

Comment on lines +19 to +20
className={classNames('text-white', {
underline: isActive,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change so that we get the underlining. Otherwise, I just cleaned up some styling we didn't need.

@jakewheeler jakewheeler marked this pull request as ready for review November 7, 2024 17:53
@jakewheeler jakewheeler merged commit 71dbdf3 into next Nov 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants