Change creat btn position to side menu

This commit is contained in:
PascalMarchesseault
2024-10-22 18:18:04 -04:00
parent 14c97c35dc
commit 7544e01049
3 changed files with 25 additions and 20 deletions

View File

@@ -2,17 +2,28 @@
import SubscriptionList from "@/views/creators/SubscriptionList.vue";
import {useAuthStore} from "@/stores/authStore.js";
import {useRouter} from 'vue-router';
import {ref} from "vue";
import {computed, ref} from "vue";
import {useI18n} from 'vue-i18n';
import {useCreatorProfileStore} from "@/stores/creatorProfileStore.js";
import {useUserProfileStore} from "@/stores/userProfileStore.js";
import {useBrandingStore} from "@/stores/brandingStore.js";
import PublishContentButton from "@/views/contents/PublishContentButton.vue";
const {locale} = useI18n();
const router = useRouter();
const selectedLanguage = ref(locale.value);
const userProfileStore = useUserProfileStore()
const creatorProfileStore = useCreatorProfileStore()
const userProfileStore = useUserProfileStore();
const creatorProfileStore = useCreatorProfileStore();
const brandingStore = useBrandingStore();
const authStore = useAuthStore();
// Définir creatorIsCurrentUser avec la logique provenant du premier script
const creatorIsCurrentUser = computed(() => authStore.isAuthenticated && authStore.userId === brandingStore.value.id);
const createHtmlContent = () => {
router.push('/content/editor');
};
function initializeLocale() {
const preferredLocale = localStorage.getItem('preferredLocale');
@@ -27,11 +38,10 @@ function toggleLanguage() {
localStorage.setItem('preferredLocale', lang);
}
const authStore = useAuthStore();
initializeLocale();
</script>
<template>
<nav class="flex flex-col h-full bg-white">
@@ -48,6 +58,13 @@ initializeLocale();
</router-link>
</div>
<div v-if="creatorIsCurrentUser" class="justify-center text-center">
<publish-content-button></publish-content-button>
<v-btn variant="flat" icon @click="createHtmlContent">
<v-icon>mdi-pencil</v-icon>
</v-btn>
</div>
<!-- SUBSCRIPTION SECTION -->
<div class="flex-grow px-4 mt-4">
<template v-if="authStore.isAuthenticated">