cfpb / design-system-react

A React/Storybook implementation of CFPB's Design System
https://cfpb.github.io/design-system-react/
MIT License
6 stars 4 forks source link

Create Declarable CFPB Logo href #346

Closed BrewCityBoy closed 5 months ago

BrewCityBoy commented 5 months ago

Description

Currently, the CFPB logo in the React DS has a hardcoded href pointing to cf.gov. Using the CFPB logo from the React DS, we've run into the issue of users being booted from the Metro2 tool when the logo is clicked. This will inevitably cause frustration and confusion, as users will expect to be routed back to the landing page for the Metro2 Evaluator Tool.

This PR seeks to implement a change which will turn the logo href into a prop that can be defined in every project that uses the React DS component. Additionally, the logo still defaults to cf.gov if no other href/url is specified.

Changes

How to test this PR

  1. Pull branch and run yarn start. Navigate to Navbar and Page header pages and verify CFPB logo points to cf.gov

  2. Create a story for either Navbar or PageHeader:

    • Open file 'PageHeader.stories.tsx'
    • Create an additional story that displays the CFPB logo with custom href export const CustomCFPBHref: Story = { args: { href: 'https://www.google.com' } };
    • Go to PageHeader page in React DS and verify additional story was created. Click added CFPB logo (or hover above logo/link) and verify correct url
  3. Check added test with yarn test and verify tests pass

Notes

netlify[bot] commented 5 months ago

Deploy Preview for cfpb-design-system-react ready!

Name Link
Latest commit 78dc187dc2e3d98a83e250c9a7b7140f57cd505f
Latest deploy log https://app.netlify.com/sites/cfpb-design-system-react/deploys/66462986cebdd800084fa22b
Deploy Preview https://deploy-preview-346--cfpb-design-system-react.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.