From 3a16a59f37b9b637bb4cbc1c3575810a65515cbc Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 11 Aug 2022 21:56:30 +0300 Subject: [PATCH] navigation refactored, used in mobile nav as well --- src/components/mobile_nav/mobile_nav.js | 9 +- src/components/mobile_nav/mobile_nav.vue | 29 +++--- src/components/nav_panel/nav_panel.js | 25 +---- src/components/nav_panel/nav_panel.vue | 28 +----- src/components/navigation/filter.js | 11 +++ src/components/navigation/navigation.js | 61 ++++++++++++ src/components/navigation/navigation_entry.js | 32 +++++++ .../navigation/navigation_entry.vue | 96 +++++++++++++++++++ src/components/navigation/navigation_pins.js | 68 +++++++++++++ src/components/navigation/navigation_pins.vue | 64 +++++++++++++ src/modules/api.js | 3 + 11 files changed, 363 insertions(+), 63 deletions(-) create mode 100644 src/components/navigation/filter.js create mode 100644 src/components/navigation/navigation.js create mode 100644 src/components/navigation/navigation_entry.js create mode 100644 src/components/navigation/navigation_entry.vue create mode 100644 src/components/navigation/navigation_pins.js create mode 100644 src/components/navigation/navigation_pins.vue diff --git a/src/components/mobile_nav/mobile_nav.js b/src/components/mobile_nav/mobile_nav.js index 877d52a9..af47f032 100644 --- a/src/components/mobile_nav/mobile_nav.js +++ b/src/components/mobile_nav/mobile_nav.js @@ -2,6 +2,7 @@ import SideDrawer from '../side_drawer/side_drawer.vue' import Notifications from '../notifications/notifications.vue' import { unseenNotificationsFromStore } from '../../services/notification_utils/notification_utils' import GestureService from '../../services/gesture_service/gesture_service' +import NavigationPins from 'src/components/navigation/navigation_pins.vue' import { mapGetters } from 'vuex' import { library } from '@fortawesome/fontawesome-svg-core' import { @@ -19,7 +20,8 @@ library.add( const MobileNav = { components: { SideDrawer, - Notifications + Notifications, + NavigationPins }, data: () => ({ notificationsCloseGesture: undefined, @@ -47,7 +49,10 @@ const MobileNav = { isChat () { return this.$route.name === 'chat' }, - ...mapGetters(['unreadChatCount']) + ...mapGetters(['unreadChatCount']), + chatsPinned () { + return new Set(this.$store.state.serverSideStorage.prefsStorage.collections.pinnedNavItems).has('chats') + } }, methods: { toggleMobileSidebar () { diff --git a/src/components/mobile_nav/mobile_nav.vue b/src/components/mobile_nav/mobile_nav.vue index 949cf17e..82e726a4 100644 --- a/src/components/mobile_nav/mobile_nav.vue +++ b/src/components/mobile_nav/mobile_nav.vue @@ -17,20 +17,12 @@ icon="bars" />
- - {{ sitename }} - -
-
+ +