From f94c566b70d63df32ebe14742e8237a834f9c4cc Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Tue, 30 Jan 2024 00:58:55 +0530 Subject: [PATCH] fix: removed isSidebarCollapsed from global and use absolute positioning to position notification panel --- .../src/components/Layouts/AppSidebar.vue | 11 +- .../src/components/Layouts/DesktopLayout.vue | 2 - frontend/src/components/Notifications.vue | 107 ++++++++++-------- frontend/src/stores/global.js | 7 -- 4 files changed, 65 insertions(+), 62 deletions(-) diff --git a/frontend/src/components/Layouts/AppSidebar.vue b/frontend/src/components/Layouts/AppSidebar.vue index 28e84987..c01d67b5 100644 --- a/frontend/src/components/Layouts/AppSidebar.vue +++ b/frontend/src/components/Layouts/AppSidebar.vue @@ -1,6 +1,6 @@ + @@ -108,18 +109,16 @@ import PhoneIcon from '@/components/Icons/PhoneIcon.vue' import CollapseSidebar from '@/components/Icons/CollapseSidebar.vue' import NotificationsIcon from '@/components/Icons/NotificationsIcon.vue' import SidebarLink from '@/components/SidebarLink.vue' +import Notifications from '@/components/Notifications.vue' import { viewsStore } from '@/stores/views' import { notificationsStore } from '@/stores/notifications' -import { globalStore } from '@/stores/global' +import { useStorage } from '@vueuse/core' import { computed } from 'vue' const { getPinnedViews, getPublicViews } = viewsStore() const { toggle: toggleNotificationPanel } = notificationsStore() -const isSidebarCollapsed = computed({ - get: () => globalStore().isSidebarCollapsed, - set: (value) => globalStore().setIsSidebarCollapsed(value), -}) +const isSidebarCollapsed = useStorage('isSidebarCollapsed', false) const links = [ { diff --git a/frontend/src/components/Layouts/DesktopLayout.vue b/frontend/src/components/Layouts/DesktopLayout.vue index 7530dc29..c45bbc2b 100644 --- a/frontend/src/components/Layouts/DesktopLayout.vue +++ b/frontend/src/components/Layouts/DesktopLayout.vue @@ -3,7 +3,6 @@
-
@@ -12,6 +11,5 @@ diff --git a/frontend/src/components/Notifications.vue b/frontend/src/components/Notifications.vue index 5e1b0a64..a25a2f0f 100644 --- a/frontend/src/components/Notifications.vue +++ b/frontend/src/components/Notifications.vue @@ -2,51 +2,58 @@
-
- Notifications - - - - -
-
- +
- - -
- +
Notifications
+
+ + + + + + +
+
+
+ +
+
+ +
+
+
{{ n.from_user.full_name }} @@ -54,29 +61,35 @@ {{ n.reference_name }} - -
-
+
{{ timeAgo(n.creation) }}
-
- - + +
+
+ +
+ No new notifications +
+