Skip to content
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

maintain highlight in navbar #56

Merged
merged 2 commits into from
Feb 27, 2025
Merged

Conversation

IslandRhythms
Copy link
Contributor

No description provided.

@@ -14,6 +14,9 @@ module.exports = app => app.component('navbar', {
inject: ['state'],
data: () => ({ showFlyout: false }),
computed: {
dashboardView() {
return this.$route.fullPath.includes('dashboard');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to make this a startsWith in case someone has a document with _id === 'dashboard'. I'd prefer if this was an explicit list based on the current route's name though

@@ -12,11 +12,11 @@
<a
href="#/"
class="inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium"
:class="routeName === 'root' ? 'text-gray-900 border-ultramarine-500' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'">Documents</a>
:class="!dashboardView ? 'text-gray-900 border-ultramarine-500' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'">Documents</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work when we have more nav items (I currently have a new "shell" tab WIP here: https://github.com/mongoosejs/studio/tree/vkarpov15/shell)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured I would adjust it if we ever got to that point. I'll make the necessary changes

@vkarpov15 vkarpov15 merged commit 680c1cd into main Feb 27, 2025
@vkarpov15 vkarpov15 deleted the IslandRhythms/maintain-highlight branch February 27, 2025 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants