diff options
Diffstat (limited to 'src/components/mobile_nav/mobile_nav.js')
| -rw-r--r-- | src/components/mobile_nav/mobile_nav.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/components/mobile_nav/mobile_nav.js b/src/components/mobile_nav/mobile_nav.js new file mode 100644 index 00000000..a79aa636 --- /dev/null +++ b/src/components/mobile_nav/mobile_nav.js @@ -0,0 +1,35 @@ +import SideDrawer from '../side_drawer/side_drawer.vue' +import Notifications from '../notifications/notifications.vue' +import { unseenNotificationsFromStore } from '../../services/notification_utils/notification_utils' + +const MobileNav = { + components: { + SideDrawer, + Notifications + }, + data: () => ({ + notificationsOpen: false + }), + computed: { + unseenNotifications () { + return unseenNotificationsFromStore(this.$store) + }, + unseenNotificationsCount () { + return this.unseenNotifications.length + }, + sitename () { return this.$store.state.instance.name } + }, + methods: { + toggleMobileSidebar () { + this.$refs.sideDrawer.toggleDrawer() + }, + toggleMobileNotifications () { + this.notificationsOpen = !this.notificationsOpen + }, + scrollToTop () { + window.scrollTo(0, 0) + } + } +} + +export default MobileNav |
