2018-03-22 10:09:58 +01:00
|
|
|
<template>
|
|
|
|
<div id="header_menu">
|
2018-04-09 01:43:11 +02:00
|
|
|
<div class="channel">{{ title }}</div>
|
2018-03-22 10:09:58 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2018-04-09 01:43:11 +02:00
|
|
|
import { mapState } from 'vuex'
|
|
|
|
|
2018-03-22 10:09:58 +01:00
|
|
|
export default {
|
2018-03-22 10:16:45 +01:00
|
|
|
name: 'header-menu',
|
2018-04-09 01:43:11 +02:00
|
|
|
computed: {
|
|
|
|
...mapState({
|
|
|
|
title: state => state.TimelineSpace.HeaderMenu.title
|
|
|
|
})
|
|
|
|
},
|
|
|
|
created () {
|
|
|
|
this.channelName()
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
'$route': function () {
|
|
|
|
this.channelName()
|
|
|
|
}
|
|
|
|
},
|
2018-03-22 10:16:45 +01:00
|
|
|
methods: {
|
|
|
|
channelName () {
|
|
|
|
switch (this.$route.name) {
|
|
|
|
case 'home':
|
2018-04-09 01:43:11 +02:00
|
|
|
this.$store.commit('TimelineSpace/HeaderMenu/updateTitle', 'Home')
|
|
|
|
break
|
2018-03-22 10:16:45 +01:00
|
|
|
case 'notifications':
|
2018-04-09 01:43:11 +02:00
|
|
|
this.$store.commit('TimelineSpace/HeaderMenu/updateTitle', 'Notification')
|
|
|
|
break
|
2018-03-22 10:16:45 +01:00
|
|
|
case 'favourites':
|
2018-04-09 01:43:11 +02:00
|
|
|
this.$store.commit('TimelineSpace/HeaderMenu/updateTitle', 'Favourite')
|
|
|
|
break
|
2018-03-22 10:16:45 +01:00
|
|
|
case 'local':
|
2018-04-09 01:43:11 +02:00
|
|
|
this.$store.commit('TimelineSpace/HeaderMenu/updateTitle', 'LocalTimeline')
|
|
|
|
break
|
2018-03-22 10:16:45 +01:00
|
|
|
case 'public':
|
2018-04-09 01:43:11 +02:00
|
|
|
this.$store.commit('TimelineSpace/HeaderMenu/updateTitle', 'PublicTimeline')
|
|
|
|
break
|
|
|
|
case 'lists':
|
|
|
|
this.$store.dispatch('TimelineSpace/HeaderMenu/fetchList', this.$route.params.list_id)
|
|
|
|
break
|
2018-03-22 10:16:45 +01:00
|
|
|
default:
|
2018-04-09 01:43:11 +02:00
|
|
|
this.$store.commit('TimelineSpace/HeaderMenu/updateTitle', 'Home')
|
|
|
|
break
|
2018-03-22 10:16:45 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-03-22 10:09:58 +01:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
#header_menu {
|
|
|
|
.channel {
|
|
|
|
padding: 12px 24px;
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 18px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|