From 85adc049212ad40580254cbe79abfee5a5228034 Mon Sep 17 00:00:00 2001 From: PascalMarchesseault <97350299+PascalMarchesseault@users.noreply.github.com> Date: Sun, 3 Nov 2024 10:34:57 -0500 Subject: [PATCH] App: Added a sidebar store with BannerAction to adjust the z-depth. CreatorLayout: Resized the content with the sidebar and added the option for a closed or open menu. Also added a value in SidebarStore to track the menu state for correct positioning. --- src/App.vue | 20 ++-- src/stores/sideBarStore.js | 31 +++--- src/views/creators/BannerActions.vue | 2 +- src/views/creators/CreatorLayout.vue | 2 +- src/views/main/SideBar.vue | 149 +++++++++++++-------------- 5 files changed, 93 insertions(+), 111 deletions(-) diff --git a/src/App.vue b/src/App.vue index 0218c91..16ed01d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,35 +1,33 @@ +s \ No newline at end of file diff --git a/src/stores/sideBarStore.js b/src/stores/sideBarStore.js index 02075ed..0e1b142 100644 --- a/src/stores/sideBarStore.js +++ b/src/stores/sideBarStore.js @@ -1,23 +1,16 @@ -import {computed, ref} from 'vue'; -import {defineStore} from "pinia"; +// src/stores/sideBarStore.js +import { computed, ref } from 'vue'; +import { defineStore } from 'pinia'; -export const useSideBarStore = defineStore( - 'sideBar', - () => { - const state = ref(false) - const visible = computed(() => state.value) +export const useSideBarStore = defineStore('sideBar', () => { + const isOpen = ref(true); // par défaut, le menu est ouvert - function toggle() { - state.value = !state.value - } + const toggle = () => { + isOpen.value = !isOpen.value; + }; - function show() { - state.value = true - } + // Classe de largeur dynamique pour le contenu principal + const sidebarWidth = computed(() => (isOpen.value ? 'ml-64' : 'ml-16')); - function hide() { - state.value = false - } - - return {visible, toggle, show, hide} - }) \ No newline at end of file + return { isOpen, toggle, sidebarWidth }; +}); diff --git a/src/views/creators/BannerActions.vue b/src/views/creators/BannerActions.vue index fe32339..56447eb 100644 --- a/src/views/creators/BannerActions.vue +++ b/src/views/creators/BannerActions.vue @@ -55,7 +55,7 @@ -
-
+
diff --git a/src/views/main/SideBar.vue b/src/views/main/SideBar.vue index fc3dfef..9ebed71 100644 --- a/src/views/main/SideBar.vue +++ b/src/views/main/SideBar.vue @@ -1,11 +1,12 @@  -