From b43c2f6e3c4faa29a94022eb42db9d0f43d6fd60 Mon Sep 17 00:00:00 2001 From: Jonathan Bourdon Date: Sun, 6 Oct 2024 00:37:49 -0400 Subject: [PATCH] Change the Creator's Profile to allow edition colors --- src/views/profile/creators/ColorsPicker.vue | 6 +-- src/views/profile/creators/CreatorPage.vue | 55 +++++---------------- 2 files changed, 13 insertions(+), 48 deletions(-) diff --git a/src/views/profile/creators/ColorsPicker.vue b/src/views/profile/creators/ColorsPicker.vue index 6216bef..65397d9 100644 --- a/src/views/profile/creators/ColorsPicker.vue +++ b/src/views/profile/creators/ColorsPicker.vue @@ -5,10 +5,6 @@ import {useClient} from "@/plugins/api.js"; const props = defineProps({ creator: { required: true - }, - colorName: { - type: String, - default: 'primary' } }); @@ -25,7 +21,7 @@ const onBackgroundColor = ref(props.creator.colors.onBackground) const onErrorColor = ref(props.creator.colors.onError) const onSurfaceColor = ref(props.creator.colors.onSurface) -const selectedColorName = ref(props.colorName); +const selectedColorName = ref('primary'); const selectedBackgroundColor = computed({ get() { switch (selectedColorName.value) { diff --git a/src/views/profile/creators/CreatorPage.vue b/src/views/profile/creators/CreatorPage.vue index 7855c0c..a57e899 100644 --- a/src/views/profile/creators/CreatorPage.vue +++ b/src/views/profile/creators/CreatorPage.vue @@ -11,17 +11,11 @@ import {useCreatorProfileStore} from "@/stores/creatorProfileStore.js"; import {useUserProfileStore} from "@/stores/userProfileStore.js"; const creatorProfileStore = useCreatorProfileStore() - -const colorBannerTop = computed(() => creatorProfileStore.creator.colors.primary || '#a0c0f0') -const colorBannerBottom = computed(() => creatorProfileStore.creator.colors.secondary || '#a0c0f0') -const colorAccent = computed(() => creatorProfileStore.creator.colors.accent || '#a0c0f0') -const colorMenu = computed(() => creatorProfileStore.creator.colors.menu || '#a0c0f0') const imageBanner = computed(() => creatorProfileStore.creator.images.banner || '/images/placeholders/banner.png') const imageLogo = computed(() => creatorProfileStore.creator.images.logo || '/images/placeholders/logo.png') const dialog = ref(false); const currentComponent = ref('') -const colorToEdit = ref(null) const componentsMap = { BannerPicker, @@ -52,9 +46,8 @@ function requestCancel() { dialog.value = false } -const openDialog = (component, colorName = null) => { +const openDialog = (component) => { currentComponent.value = componentsMap[component] - colorToEdit.value = colorName dialog.value = true } @@ -72,7 +65,6 @@ const closeDialog = () => { {
{{ $t('creatorinfopage.banner&profile') }}
-
+
- + Choissisez votre palette de couleurs + + - - - -
@@ -257,7 +224,9 @@ const closeDialog = () => {
+ +