Whalebird-desktop-client-ma.../src/renderer/components/TimelineSpace/SideMenu.vue

125 lines
3.0 KiB
Vue
Raw Normal View History

<template>
<div id="side_menu">
<div class="profile-wrapper" style="-webkit-app-region: drag;">
2018-03-09 07:48:20 +01:00
<div class="profile">
<div>@{{ account.username }}</div>
<span>{{ account.domain }}</span>
2018-03-09 07:48:20 +01:00
</div>
</div>
<el-menu
:default-active="$route.path"
background-color="#373d48"
text-color="#909399"
active-text-color="#ffffff"
:router="true"
class="el-menu-vertical timeline-menu">
<el-menu-item :index="`/${id()}/home`">
<icon name="home"></icon>
<span>Home</span>
<el-badge is-dot :hidden="!unreadHomeTimeline">
</el-badge>
</el-menu-item>
<el-menu-item :index="`/${id()}/notifications`">
<icon name="bell"></icon>
<span>Notification</span>
<el-badge is-dot :hidden="!unreadNotifications">
</el-badge>
</el-menu-item>
2018-03-13 15:56:23 +01:00
<el-menu-item :index="`/${id()}/favourites`">
<icon name="star"></icon>
2018-03-13 15:56:23 +01:00
<span>Favourite</span>
</el-menu-item>
<el-menu-item :index="`/${id()}/local`">
<icon name="users"></icon>
2018-04-13 20:16:00 +02:00
<span>Local timeline</span>
</el-menu-item>
<el-menu-item :index="`/${id()}/public`">
<icon name="globe"></icon>
2018-04-13 20:16:00 +02:00
<span>Public timeline</span>
</el-menu-item>
<li class="el-menu-item menu-item-title">
<icon name="list-ul"></icon>
<span>Lists</span>
</li>
<template v-for="list in lists">
2018-04-09 14:10:25 +02:00
<el-menu-item :index="`/${id()}/lists/${list.id}`" class="sub-menu" v-bind:key="list.id">
<span>#{{ list.title }}</span>
</el-menu-item>
</template>
</el-menu>
</div>
</template>
<script>
2018-03-09 07:48:20 +01:00
import { mapState } from 'vuex'
export default {
name: 'side-menu',
2018-03-09 07:48:20 +01:00
computed: {
...mapState({
account: state => state.TimelineSpace.account,
unreadHomeTimeline: state => state.TimelineSpace.SideMenu.unreadHomeTimeline,
unreadNotifications: state => state.TimelineSpace.SideMenu.unreadNotifications,
lists: state => state.TimelineSpace.SideMenu.lists
2018-03-09 07:48:20 +01:00
})
},
methods: {
id () {
return this.$route.params.id
}
}
}
</script>
<style lang="scss" scoped>
#side_menu {
2018-03-09 07:48:20 +01:00
.profile-wrapper {
background-color: #373d48;
position: fixed;
top: 0;
left: 65px;
2018-03-09 09:36:57 +01:00
width: 180px;
2018-03-22 10:09:58 +01:00
height: 70px;
2018-03-09 07:48:20 +01:00
.profile {
color: #ffffff;
font-weight: bold;
2018-03-24 01:56:48 +01:00
padding: 20px 8px 10px 20px;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis;
2018-03-09 07:48:20 +01:00
}
}
.timeline-menu /deep/ {
2018-03-09 07:48:20 +01:00
position: fixed;
2018-03-22 10:09:58 +01:00
top: 70px;
2018-03-09 07:48:20 +01:00
left: 65px;
height: 100%;
2018-03-09 09:36:57 +01:00
width: 180px;
.el-badge__content {
background-color: #409eff;
border: none;
margin-left: 4px;
}
.menu-item-title {
color: rgb(144, 147, 153);
cursor: default;
}
.menu-item-title:hover {
background-color: inherit;
}
.sub-menu {
padding-left: 45px !important;
height: 32px;
line-height: 32px;
font-size: 14px;
}
}
}
</style>