From d7bc5496c395e973049a34dcae83a844cf3c9183 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 27 May 2024 20:44:52 +0530 Subject: [PATCH] feat: created notification page for mobile view --- .../src/components/Mobile/MobileSidebar.vue | 180 +++++++++++++++++- frontend/src/pages/MobileNotification.vue | 115 +++++++++++ frontend/src/router.js | 5 + 3 files changed, 298 insertions(+), 2 deletions(-) create mode 100644 frontend/src/pages/MobileNotification.vue diff --git a/frontend/src/components/Mobile/MobileSidebar.vue b/frontend/src/components/Mobile/MobileSidebar.vue index aaa9d866..03df5a95 100644 --- a/frontend/src/components/Mobile/MobileSidebar.vue +++ b/frontend/src/components/Mobile/MobileSidebar.vue @@ -10,7 +10,61 @@ leave-from="translate-x-0" leave-to="-translate-x-full" > - +
+
+
+
+ + + +
+
+
+ + +
+
+
+
{ + let _views = [ + { + name: 'All Views', + hideLabel: true, + opened: true, + views: links, + }, + ] + if (getPublicViews().length) { + _views.push({ + name: 'Public views', + opened: true, + views: parseView(getPublicViews()), + }) + } + + if (getPinnedViews().length) { + _views.push({ + name: 'Pinned views', + opened: true, + views: parseView(getPinnedViews()), + }) + } + return _views +}) + +function parseView(views) { + return views.map((view) => { + return { + label: view.label, + icon: getIcon(view.route_name, view.icon), + to: { + name: view.route_name, + query: { view: view.name }, + }, + } + }) +} + +function getIcon(routeName, icon) { + if (icon) return h('div', { class: 'size-auto' }, icon) + + switch (routeName) { + case 'Leads': + return LeadsIcon + case 'Deals': + return DealsIcon + case 'Contacts': + return ContactsIcon + case 'Organizations': + return OrganizationsIcon + case 'Notes': + return NoteIcon + case 'Call Logs': + return PhoneIcon + default: + return PinIcon + } +} diff --git a/frontend/src/pages/MobileNotification.vue b/frontend/src/pages/MobileNotification.vue new file mode 100644 index 00000000..eed6b47e --- /dev/null +++ b/frontend/src/pages/MobileNotification.vue @@ -0,0 +1,115 @@ + + diff --git a/frontend/src/router.js b/frontend/src/router.js index 56727d0f..ff5052c4 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -8,6 +8,11 @@ const routes = [ redirect: { name: 'Leads' }, name: 'Home', }, + { + path: '/notifications', + name: 'Notifications', + component: () => import('@/pages/MobileNotification.vue'), + }, { path: '/leads', name: 'Leads',