From 314a05a53cd1acba3618d73c4e8de9a367eb6149 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 3 Apr 2024 15:01:01 +0700 Subject: [PATCH 1/2] feat: GlobalDialog --- src/components/GlobalDialog.vue | 70 +++++++++++++++++++++++++-------- src/css/quasar.variables.scss | 7 +++- 2 files changed, 60 insertions(+), 17 deletions(-) diff --git a/src/components/GlobalDialog.vue b/src/components/GlobalDialog.vue index 2cc93d60..739bceea 100644 --- a/src/components/GlobalDialog.vue +++ b/src/components/GlobalDialog.vue @@ -13,38 +13,65 @@ defineProps<{ - + diff --git a/src/css/quasar.variables.scss b/src/css/quasar.variables.scss index 52dbc46a..cfa70390 100644 --- a/src/css/quasar.variables.scss +++ b/src/css/quasar.variables.scss @@ -39,6 +39,11 @@ $separator-dark-color: var(--border-color); } } -.q-menu { +.q-menu, +.q-card { box-shadow: var(--shadow-2) !important; } + +.q-dialog__backdrop { + background-color: hsla(0 0 60% / 0.4) !important; +} From 05ef9ec71bcb43e41a1e9083160a41729aadf45b Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 3 Apr 2024 15:01:39 +0700 Subject: [PATCH 2/2] feat: Header => logout & filter unread --- src/layouts/MainLayout.vue | 45 ++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index ed442512..aed5224d 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -7,6 +7,7 @@ import { useI18n } from 'vue-i18n'; import useLoader from 'stores/loader'; import DrawerComponent from 'components/DrawerComponent.vue'; +import GlobalDialog from 'components/GlobalDialog.vue'; interface NotificationButton { item: string; @@ -27,6 +28,7 @@ const loaderStore = useLoader(); const { visible } = storeToRefs(loaderStore); const { locale } = useI18n({ useScope: 'global' }); +const logoutModal = ref(false); const leftDrawerOpen = ref($q.screen.gt.sm); const filterUnread = ref(false); const unread = ref(1); @@ -56,8 +58,8 @@ const notiMenu = ref([ const notification = ref([ { id: '1', - title: 'test', - content: 'test', + title: 'Unread', + content: 'Unread', read: false, }, { @@ -66,6 +68,12 @@ const notification = ref([ content: 'test', read: false, }, + { + id: '3', + title: 'Read', + content: 'Already read', + read: true, + }, ]); function setActive(button: NotificationButton) { @@ -83,8 +91,12 @@ function setActive(button: NotificationButton) { } } -function doLogout() { - logout(); +function doLogout(confirm?: boolean = false) { + logoutModal.value = true; + if (confirm) { + logoutModal.value = false; + logout(); + } } @@ -112,6 +124,7 @@ function doLogout() { class="noti-circle" :class="{ bordered: $q.dark.isActive, dark: $q.dark.isActive }" style="color: var(--surface-1)" + @click="notiOpen = !notiOpen" > @@ -150,7 +163,9 @@ function doLogout() { clickable class="q-py-sm" v-ripple - v-for="item in notification" + v-for="item in !filterUnread + ? notification + : notification.filter((v) => !v.read)" :key="item.id" >