gamebrary/src/components/Dock.vue

182 lines
4.1 KiB
Vue
Raw Normal View History

2021-02-19 22:12:08 +00:00
<!-- TODO: auto hide dock on scroll -->
2018-10-19 05:15:28 +00:00
<template lang="html">
2020-10-14 00:37:42 +00:00
<nav
2021-02-19 22:12:08 +00:00
class="rounded position-fixed d-flex flex-column p-0 m-2 text-center border dock"
2021-02-04 15:51:31 +00:00
:class="{
2021-02-21 18:14:46 +00:00
'bg-dark text-white border-info': darkTheme,
'bg-white': !darkTheme,
2021-02-04 15:51:31 +00:00
}"
2020-10-14 00:37:42 +00:00
>
2021-02-01 23:20:41 +00:00
<b-button
2021-01-20 22:44:04 +00:00
title="Dashboard"
2021-02-01 23:20:41 +00:00
variant="transparent"
class="my-2 p-0"
@click="handleLogoClick"
2020-11-23 23:36:03 +00:00
>
2020-10-14 00:37:42 +00:00
<img
2021-02-21 18:14:46 +00:00
:src="`/static/gamebrary-logo${darkTheme ? '' : '-dark'}.png`"
2020-10-14 00:37:42 +00:00
width="32"
/>
2021-02-01 23:20:41 +00:00
</b-button>
2020-09-26 00:09:20 +00:00
2021-02-03 05:33:45 +00:00
<pinned-boards v-if="user" />
2021-02-01 19:38:17 +00:00
2021-02-19 22:12:08 +00:00
<b-collapse id="moreMenu" v-model="moreMenuOpen">
<b-button
2021-02-03 21:04:02 +00:00
:to="{ name: 'boards' }"
2021-02-21 18:14:46 +00:00
:variant="darkTheme ? 'dark' : 'light'"
2021-02-19 22:12:08 +00:00
size="sm"
title="Boards"
2021-02-03 21:04:02 +00:00
>
2021-02-01 19:38:17 +00:00
<i class="fas fa-columns fa-fw" aria-hidden />
2021-02-19 22:12:08 +00:00
</b-button>
2021-02-01 19:38:17 +00:00
2021-02-19 22:12:08 +00:00
<b-button
2021-02-03 21:04:02 +00:00
:to="{ name: 'tags' }"
2021-02-21 18:14:46 +00:00
:variant="darkTheme ? 'dark' : 'light'"
2021-02-19 22:12:08 +00:00
class="mt-1"
size="sm"
title="Tags"
2021-02-03 21:04:02 +00:00
>
2021-02-01 19:38:17 +00:00
<i class="fas fa-tags fa-fw" aria-hidden />
2021-02-19 22:12:08 +00:00
</b-button>
2021-02-01 19:38:17 +00:00
2021-02-19 22:12:08 +00:00
<b-button
2021-02-03 21:04:02 +00:00
:to="{ name: 'notes' }"
2021-02-21 18:14:46 +00:00
:variant="darkTheme ? 'dark' : 'light'"
2021-02-19 22:12:08 +00:00
class="mt-1"
size="sm"
title="Notes"
2021-02-03 21:04:02 +00:00
>
2021-02-01 19:38:17 +00:00
<i class="fas fa-sticky-note fa-fw" aria-hidden />
2021-02-19 22:12:08 +00:00
</b-button>
2021-02-01 19:38:17 +00:00
2021-02-19 22:12:08 +00:00
<b-button
2021-02-03 21:04:02 +00:00
:to="{ name: 'wallpapers' }"
2021-02-21 18:14:46 +00:00
:variant="darkTheme ? 'dark' : 'light'"
2021-02-19 22:12:08 +00:00
class="mt-1"
size="sm"
title="Wallpapers"
2021-02-03 21:04:02 +00:00
>
2021-02-01 19:38:17 +00:00
<i class="fas fa-images fa-fw" aria-hidden />
2021-02-19 22:12:08 +00:00
</b-button>
2021-02-01 19:38:17 +00:00
2021-02-19 22:12:08 +00:00
<b-button
2021-02-21 18:14:46 +00:00
:variant="darkTheme ? 'dark' : 'light'"
2021-02-19 22:12:08 +00:00
class="mt-1"
size="sm"
2021-02-09 18:55:08 +00:00
v-b-modal:keyboard-shortcuts
2021-02-19 22:12:08 +00:00
title="Keyboard shortcuts"
2021-02-09 18:55:08 +00:00
>
<i class="fas fa-keyboard fa-fw" aria-hidden />
2021-02-19 22:12:08 +00:00
</b-button>
<hr class="my-1">
2021-02-01 19:38:17 +00:00
2021-02-19 22:12:08 +00:00
<b-button
2021-02-03 21:04:02 +00:00
:to="{ name: 'settings' }"
2021-02-21 18:14:46 +00:00
:variant="darkTheme ? 'dark' : 'light'"
2021-02-19 22:12:08 +00:00
size="sm"
title="Settings"
2021-02-03 21:04:02 +00:00
>
2021-02-01 19:38:17 +00:00
<i class="fas fa-cog fa-fw" aria-hidden />
2021-02-19 22:12:08 +00:00
</b-button>
<b-button
:to="{ name: 'about' }"
2021-02-21 18:14:46 +00:00
:variant="darkTheme ? 'dark' : 'light'"
2021-02-19 22:12:08 +00:00
class="mt-1"
size="sm"
title="About"
>
<i class="fas fa-info fa-fw" aria-hidden />
</b-button>
<b-button
:to="{ name: 'releases' }"
2021-02-21 18:14:46 +00:00
:variant="darkTheme ? 'dark' : 'light'"
2021-02-19 22:12:08 +00:00
class="my-1"
size="sm"
title="Releases"
>
<i class="fas fa-bullhorn fa-fw" aria-hidden />
</b-button>
</b-collapse>
<!-- TODO: persist value -->
<b-button
v-b-toggle.moreMenu
2021-02-21 18:14:46 +00:00
:variant="darkTheme ? 'dark' : 'light'"
class="mx-1 mb-1 py-0"
2021-02-19 22:12:08 +00:00
size="sm"
>
<i :class="`fas fa-angle-double-${moreMenuOpen ? 'up' : 'down'} fa-fw`" />
</b-button>
2020-09-26 00:09:20 +00:00
</nav>
2018-10-19 05:15:28 +00:00
</template>
<script>
2020-09-01 17:47:56 +00:00
import { mapState, mapGetters } from 'vuex';
2021-01-25 21:05:35 +00:00
import PinnedBoards from '@/components/Board/PinnedBoards';
2018-10-19 05:15:28 +00:00
export default {
components: {
2021-01-25 21:05:35 +00:00
PinnedBoards,
},
2021-02-19 22:12:08 +00:00
data() {
return {
moreMenuOpen: false,
};
},
2019-11-08 19:56:03 +00:00
computed: {
...mapState(['board', 'notification', 'user']),
2021-02-21 18:14:46 +00:00
...mapGetters(['darkTheme']),
2021-01-20 22:48:01 +00:00
isBoard() {
return ['public-board', 'board'].includes(this.$route.name);
},
2019-11-08 19:56:03 +00:00
},
2021-02-01 23:20:41 +00:00
methods: {
handleLogoClick() {
2021-02-03 21:04:02 +00:00
if (!this.user) {
if (this.$route.name === 'public-boards') {
this.$bvModal.show('authModal');
} else {
this.$router.push({ name: 'public-boards' });
}
2021-02-03 21:04:02 +00:00
}
2021-02-01 23:20:41 +00:00
if (this.user && this.$route.name !== 'boards') {
this.$router.push({ name: 'boards' });
}
},
2021-02-19 22:12:08 +00:00
// async pinBoard() {
// const payload = {
// ...this.board,
// pinned: !this.board.pinned,
// };
//
// this.$store.commit('SET_ACTIVE_BOARD', payload);
//
// await this.$store.dispatch('SAVE_BOARD')
// .catch(() => {
// this.$bvToast.toast('There was an error renaming list', { variant: 'danger' });
// });
//
// this.$bvToast.toast('Board settings saved');
// },
2021-02-01 23:20:41 +00:00
},
2018-10-19 05:15:28 +00:00
};
</script>
2020-09-26 00:09:20 +00:00
<style lang="scss" rel="stylesheet/scss" scoped>
2021-02-19 22:12:08 +00:00
.dock {
2020-09-26 00:09:20 +00:00
width: 50px;
2020-09-30 02:36:27 +00:00
z-index: 1;
2020-09-26 00:09:20 +00:00
}
</style>