fix artist and album page is_favorite reactivity

+ remove nav components for playlist and album page
This commit is contained in:
geoffrey45
2022-12-28 18:14:46 +03:00
committed by Mungai Njoroge
parent 905fff04b4
commit 4d08ebedb6
9 changed files with 47 additions and 122 deletions
-86
View File
@@ -1,86 +0,0 @@
<template>
<div
class="title grid albumnavtitle"
:class="{
hide_play: header_shown,
}"
v-if="album.info.albumhash"
>
<div class="first grid">
<PlayBtn :source="things.source" :store="things.store" />
<div class="ellip">
{{ things.text }}
</div>
</div>
<Input :page="($route.name as string)" />
</div>
</template>
<script setup lang="ts">
import { computed } from "@vue/reactivity";
import { useRoute } from "vue-router";
import Input from "@/components/shared/NavSearchInput.vue";
import PlayBtn from "@/components/shared/PlayBtn.vue";
import { playSources } from "@/composables/enums";
import useAlbumStore from "@/stores/pages/album";
import usePStore from "@/stores/pages/playlist";
import { Routes } from "@/router/routes";
defineProps<{
header_shown: boolean;
}>();
const album = useAlbumStore();
const playlist = usePStore();
const things = computed(() => {
const route = useRoute();
let thing = {
text: "",
store: null as any,
source: playSources.album,
};
switch (route.name) {
case Routes.album:
thing = {
source: playSources.album,
text: useAlbumStore().info.title,
store: useAlbumStore,
};
break;
case Routes.playlist:
thing = {
source: playSources.playlist,
text: usePStore().info.name,
store: usePStore,
};
break;
}
return thing;
});
</script>
<style lang="scss">
.albumnavtitle {
grid-template-columns: max-content 1fr;
align-items: center;
justify-content: space-between;
gap: $small;
height: 100%;
.first {
grid-template-columns: max-content 1fr;
gap: $small;
align-items: center;
}
}
.albumnavtitle.hide_play {
.first {
visibility: hidden;
}
}
</style>