fix tags in cards

This commit is contained in:
Gamebrary 2022-08-18 14:07:17 -07:00
parent 659854b3b4
commit b473b0edd3
8 changed files with 60 additions and 104 deletions

View file

@ -51,10 +51,6 @@ export default {
},
async loadGames() {
// this.similarGames = [];
// TODO: use try catch
// TODO: append cover url directly here
await this.$store.dispatch('LOAD_GAMES', this.similarGameIds.toString());
this.similarGames = this.similarGameIds ?

View file

@ -37,19 +37,18 @@
height="6px"
/>
<!-- TODO: use correct tags -->
<!-- <pre>{{ gameTags }}</pre> -->
<!-- <b-badge
v-for="({ hex, tagTextColor }, name) in gameTags"
:key="name"
pill
class="mr-1"
variant="primary"
tag="small"
:style="`background-color: ${hex}; color: ${tagTextColor}`"
>
<small>{{ name }}</small>
</b-badge> -->
<template v-if="tagsApplied.length">
<b-badge
v-for="({ bgColor, textColor, name }) in tagsApplied"
:key="name"
rounded
class="mr-1"
variant="transparent"
:style="`background-color: ${bgColor}; color: ${textColor}`"
>
<small>{{ name }}</small>
</b-badge>
</template>
</b-card-body>
</b-col>
</b-row>

View file

@ -21,19 +21,18 @@
height="6px"
/>
<!-- TODO: use correct tags -->
<!-- <template v-if="showGameTags">
<template v-if="tagsApplied.length">
<b-badge
v-for="({ hex, tagTextColor }, name) in gameTags"
v-for="({ bgColor, textColor, name }) in tagsApplied"
:key="name"
pill
rounded
class="mr-1"
variant="primary"
:style="`background-color: ${hex}; color: ${tagTextColor}`"
variant="transparent"
:style="`background-color: ${bgColor}; color: ${textColor}`"
>
<small>{{ name }}</small>
</b-badge>
</template> -->
</template>
<b-badge variant="warning" v-if="gameNotes">
<i class="far fa-sticky-note fa-fw" />

View file

@ -4,39 +4,38 @@
class="cursor-pointer"
>
<b-row no-gutters v-if="game && game.name">
<b-card-body body-class="pt-0 pb-1 px-2">
<small :class="`${highlightCompletedGame ? 'text-success' : ''}`">
{{ game.name }}
<b-card-body body-class="pt-0 pb-1 px-2">
<small :class="`${highlightCompletedGame ? 'text-success' : ''}`">
{{ game.name }}
<b-badge variant="warning" v-if="gameNotes">
<i class="far fa-sticky-note fa-fw" />
</b-badge>
</small>
<b-badge variant="warning" v-if="gameNotes">
<i class="far fa-sticky-note fa-fw" />
</b-badge>
</small>
<br />
<br />
<b-progress
v-if="gameProgress > 0"
:value="gameProgress"
class="my-1"
variant="success"
height="6px"
/>
<b-progress
v-if="gameProgress > 0"
:value="gameProgress"
class="my-1"
variant="success"
height="6px"
/>
<!-- TODO: use correct tags -->
<!-- <template v-if="showGameTags">
<b-badge
v-for="({ hex, tagTextColor }, name) in gameTags"
:key="name"
pill
variant="primary"
class="mr-1"
:style="`background-color: ${hex}; color: ${tagTextColor}`"
>
<small class="font-weight-bold">{{ name }}</small>
</b-badge>
</template> -->
</b-card-body>
<template v-if="tagsApplied.length">
<b-badge
v-for="({ bgColor, textColor, name }) in tagsApplied"
:key="name"
rounded
class="mr-1"
variant="transparent"
:style="`background-color: ${bgColor}; color: ${textColor}`"
>
<small>{{ name }}</small>
</b-badge>
</template>
</b-card-body>
</b-row>
</b-card>
</template>

View file

@ -4,7 +4,6 @@
title="BootstrapVue"
hide-footer
>
<!-- TODO: update shortcuts -->
<template v-slot:modal-header="{ close }">
<modal-header
title="Keyboard Shortcuts"

View file

@ -1,5 +1,3 @@
<!-- TODO: actually sort array when adding a game, list array should be unique source of truth -->
<!-- TODO: ^^ that would fix issues when jumping to next game on a sorted list -->
<template lang="html">
<div
:class="[
@ -145,7 +143,7 @@ export default {
...mapGetters(['isBoardOwner']),
draggingDisabled() {
return !this.user || !this.isBoardOwner || this.autoSortEnabled;
return !this.user || !this.isBoardOwner;
},
autoSortEnabled() {

View file

@ -1,6 +1,18 @@
<template lang="html">
<header class="p-2 d-flex">
<home-button />
<b-button
title="Dashboard"
size="sm"
class="mr-2"
variant="transparent"
:to="{ name: 'home' }"
>
<img
src="/logo.png"
width="20"
/>
</b-button>
<portal-target name="pageTitle" slim />
<div class="align-items-center d-flex ml-auto">
@ -40,15 +52,9 @@
</template>
<script>
import HomeButton from '@/components/Shared/HomeButton';
import { mapState } from 'vuex';
export default {
components: {
HomeButton,
},
computed: {
...mapState(['board', 'boards', 'user', 'game']),

View file

@ -1,40 +0,0 @@
<template lang="html">
<b-button
title="Dashboard"
size="sm"
class="mr-2"
variant="transparent"
@click="handleLogoClick"
>
<img
src="/logo.png"
width="20"
/>
<!-- TODO: move back button to here when viewing a game that's part of a board -->
</b-button>
</template>
<script>
import { mapState } from 'vuex';
export default {
computed: {
...mapState(['user']),
},
methods: {
handleLogoClick() {
// if (!this.user) {
// if (this.$route.name === 'public.boards') {
// this.$bvModal.show('authModal');
// } else {
// this.$router.push({ name: 'public.boards' });
// }
// }
//
// if (this.user && this.$route.name !== 'home') {
// }
this.$router.push({ name: 'home' });
},
},
};
</script>