Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions frontend/src/components/NavBar.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<v-app-bar color="primary" dark elevation="2">
<v-app-bar color="primary" dark elevation="2" class="navbar">
<!-- Logo and Brand -->
<v-app-bar-nav-icon @click="drawer = !drawer" class="d-md-none"></v-app-bar-nav-icon>

<v-app-bar-title class="d-flex align-center">
<v-app-bar-title class="d-flex align-center title-no-shrink">
<router-link :to="{ name: 'home' }" class="branding d-flex align-center text-decoration-none">
<div class="icon position-relative">
<img src="/assets/logo.svg" width="32" height="32" alt="CMS Logo" class="logo-img" />
Expand All @@ -12,10 +12,12 @@
<span class="ml-2 text-white">CMS</span>
</router-link>
</v-app-bar-title>
<v-spacer class="d-flex"></v-spacer>

<!-- Navigation Links -->
<v-tabs class="d-none d-md-flex" color="white" slider-color="white">
<v-tab
v-for="item in navigationItems"
v-for="item in visibleNavigationItems"
:key="item.name"
:disabled="item.disabled"
:to="{ name: item.name }"
Expand All @@ -26,7 +28,7 @@
</v-tab>
</v-tabs>

<v-spacer class="d-none d-sm-flex"></v-spacer>
<v-spacer class="d-none d-md-flex"></v-spacer>

<!-- Support Us Button -->
<v-btn
Expand Down Expand Up @@ -55,7 +57,7 @@
<v-navigation-drawer v-model="drawer" temporary location="left" class="d-md-none">
<v-list>
<v-list-item
v-for="item in navigationItems"
v-for="item in visibleNavigationItems"
:key="item.name"
:disabled="item.disabled"
:prepend-icon="item.icon"
Expand All @@ -79,7 +81,7 @@
<script setup lang="ts">
import UserButton from '@/components/UserButton.vue'
import Loading from '@/components/Loading.vue'
import { ref } from 'vue'
import { ref, computed } from 'vue'

// Props
export interface NavigationItem {
Expand All @@ -91,7 +93,7 @@ export interface NavigationItem {
show: boolean
}

defineProps<{
const props = defineProps<{
navigationItems: NavigationItem[]
username: string | null
isLoggedIn: boolean
Expand All @@ -106,9 +108,22 @@ defineEmits<{

// Reactive data
const drawer = ref(false)

const visibleNavigationItems = computed(() => {
return props.navigationItems.filter((item) => item.show)
})
</script>

<style scoped>
.navbar.v-theme--dark {
background-color: rgb(37, 59, 106) !important;
}

.title-no-shrink {
flex: 0 0 auto;
min-width: max-content;
}

.branding {
font-weight: 500;
}
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const app = createApp(App)
const vuetify = createVuetify({
components,
directives,
theme: {
defaultTheme: 'system',
},
})

const pinia = createPinia()
Expand Down