redesign sidebar search load more buttons to match search page

This commit is contained in:
geoffrey45
2023-01-10 18:27:59 +03:00
committed by Mungai Njoroge
parent 532d0efabe
commit bd38c0e7a2
7 changed files with 43 additions and 23 deletions
+6
View File
@@ -142,3 +142,9 @@ button {
.no-select {
user-select: none;
}
.load_disabled {
pointer-events: all;
background: $gray5 !important;
opacity: 1;
}
@@ -19,13 +19,15 @@
</div>
<div v-else class="t-center"><h5>💔 No results 💔</h5></div>
<LoadMore
v-if="album_grid && search.albums.more"
:loader="search.loadAlbums"
v-if="search.albums.value.length || search.artists.value.length"
:loader="album_grid ? search.loadAlbums : search.loadArtists"
:can_load_more="album_grid ? search.albums.more : search.artists.more"
/>
<LoadMore
v-if="!album_grid && search.artists.more"
<!-- <LoadMore
v-if="!album_grid"
:loader="search.loadArtists"
/>
:can_load_more="search.artists.more"
/> -->
</div>
</template>
@@ -53,5 +55,7 @@ defineProps<{
display: grid;
grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
gap: 0.75rem;
min-height: 10rem;
padding-bottom: $small;
}
</style>
@@ -1,7 +1,12 @@
<template>
<div class="morexx">
<button class="btn" @click.prevent="loader()">
<div class="text">Load More</div>
<button
@click.prevent="loader()"
:class="{
load_disabled: !can_load_more,
}"
>
<div class="text">Load More {{ can_load_more }}</div>
</button>
</div>
</template>
@@ -9,9 +14,8 @@
<script setup lang="ts">
defineProps<{
loader: () => void;
can_load_more: boolean;
}>();
</script>
<style lang="scss">
@@ -19,9 +23,14 @@ defineProps<{
display: grid;
place-items: center;
margin-top: $small;
background-color: red;
button {
padding: 0 1rem !important;
width: calc(100% + 2rem);
border-radius: 0;
height: 3rem;
background: $darkestblue;
}
}
</style>
+1 -3
View File
@@ -1,7 +1,5 @@
<template>
<div style="height: 100%">
<component :is="getComponent()?.component" v-bind="getComponent()?.props" />
</div>
<component :is="getComponent()?.component" v-bind="getComponent()?.props" />
</template>
<script setup lang="ts">
@@ -52,7 +52,6 @@ const emit = defineEmits<{
height: 100%;
overflow: scroll;
overflow-x: hidden;
padding-bottom: 1rem;
}
#right-tabs.tabContent {
@@ -15,7 +15,11 @@
/>
</div>
<div v-else class="t-center"><h5>💔 No results 💔</h5></div>
<LoadMore v-if="search.tracks.more" :loader="search.loadTracks" />
<LoadMore
:loader="search.loadTracks"
:can_load_more="search.tracks.more"
v-if="search.tracks.value.length"
/>
</div>
</template>
@@ -58,3 +62,9 @@ onMounted(() => {
search.switchTab("tracks");
});
</script>
<style lang="scss">
#tracks-results .morexx {
margin-top: 1rem;
}
</style>
+3 -9
View File
@@ -6,7 +6,7 @@
<button
v-if="$route.params.page !== 'tracks'"
class="load-more"
:class="{ 'btn-disabled': !canLoadMore }"
:class="{ load_disabled: !canLoadMore }"
@click="canLoadMore && loadMore()"
>
Load more
@@ -143,14 +143,8 @@ onMounted(() => {
width: calc(100% + 1.25rem);
border-radius: 0;
background: $darkestblue;
// margin: 0 auto;
// margin-bottom: 1rem;
}
.btn-disabled {
pointer-events: all;
background: $gray !important;
opacity: 1;
}
}
</style>