-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Layout refactor using sticky
[Closes #1848, Closes #1867]
#1973
Conversation
depracated format, and state handled elsewhere
Changed `Nav/index.js` and `SideNavMobile.js` to use `sticky` positioning, instead of `fixed`, to fix alignment glitches affecting banners
sticky
[Fixes #1848]sticky
[Closes #1848, Closes #1867]
Fixes issue with SideNavMobile not displaying name next to icon. Name was inadvertantly being wrapped in a disabled <BannerNotification> tag.
So this wasn't intended to address/involve issue #1866, but that issue now appears to be affecting this Netlify build. This is getting very confusing for forgive me if I post some screenshots to demonstrate and also think through what is going on here. Example of issue, using
|
Hey @wackerow - thanks for this PR! Appreciate the detailed comment as well. I have indeed seen the issue you mention. I'm not yet sure what's going on but I will investigate. I suspect something strange is happening with our CDN caching. Out of curiosity, does clearing your browser cache appear to resolve this for the preview deploy / production deploy? |
@samajammin Yes, actually... as I was checking that I noticed similarly it worked in a private browser window, and also seemed to have an instance that corrected after toggling light/dark mode. This actually fixed all of it for me (at least in the meantime) for both netlify builds and the live site. |
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.
This looks great! Nice simplification of the layout. Thanks for doing this ❤️
Great work! I'm comfortable merging this as I'm confident these changes are unrelated to #1866. |
Description
This refactor changes the top
Nav
component (which includes EDN navigation) andSideNavMobile
components to be positionedsticky
instead offixed
. This should fix issues with banners not being aligned properly, as they were not positioned relative to their fixed siblings.Nav/index.js
andSideNavMobile.js
both changed toposition: sticky
<SideNavMobile>
outside of<MainContainer>
margin-top
styling toMainContainer
, as this will now sit relative to nav components naturallyshouldShowSubNav
constant (and its dependencies)Also, while in the
Layout.js
file, there are two deprecated methods being used (.addListener(() => {})
and.removeListener(() => {})
... these are now.addEventListener("change", () => {})
and.removeEventListener("change", () => {})
). I was going to update these, however, dark mode state is being loaded inuseEffect
already, and changed viahandleThemeChange()
directly which re-renders the view. I removed these calls, and the dark mode seems to work perfectly fine without it.Please let me know if you spot something I missed... (Note, this issue has been challenging to reproduce in dev, at least for me, but this should hopefully fix the banner issue, will test the Netlify link when this saves)
Related Issue #1848