Add timeline menu toggle to nav panel

This commit is contained in:
Shpuld Shpuldson 2021-02-22 16:24:04 +02:00
parent aa240f935f
commit 98cb9abac7
8 changed files with 183 additions and 100 deletions

View file

@ -1,4 +1,4 @@
import { timelineNames } from '../timeline_menu/timeline_menu.js'
import TimelineMenuContent from '../timeline_menu/timeline_menu_content.vue'
import { mapState, mapGetters } from 'vuex'
import { library } from '@fortawesome/fontawesome-svg-core'
@ -7,10 +7,12 @@ import {
faGlobe,
faBookmark,
faEnvelope,
faHome,
faChevronDown,
faChevronUp,
faComments,
faBell,
faInfoCircle
faInfoCircle,
faStream
} from '@fortawesome/free-solid-svg-icons'
library.add(
@ -18,10 +20,12 @@ library.add(
faGlobe,
faBookmark,
faEnvelope,
faHome,
faChevronDown,
faChevronUp,
faComments,
faBell,
faInfoCircle
faInfoCircle,
faStream
)
const NavPanel = {
@ -30,16 +34,20 @@ const NavPanel = {
this.$store.dispatch('startFetchingFollowRequests')
}
},
components: {
TimelineMenuContent
},
data () {
return {
showTimelines: false
}
},
methods: {
toggleTimelines () {
this.showTimelines = !this.showTimelines
}
},
computed: {
onTimelineRoute () {
return !!timelineNames()[this.$route.name]
},
timelinesRoute () {
if (this.$store.state.interface.lastTimeline) {
return this.$store.state.interface.lastTimeline
}
return this.currentUser ? 'friends' : 'public-timeline'
},
...mapState({
currentUser: state => state.users.currentUser,
followRequestCount: state => state.api.followRequests.length,