diff --git a/src/components/home/MenuItem.vue b/src/components/home/MenuItem.vue index 4c1df5ba..e2371908 100644 --- a/src/components/home/MenuItem.vue +++ b/src/components/home/MenuItem.vue @@ -39,7 +39,7 @@ function navigateTo(destination: string) { @click="navigateTo(v.value)" > diff --git a/src/css/quasar.variables.scss b/src/css/quasar.variables.scss index 5d767572..52dbc46a 100644 --- a/src/css/quasar.variables.scss +++ b/src/css/quasar.variables.scss @@ -38,3 +38,7 @@ $separator-dark-color: var(--border-color); border-color: var(--border-color); } } + +.q-menu { + box-shadow: var(--shadow-2) !important; +} diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index aa301ddb..69a8623c 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -2,16 +2,78 @@ import { ref } from 'vue'; import { storeToRefs } from 'pinia'; import { useQuasar } from 'quasar'; +import { getName, getRole, logout } from 'src/services/keycloak'; import useLoader from 'stores/loader'; import DrawerComponent from 'components/DrawerComponent.vue'; +interface NotificationButton { + item: string; + color: string; + active: boolean; +} + +interface Notification { + id: string; + title: string; + content: string; + read: boolean; +} + const $q = useQuasar(); const loaderStore = useLoader(); const { visible } = storeToRefs(loaderStore); const leftDrawerOpen = ref($q.screen.gt.sm); +const filterUnread = ref(false); +const unread = ref(1); +const notiOpen = ref(false); +const notiMenu = ref([ + { + item: 'ทั้งหมด', + color: 'noti-switch-on', + active: true, + }, + { + item: 'ยังไม่ได้อ่าน', + color: 'noti-switch-off', + active: false, + }, +]); +const notification = ref([ + { + id: '1', + title: 'test', + content: 'test', + read: false, + }, + { + id: '2', + title: 'test', + content: 'test', + read: false, + }, +]); + +function setActive(button: NotificationButton) { + notiMenu.value = notiMenu.value.map((current) => ({ + item: current.item, + color: current.item !== button.item ? 'noti-switch-off' : 'noti-switch-on', + active: current.item === button.item, + })); + if (button.item === 'ยังไม่ได้อ่าน') { + // noti.value?.result && + filterUnread.value = true; + } + if (button.item === 'ทั้งหมด') { + filterUnread.value = false; + } +} + +function doLogout() { + logout(); +} + +