update navigation, rename timeline link in nav panel to timelines

This commit is contained in:
Shpuld Shpuldson 2020-07-07 18:20:37 +03:00
parent ddde05771f
commit cde6acdbbd
4 changed files with 11 additions and 23 deletions

View File

@ -11,6 +11,9 @@ const NavPanel = {
onTimelineRoute () { onTimelineRoute () {
return !!timelineNames()[this.$route.name] return !!timelineNames()[this.$route.name]
}, },
timelinesRoute () {
return this.currentUser ? 'friends' : 'public-timeline'
},
...mapState({ ...mapState({
currentUser: state => state.users.currentUser, currentUser: state => state.users.currentUser,
followRequestCount: state => state.api.followRequests.length, followRequestCount: state => state.api.followRequests.length,

View File

@ -2,19 +2,14 @@
<div class="nav-panel"> <div class="nav-panel">
<div class="panel panel-default"> <div class="panel panel-default">
<ul> <ul>
<li v-if="currentUser"> <li v-if="currentUser || !privateMode">
<router-link <router-link
:to="{ name: 'friends' }" :to="{ name: timelinesRoute }"
:class="onTimelineRoute && 'router-link-active'" :class="onTimelineRoute && 'router-link-active'"
> >
<i class="button-icon icon-home-2" /> {{ $t("nav.timelines") }} <i class="button-icon icon-home-2" /> {{ $t("nav.timelines") }}
</router-link> </router-link>
</li> </li>
<li v-else-if="!privateMode">
<router-link :to="{ name: 'public-timeline' }">
<i class="button-icon icon-users" /> {{ $t("nav.public_tl") }}
</router-link>
</li>
<li v-if="currentUser"> <li v-if="currentUser">
<router-link :to="{ name: 'interactions', params: { username: currentUser.screen_name } }"> <router-link :to="{ name: 'interactions', params: { username: currentUser.screen_name } }">
<i class="button-icon icon-bell-alt" /> {{ $t("nav.interactions") }} <i class="button-icon icon-bell-alt" /> {{ $t("nav.interactions") }}

View File

@ -47,6 +47,9 @@ const SideDrawer = {
}, },
federating () { federating () {
return this.$store.state.instance.federating return this.$store.state.instance.federating
},
timelinesRoute () {
return this.currentUser ? 'friends' : 'public-timeline'
} }
}, },
methods: { methods: {

View File

@ -40,19 +40,11 @@
</router-link> </router-link>
</li> </li>
<li <li
v-if="currentUser" v-if="currentUser || !privateMode"
@click="toggleDrawer" @click="toggleDrawer"
> >
<router-link :to="{ name: 'friends' }"> <router-link :to="{ name: timelinesRoute }">
<i class="button-icon icon-home-2" /> {{ $t("nav.timeline") }} <i class="button-icon icon-home-2" /> {{ $t("nav.timelines") }}
</router-link>
</li>
<li
v-else
@click="toggleDrawer"
>
<router-link :to="{ name: 'public-timeline' }">
<i class="button-icon icon-users" /> {{ $t("nav.public_tl") }}
</router-link> </router-link>
</li> </li>
</ul> </ul>
@ -62,11 +54,6 @@
<i class="button-icon icon-bell-alt" /> {{ $t("nav.interactions") }} <i class="button-icon icon-bell-alt" /> {{ $t("nav.interactions") }}
</router-link> </router-link>
</li> </li>
<li @click="toggleDrawer">
<router-link :to="{ name: 'bookmarks'}">
<i class="button-icon icon-bookmark" /> {{ $t("nav.bookmarks") }}
</router-link>
</li>
<li <li
v-if="currentUser.locked" v-if="currentUser.locked"
@click="toggleDrawer" @click="toggleDrawer"