✨ Add navbar_end part in navbar UI#802
Conversation
✅ Deploy Preview for myst-theme ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: 53c3144 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| <ThemeButton className="w-10 h-10 ml-3" /> | ||
| {/* Custom part at end of navbar */} | ||
| {navbarEnd && ( | ||
| <div className="article myst-navbar-end hidden xl:flex items-center ml-3 [&>*]:m-0"> |
There was a problem hiding this comment.
It's hidden because we have to render the navbar items in two places:
- Once in the navbar for wide screens
- Once in the sidebar drawer for narrow/mobile screens
So here we hide it until we hit xl width, at which point it becomes flex
stefanv
left a comment
There was a problem hiding this comment.
Same question as @parmentelat about hidden and xl:hidden, otherwise LGTM, and a neat addition!
| {navbarEnd && ( | ||
| <div | ||
| className={classNames( | ||
| 'article myst-primary-sidebar-navbar-end xl:hidden p-2 my-1 flex flex-wrap gap-2 [&_p]:contents', |
There was a problem hiding this comment.
Here we show the navbar items up until we hit xl at which point it becomes hidden
Removed patch version for '@myst-theme/docs' and added navbar_end part in navbar UI.
|
Question answered! does that make sense to y'all? |
| hide_toc?: boolean; | ||
| mobileOnly?: boolean; | ||
| footer?: React.ReactNode; | ||
| navbarEnd?: GenericParent; |
There was a problem hiding this comment.
GenericParent feels so... generic :)
There was a problem hiding this comment.
I can't tell if this is a suggestion to do something different or not - but it's a good point that footer already uses ReactNode....I can try to make this follow the same pattern and see if I can get the outcome we want. Is that what you'd like me to do?
There was a problem hiding this comment.
Sorry, I was musing to myself that the typing feels less than optimal here. But this requires a systematic review to address, nothing for you to take care of here!
|
I asked in the chat and Stefan said his comment was non-blocking, so I'm gonna merge this since we have an approve so we can close this out, thanks for the review folks :-) |
|
Amazing. Nice work! 🚀 |
This adds support for a markdown "part" that is added to the end of the navbar. See the docs for an example of this in action with two
{button}roles. If we merge #752 we could replace those with icon links!navbar_endsite part, following the same pattern as footer, banner, and primary_sidebar_footer.