gamebrary/src/components/PageHeader.vue

66 lines
1.4 KiB
Vue
Raw Normal View History

2018-10-19 05:15:28 +00:00
<template lang="html">
2020-08-31 22:19:53 +00:00
<b-navbar class="px-3 py-2 border-0 shadow-none" :fixed="fixed">
<b-navbar-brand :to="{ name: 'home' }" class="border-0 p-0">
2020-07-22 15:52:09 +00:00
<img src="/static/gamebrary-logo.png" height="30" />
2020-08-25 04:23:34 +00:00
2020-09-01 17:47:56 +00:00
<small
v-if="showBoardTitle"
class="d-inline d-md-none"
v-text="board.name"
/>
2020-07-22 15:52:09 +00:00
</b-navbar-brand>
2020-09-01 17:47:56 +00:00
<b-nav
v-if="showBoardTitle"
class="d-none d-md-flex"
align="center"
pills
>
<b-nav-item
link-classes="p-2"
:to="`/board/${id}`"
:key="id"
v-for="{ name, id } in sortedBoards"
:active="board.id === id"
>
{{ name }}
</b-nav-item>
</b-nav>
2020-08-18 18:56:10 +00:00
<legacy-settings v-if="isLegacyBoard" />
<settings v-else />
2020-07-22 15:52:09 +00:00
</b-navbar>
2018-10-19 05:15:28 +00:00
</template>
<script>
2020-09-01 17:47:56 +00:00
import { mapState, mapGetters } from 'vuex';
2020-08-18 18:56:10 +00:00
import Settings from '@/components/Settings';
import LegacySettings from '@/components/LegacyBoard/LegacySettings';
2018-10-19 05:15:28 +00:00
export default {
2019-11-08 19:56:03 +00:00
components: {
2020-08-18 18:56:10 +00:00
Settings,
LegacySettings,
2019-11-08 19:56:03 +00:00
},
2019-02-05 07:31:40 +00:00
2019-11-08 19:56:03 +00:00
computed: {
2020-08-25 04:23:34 +00:00
...mapState(['board']),
2020-09-01 17:47:56 +00:00
...mapGetters(['sortedBoards']),
2020-08-25 04:23:34 +00:00
fixed() {
return this.$route.name === 'board'
? 'top'
: '';
},
2020-08-15 00:02:34 +00:00
2020-08-18 18:56:10 +00:00
isLegacyBoard() {
return this.$route.name === 'legacy-board';
2020-08-15 00:02:34 +00:00
},
2020-08-25 04:23:34 +00:00
showBoardTitle() {
return this.$route.name === 'board' && this.board.name;
},
2019-11-08 19:56:03 +00:00
},
2018-10-19 05:15:28 +00:00
};
</script>