-
Notifications
You must be signed in to change notification settings - Fork 24
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
refactor: re-write header menu bar, remove bulma #1885
Conversation
✔️ Deploy Preview for dev-bloom ready! 🔨 Explore the source changes: b7d4202 🔍 Inspect the deploy log: https://app.netlify.com/sites/dev-bloom/deploys/615de09f8a6dfd0008e023c3 😎 Browse the preview: https://deploy-preview-1885--dev-bloom.netlify.app |
✔️ Deploy Preview for dev-partners-bloom ready! 🔨 Explore the source changes: b7d4202 🔍 Inspect the deploy log: https://app.netlify.com/sites/dev-partners-bloom/deploys/615de09f2922820008010aac 😎 Browse the preview: https://deploy-preview-1885--dev-partners-bloom.netlify.app |
✔️ Deploy Preview for dev-storybook-bloom ready! 🔨 Explore the source changes: b7d4202 🔍 Inspect the deploy log: https://app.netlify.com/sites/dev-storybook-bloom/deploys/615de09f30b92200070e8d10 😎 Browse the preview: https://deploy-preview-1885--dev-storybook-bloom.netlify.app |
191ad88
to
309fbe3
Compare
@akegan EDIT: Fixed the issue :) Turns out Storybook's small mobile setting is (I think) smaller than any of the mobile options from the console, which is why it looked differently! Storybook's official mobile settings match local now. Also added a new story that represents all the DAHLIA settings. Here's the preview: https://deploy-preview-1885--dev-storybook-bloom.netlify.app/?path=/story/headers-site-header--basic |
@akegan We have a ticket to set up the same a11y linting so hopefully that will help! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for DAHLIA!
@emilyjablonski You can remove the padding from the preview with this setting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It seems we could use some padding around the text based logo on mobile
- Can we add full height for mobile drawer menu
@slowbot we can add padding for sure! and the mobile drawer is full height there's just no left border and nothing for it to cover up (check dahlia prod for an example) |
@emilyjablonski Can we use rems instead of px whenever possible? |
@slowbot For sure but I just did an overview of every case where I'm using px in the scss file and I can't change any of them to rem bc they need to be exact numbers for positioning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to discuss how to adjust all the navbar links so they're a
tags and remove most of the click handlers and Next router statements. Unless I'm missing something, most of the links are indeed hrefs to other pages, so it's not semantic to use click handlers to navigate to a new page. We can also make use of NavigationContext
/LinkComponent
to ensure proper routing using the current Next locale.
@jaredcwhite EDIT: After touching base offline, moving to a tags where I can, but not sure yet how adding localization pieces will work for DAHLIA since the current siteheader is broken for them on localization, gonna touch base w the DAHLIA team |
@jaredcwhite Okidokie I made some updates. I'm not able to blanket use LinkComponent because some of the "links" in the SiteHeader actually just have onClicks and no href, so I'm toggling LinkComponent or button on and off based on what was passed in, and there are no more vanilla a tags. I had to modify NavigationContext to get it to fully work which I think was the whole initial issue DAHLIA was having with localization. We need to spread on all props in order to pass in some of what we need for the SiteHeader and for consumers to localize. The LinkComponent is my biggest remaining area of concern still when it comes to making consumers use the NavigationContext and LinkComponent, because if DAHLIA (or any other consumer) sets up their LinkComponent and its props incorrectly, any component we have that uses LinkComponent won't even build for them, so we're kind of relying on them to set theirs up and I still think we should have them pass in a pre-localized href. But I think if we want to do that at all that should be a separate issue considering the priority of this PR so it doesn't matter atm anyway :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emilyjablonski Approach looks good. Let's continue to discuss ways we can make the link component injection easier to understand for consumers after this PR is merged.
One thing I noticed (shouldn't hold up the merge): the classes in the HTML have extra undefined
…probably just missing array values somewhere in the component chain that are getting mapped to the string as undefined.
Pull Request Template
Issue
Addresses #1345 #1467
Description
We had been using Bulma as a dependency for our Site Header. We had four main issues with this, which were that customizing the header bar was becoming increasingly difficult as we had to override their styles and behavior, the Menu text was untranslated, some of the styles were just a little visually off, and the dropdown menu was not accessible on mobile.
This PR re-writes our SiteHeader from mostly scratch. There are new props to toggle certain visual choices on/off. I also refactored how we are sending in languages and the home page link to remove business logic. Also fixed a bug where header links were still showing in partners when signed-out.
Type of change
How Can This Be Tested/Reviewed?
Check out the new stories, however please note that Storybook is not accurately displaying the mobile view in its default viewing window. Would recommend starting locally or the deploy preview to view mobile.
In Bloom we are not flattening mobile menus, using the mobile menu button, using the mobile dropdown, and not showing the feedback bar on mobile.
In DAHLIA, they will be flattening mobile menus, using mobile text as a button, using the mobile drawer, and showing the feedback bar on mobile.
These are all toggleable features through props.
I would test:
Checklist:
yarn generate:client
if I made backend changes