-
Notifications
You must be signed in to change notification settings - Fork 4.5k
🪟🎨Main menu hover state #13762
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
🪟🎨Main menu hover state #13762
Conversation
const { location } = useRouter(); | ||
|
||
const menuItemStyle = (isActive: boolean) => { | ||
const isChild = location.pathname.split("/").length > 4 && !location.pathname.includes("settings"); |
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 feels like a very specific hack for settings
. Is there any reason why we would want to exclude this behavior for settings specifically? I would prefer if we don't need to add page specific hacks here, and could instead stick with a more generic implementation here.
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.
Settings doesn't have a "landing page" (/settings
). I've asked Nico for some feedback there (if we'd like it to act like selected
or parentSelected
).
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.
We could check if the menuItem's formatted message lowercased equals the last item in the pathname? I don't think that works well with i18n though. Any page with no "landing" page would never have isChild
be true
... Settings is just the only one we have right now.
5b2046f
to
f3d8ace
Compare
airbyte-webapp/src/packages/cloud/views/layout/SideBar/SideBar.tsx
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/packages/cloud/views/layout/SideBar/SideBar.tsx
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/packages/cloud/views/layout/SideBar/SideBar.tsx
Outdated
Show resolved
Hide resolved
0dc0561
to
ce03d04
Compare
Co-authored-by: Edmundo Ruiz Ghanem <[email protected]>
…om/airbytehq/airbyte into teal/main-menu-hover-state" This reverts commit 423f671, reversing changes made to 38a39a3.
7742d58
to
2ce4e45
Compare
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.
Tested it locally and it looks good. Just had a note and looks like there's a merged conflict. Otherwise, approved.
What
closes #12725
Adds a hover state and adds additional functionality to the active state in the SideBar menu.
Note: for this PR, we will not be implementing the "selected" state on the flyout menus. The flyout menus (a) currently do not expose if they are "active" and (b) are due for a revisit as a whole (accessibility and design issues). When we recompose them, we can expose whether the flyout is open or not, making the active state simpler to implement.
How
MenuItem
to an scss classRecommended reading order
/project/cloud
)Testing
If you are testing this locally, it's worth noting that Cloud and OSS currently each have their own SideBar. For this PR, you will want to test each environment separately. (there is an issue to create a more centralized SideBar component but was out of scope here)