I found part of the bug for mobile (the empty space on the side) - Still need to fix the profile picture and social media icons (as they create space).

Move the language button and its logic.

Modify the sidebar (add navigation buttons for mobile).

Fix the display bug for the Subscription list.
This commit is contained in:
PascalMarchesseault
2024-09-10 01:05:17 -04:00
parent 94950a3cba
commit 29b07b40ba
7 changed files with 118 additions and 63 deletions

View File

@@ -1,37 +1,115 @@
<script setup>
import SiteMenu from "@/views/main/SiteMenu.vue";
import SubscriptionList from "@/views/creators/SubscriptionList.vue";
import {useAuthStore} from "@/stores/authStore.js";
import { useAuthStore } from "@/stores/authStore.js";
import { useRouter } from 'vue-router';
import { ref } from "vue";
import { useI18n } from 'vue-i18n';
const authStore = useAuthStore()
const { locale } = useI18n();
const router = useRouter();
const selectedLanguage = ref(locale.value);
const explorerHandler = () => {
router.push('/explorer');
};
const feedHandler = () => {
router.push('/feed');
};
function initializeLocale() {
const preferredLocale = localStorage.getItem('preferredLocale');
selectedLanguage.value = preferredLocale === null ? locale.value : preferredLocale;
locale.value = selectedLanguage.value;
}
function toggleLanguage() {
const lang = selectedLanguage.value === 'fr' ? 'en' : 'fr';
locale.value = lang;
selectedLanguage.value = lang;
localStorage.setItem('preferredLocale', lang);
}
const authStore = useAuthStore();
initializeLocale();
</script>
<template>
<aside class="relative h-full overflow-y-auto custom-scrollbar">
<nav class="flex flex-col h-full overflow-y-auto custom-scrollbar">
<div class="mt-16"></div>
<nav class="h-full grid grid-rows-[60px_1fr_auto]">
<div></div>
<div class="flex justify-center py-3">
<v-btn v-if="authStore.isAuthenticated" variant="plain" class="p-8" @click="feedHandler">
<img src="/images/hutopymedia/icons/feedfollow.svg" alt="feed follow icon"
style="filter: invert(0.5) brightness(0.0); width: 32px; height: 32px;" />
</v-btn>
<v-btn variant="plain" class="p-8" @click="explorerHandler">
<v-icon style="font-size: 28px;">mdi-earth</v-icon>
</v-btn>
<v-btn
variant="text"
class="p-0 mx-0 min-w-0"
@click="toggleLanguage"
>
{{ selectedLanguage === 'fr' ? 'Fr' : 'En' }}
</v-btn>
</div>
<div class="border border-solid border-1"></div>
<div v-if="authStore.isAuthenticated" class="pt-4 px-5">
{{ $t('sidebar.subscriptionTitle') }}
<subscription-list>
<template v-slot:default>
<span>Aucun abonnement</span>
</template>
</subscription-list>
</div>
<div v-else>
</div>
<div class="border-t w-full py-10">
<SiteMenu></SiteMenu>
</div>
<div v-if="authStore.isAuthenticated" class="flex-grow px-5 py-4">
<div class="font-bold"> {{ $t('sidebar.subscriptionTitle') }}</div>
<div v-if="authStore.isAuthenticated" class="flex-grow px-5">
</div>
<subscription-list>
<template v-slot:default>
<span v-if="subscriptionListIsEmpty">Aucun abonnement</span>
</template>
</subscription-list>
</div>
<div v-else class="flex-grow px-5 py-4 flex justify-center font-bold ">
<span>Connectez-vous</span>
</div>
</nav>
</aside>
<div class="border-t w-full py-10 mt-auto">
<SiteMenu></SiteMenu>
</div>
</nav>
</template>
<style scoped>
nav {
overflow-y: auto;
min-height: 0;
}
/* Firefox */
.custom-scrollbar {
scrollbar-width: thin;
scrollbar-color: #903175 #f1f1f1;
}
/* Chrome, Safari) */
.custom-scrollbar::-webkit-scrollbar {
width: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
background: #f1f1f1;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
background-color: #903175;
border-radius: 10px;
border: 2px solid #f1f1f1;
}
h2 {
@apply font-sans font-bold ml-2;
@@ -40,10 +118,5 @@ h2 {
aside {
@apply relative;
}
.custom-scrollbar {
scrollbar-width: thin;
scrollbar-color: #903175 #f1f1f1;
}
</style>