Adds brandingStore.

Split userStore into userProfileStore and creatorProfileStore
This commit is contained in:
2024-09-22 02:42:26 -04:00
parent 3cfb3951e3
commit cd51474d08
36 changed files with 458 additions and 639 deletions

View File

@@ -4,40 +4,21 @@ import BannerActionsSm from "@/views/creators/banner/bannerlower/BannerActionsSm
import BannerActionsLg from "@/views/creators/banner/bannerlower/BannerActionsLg.vue";
import BannerActionsXl from "@/views/creators/banner/bannerlower/BannerActionsXl.vue";
const props = defineProps({
creator: {type: Object, required: true}
});
const emits = defineEmits(['content-posted']);
function addContent(content) {
emits('content-posted', content);
}
</script>
<template>
<div>
<banner-actions-sm class="d-sm-none"
:creator="creator"
@content-posted="addContent"
></banner-actions-sm>
<div class="d-none d-sm-flex d-md-none">
<banner-actions-md :creator="creator"
@content-posted="addContent"
></banner-actions-md>
</div>
<banner-actions-md class="d-none d-sm-flex d-md-none"
></banner-actions-md>
<div class="d-none d-md-flex d-lg-none">
<banner-actions-lg :creator="creator"
@content-posted="addContent"
></banner-actions-lg>
</div>
<banner-actions-lg class="d-none d-md-flex d-lg-none"
></banner-actions-lg>
<div class="d-none d-lg-flex">
<banner-actions-xl :creator="creator"
@content-posted="addContent"
></banner-actions-xl>
</div>
<banner-actions-xl class="d-none d-lg-flex"
></banner-actions-xl>
</div>
</template>

View File

@@ -1,7 +1,7 @@
<template>
<div class="relative w-full">
<div ref="mainContainer" class="rounded-b-2xl pt-2 pb-1"
:style="{ backgroundColor: creator.colors.bannerBottom || '#A30E79', borderBottom: '5px inset' + (creator.colors.menu || '#000') }">
:style="{ backgroundColor: brandingStore.value.colors.bannerBottom, borderBottom: '5px inset' + (brandingStore.value.colors.menu || '#000') }">
<!-- Logo & User Info -->
<div class="relative z-20">
@@ -9,30 +9,21 @@
<div>
<img
class="shadow-2xl rounded-full border-solid border-4 absolute z-20 max-w-[190px] ml-15 -mt-32"
:src="creator.images.logo ? creator.images.logo : '/images/placeholders/logo.png'"
:src="brandingStore.value.images.logo ? brandingStore.value.images.logo : '/images/placeholders/logo.png'"
alt="Profile Picture"
:style="{ borderColor: creator.colors.accent || '#A30E79', height: '190px'}"
:style="{ borderColor: brandingStore.value.colors.accent, height: '190px'}"
/>
</div>
<div class="flex flex-row ml-auto space-x-2.5">
<donation-button-banner
:color-border="creator.colors.menu"
:color-accent="creator.colors.accent"
:creator-id="creator.id"
:creator-name="creator.name"
:creator-logo="creator.images.logo"
iconColorClass="text-white">
</donation-button-banner>
<donation-button-banner></donation-button-banner>
<div class="flex flex-column">
<!-- Bouton abonnement affiché seulement si non abonné -->
<subscribe-button
:creator="creator"
:color-border="creator.colors.menu">
</subscribe-button>
<subscribe-button></subscribe-button>
<div class="font-bold text-white flex justify-end mr-5 py-1.5">
{{ creator.subscriberCount }} {{ $t('banner.subscription') }}
{{ brandingStore.value.subscriberCount }} {{ $t('banner.subscription') }}
</div>
</div>
</div>
@@ -42,36 +33,26 @@
<!-- Conteneur sticky -->
<div v-show="isSticky" class=" sticky-header fixed top-14 left-0 right-0 w-full z-20"
:style="{ backgroundColor: creator.colors.bannerBottom || '#A30E79', borderBottom: '5px inset' + (creator.colors.menu || '#000') }">
:style="{ backgroundColor: brandingStore.value.colors.bannerBottom , borderBottom: '5px inset' + (brandingStore.value.colors.menu || '#000') }">
<div class="shadow-3xl flex flex-row items-center py-2 px-2">
<div>
<img
class="max-w-[40px] max-h-[40px] ml-5 rounded-full"
:src="creator.images.logo ? creator.images.logo : '/images/placeholders/logo.png'"
:src="brandingStore.value.images.logo ? brandingStore.value.images.logo : '/images/placeholders/logo.png'"
alt="Profile Picture"
:style="{ borderColor: creator.colors.accent || '#A30E79', height: '190px'}"
:style="{ borderColor: brandingStore.value.colors.accent, height: '190px'}"
/>
</div>
<div class="ml-5 text-white">
<p class="capitalize text-2xl font-bold">{{ creator.name }}</p>
<p class="capitalize text-2xl font-bold">{{ brandingStore.value.name }}</p>
</div>
<div class="ml-auto flex flex-row space-x-2.5 mr-3 ">
<donation-button-banner-slim
class=""
:color-border="creator.colors.menu"
:color-accent="creator.colors.accent"
:creator-id="creator.id"
:creator-name="creator.name"
:creator-logo="creator.images.logo"
>
</donation-button-banner-slim>
<donation-button-banner-slim></donation-button-banner-slim>
<!-- Afficher le bouton d'abonnement seulement si l'utilisateur n'est pas abonné -->
<subscribe-button-slim
v-if="!isSubscribed"
:creator="creator"
:color-border="creator.colors.menu">
v-if="!isSubscribed">
</subscribe-button-slim>
</div>
@@ -82,21 +63,19 @@
<script setup>
import { ref, onMounted, computed } from 'vue';
import { useSubscriptionStore } from "@/stores/subscriptionStore.js";
import {ref, onMounted, computed} from 'vue';
import SubscribeButton from "@/views/creators/SubscribeButton.vue";
import DonationButtonBanner from "@/views/creators/DonationButtonBanner.vue";
import SubscribeButtonSlim from "@/views/creators/SubscribeButtonSlim.vue";
import DonationButtonBannerSlim from "@/views/creators/DonationButtonBannerSlim.vue";
import {useSubscriptionStore} from "@/stores/subscriptionStore.js";
import {useBrandingStore} from "@/stores/brandingStore.js";
const props = defineProps({
creator: { type: Object, required: true }
});
const subscriptionStore = useSubscriptionStore();
const brandingStore = useBrandingStore()
const subscriptionStore = useSubscriptionStore()
// Calculer si l'utilisateur est abonné
const isSubscribed = computed(() => subscriptionStore.isSubscribeTo(props.creator.id));
const isSubscribed = computed(() => subscriptionStore.isSubscribeTo(brandingStore.value.id));
const isSticky = ref(false);
const mainContainer = ref(null);
@@ -106,7 +85,7 @@ onMounted(() => {
([entry]) => {
isSticky.value = !entry.isIntersecting;
},
{ threshold: 0 }
{threshold: 0}
);
if (mainContainer.value) {

View File

@@ -1,7 +1,7 @@
<template>
<div class="w-full">
<div class="rounded-b-2xl"
:style="{ backgroundColor: creator.colors.bannerBottom || '#A30E79' }">
:style="{ backgroundColor: brandingStore.value.colors.bannerBottom }">
<div>
<!-- Logo-Name-Followers -->
@@ -9,32 +9,26 @@
<div>
<img
class="absolute rounded-full border-solid border-2 max-w-[140px] h-auto ml-3 -mt-3"
:src="creator.images.logo ? creator.images.logo : '/images/placeholders/logo.png'"
:src="brandingStore.value.images.logo ? brandingStore.value.images.logo : '/images/placeholders/logo.png'"
alt="Profile Picture"
:style="{ borderColor: creator.colors.accent || '#A30E79', height: '150px'}"
:style="{ borderColor: brandingStore.value.colors.accent, height: '150px'}"
/>
</div>
<div class="flex flex-column text-white cap px-2 mt-1 w-full ml-40">
<div class="flex justify-between">
<div>
<p class="capitalize text-2xl font-bold">{{ creator.name }}</p>
<div>{{ creator.subscriberCount }} {{ $t('banner.subscription') }}</div>
<p class="capitalize text-2xl font-bold">{{ brandingStore.value.name }}</p>
<div>{{ brandingStore.value.subscriberCount }} {{ $t('banner.subscription') }}</div>
</div>
</div>
<div class="flex justify-between mt-2">
<subscribe-button :creator="creator"></subscribe-button>
<subscribe-button></subscribe-button>
<div class="flex space-x-2">
<donation-button :color-border="creator.colors.menu"
:color-accent="creator.colors.accent"
:creator-id="creator.id"
:creator-name="creator.name"
:creator-logo="creator.images.logo"
iconColorClass="text-white"
<donation-button iconColorClass="text-white"
></donation-button>
</div>
</div>
@@ -50,9 +44,8 @@
<script setup>
import SubscribeButton from "@/views/creators/SubscribeButton.vue";
import DonationButton from "@/views/creators/DonationButton.vue";
import {useBrandingStore} from "@/stores/brandingStore.js";
const props = defineProps({
creator: {type: Object, required: true}
});
const brandingStore = useBrandingStore()
</script>

View File

@@ -1,27 +1,14 @@
<template>
<div class="w-full">
<div
:style="{
backgroundColor: creator.colors.bannerBottom || '#A30E79',
borderBottom: `2px solid ${creator.colors.accent || '#000000'}`
}">
:style="{backgroundColor: brandingStore.value.colors.bannerBottom, borderBottom: `2px solid ${brandingStore.value.colors.accent}`}">
<div>
<!-- Logo-Name-Followers-->
<div class="flex flex-row relative z-20">
<div>
<!-- bug space-->
<!-- <img-->
<!-- -->
<!-- class="rounded-full border-solid border-2 -mt-4 max-w-[80px] h-auto ml-2"-->
<!-- :src="creator.images.logo ? creator.images.logo : '/images/placeholders/logo.png'"-->
<!-- alt="Profile Picture"-->
<!-- :style="{ borderColor: creator.colors.accent || '#A30E79', height: '150px'}"-->
<!-- />-->
</div>
<div class="flex flex-column text-white capitalize px-2 mt-1">
<p class="capitalize text-2xl font-bold">{{ creator.name }}</p>
<div>{{ creator.subscriberCount }} {{ $t('banner.subscription')}}</div>
<p class="capitalize text-2xl font-bold">{{ brandingStore.value.name }}</p>
<div>{{ brandingStore.value.subscriberCount }} {{ $t('banner.subscription') }}</div>
</div>
</div>
@@ -30,21 +17,11 @@
<div class="flex flex-row items-center justify-between w-full px-4">
<div>
<subscribe-button :creator="creator"
></subscribe-button>
<subscribe-button></subscribe-button>
</div>
<div class="flex ml-auto space-x-4">
<publish-content-button :creator="creator"
@content-posted="addContent"
></publish-content-button>
<donation-button :color-border="creator.colors.menu"
:color-accent="creator.colors.accent"
:creator-id="creator.id"
:creator-name="creator.name"
:creator-logo="creator.images.logo"
iconColorClass="text-white"
<donation-button iconColorClass="text-white"
></donation-button>
</div>
@@ -58,16 +35,9 @@
<script setup>
import SubscribeButton from "@/views/creators/SubscribeButton.vue";
import PublishContentButton from "@/views/contents/PublishContentButton.vue";
import DonationButton from "@/views/creators/DonationButton.vue";
import {useBrandingStore} from "@/stores/brandingStore.js";
const props = defineProps({
creator: {type: Object, required: true}
});
const brandingStore = useBrandingStore()
const emits = defineEmits(['content-posted']);
function addContent(content) {
emits('content-posted', content);
}
</script>

View File

@@ -4,7 +4,7 @@
<div class="relative w-full shadow-xl rounded-2xl">
<div ref="mainContainer" class="rounded-b-2xl shadow-2xl"
:style="{ backgroundColor: creator.colors.primary, boxShadow: '0 5px 10px rgba(0, 0, 0, 0.3)' }">
:style="{ backgroundColor: brandingStore.value.colors.primary, boxShadow: '0 5px 10px rgba(0, 0, 0, 0.3)' }">
<div>
<div>
@@ -14,16 +14,16 @@
<div>
<img
class="shadow-2xl rounded-full border-solid border-102 absolute z-20 max-w-[190px] ml-10 -mt-10"
:src="creator.images.logo ? creator.images.logo : '/images/placeholders/logo.png'"
:src="brandingStore.value.images.logo ? brandingStore.value.images.logo : '/images/placeholders/logo.png'"
alt="Profile Picture"
:style="{ borderColor: creator.colors.secondary, height: '190px'}"
:style="{ borderColor: brandingStore.value.colors.secondary, height: '190px'}"
/>
</div>
<div class="ml-64 text-white w-25 min-w-60">
<p class="capitalize text-2xl mt-1">{{ creator.name }}</p>
<p class="capitalize text-2xl mt-1">{{ brandingStore.value.name }}</p>
<p class="capitalize text-2xl mt-1">{{ brandingStore.value.name }}</p>
<div class="text-xs">
105 Followers - {{ creator.subscriberCount }} {{ $t('banner.subscription') }}
105 Followers - {{ brandingStore.value.subscriberCount }} {{ $t('banner.subscription') }}
</div>
</div>
</div>
@@ -50,29 +50,23 @@
</div>
<!-- Follow and Subscribe Buttons -->
<div class="flex flex-row space-x-1 justify-center mt-3 mb-2">
<follow-button
:creator="creator"
:background-color="creator.colors.secondary">
</follow-button>
<subscribe-button
:creator="creator"
:background-color="creator.colors.secondary">
</subscribe-button>
<follow-button></follow-button>
<subscribe-button></subscribe-button>
</div>
</div>
</div>
<div class="absolute bottom-6 right-24 z-30 shadow-2xl rounded-md text-white"
:style="{ backgroundColor: creator.colors.background}">
:style="{ backgroundColor: brandingStore.value.colors.background}">
<div class="w-96 h-28 flex flex-col">
<!-- Section 3 et 4 - Prend 2/3 de la hauteur -->
<div class="flex flex-row flex-grow-[2] min-h-20">
<div class="rounded-tl-md w-1/2 flex items-center justify-center"
:style="{ backgroundColor: creator.colors.primary, opacity: 0.20 }">
:style="{ backgroundColor: brandingStore.value.colors.primary, opacity: 0.20 }">
</div>
<div class="rounded-tr-md w-1/2 bg-cyan-100 flex items-center justify-center text-xl"
:style="{ backgroundColor: creator.colors.secondary}">
:style="{ backgroundColor: brandingStore.value.colors.secondary}">
<div class="absolute left-1">
<div class="flex flex-row items-center justify-center space-x-5">
<div class="flex flex-row items-center">
@@ -87,11 +81,11 @@
<div class="flex flex-col items-center space-y-2">
<v-btn
:style="{ backgroundColor: creator.colors.secondary, fontSize: '20px', height: '30px', width: '30px', padding: '0', minWidth: '25px', minHeight: '25px' }"
:style="{ backgroundColor: brandingStore.value.colors.secondary, fontSize: '20px', height: '30px', width: '30px', padding: '0', minWidth: '25px', minHeight: '25px' }"
variant="tonal">+
</v-btn>
<v-btn
:style="{ backgroundColor: creator.colors.secondary, fontSize: '20px', height: '30px', width: '30px', padding: '0', minWidth: '25px', minHeight: '25px' }"
:style="{ backgroundColor: brandingStore.value.colors.secondary, fontSize: '20px', height: '30px', width: '30px', padding: '0', minWidth: '25px', minHeight: '25px' }"
variant="tonal">-
</v-btn>
</div>
@@ -108,7 +102,7 @@
</div>
<div class="flex-grow bg-gray-300 flex items-center justify-center rounded-b-md"
:style="{ backgroundColor: creator.colors.secondary, opacity: 0.80 }">
:style="{ backgroundColor: brandingStore.value.colors.secondary, opacity: 0.80 }">
<textarea
rows="1"
@@ -126,18 +120,18 @@
</div>
<div class="rounded-b-2xl h-12 px-36 flex flex-col items-center justify-center"
:style="{ backgroundColor: creator.colors.secondary, boxShadow: '0 5px 20px rgba(0, 0, 0, 0.3)' }">
:style="{ backgroundColor: brandingStore.value.colors.secondary, boxShadow: '0 5px 20px rgba(0, 0, 0, 0.3)' }">
<div class="flex justify-evenly w-full">
<RouterLink class="nav-button"
:to="`/@${creator.name}`">
:to="`/@${brandingStore.value.name}`">
Présentation
</RouterLink>
<RouterLink class="nav-button text-white hover:bg-gray-700"
:to="`/@${creator.name}/news`">
:to="`/@${brandingStore.value.name}/news`">
Actualité
</RouterLink>
<RouterLink class="nav-button text-white hover:bg-gray-700"
:to="`/@${creator.name}/content`">
:to="`/@${brandingStore.value.name}/content`">
Exclusivité
</RouterLink>
</div>
@@ -161,69 +155,66 @@
import {ref, onMounted} from 'vue';
import SubscribeButton from "@/views/creators/SubscribeButton.vue";
import FollowButton from "@/views/creators/FollowButton.vue";
import {useBrandingStore} from "@/stores/brandingStore.js";
const brandingStore = useBrandingStore()
function GetSocialsUrls() {
const socials = [];
if (props.creator.socials.facebookUrl !== null) {
if (brandingStore.value.socials.facebookUrl !== null) {
socials.push({
icon: "mdi-facebook",
url: props.creator.socials.facebookUrl
url: brandingStore.value.socials.facebookUrl
})
}
if (props.creator.socials.instagramUrl !== null) {
if (brandingStore.value.socials.instagramUrl !== null) {
socials.push({
icon: "mdi-instagram",
url: props.creator.socials.instagramUrl
url: brandingStore.value.socials.instagramUrl
})
}
if (props.creator.socials.xUrl !== null) {
if (brandingStore.value.socials.xUrl !== null) {
socials.push({
icon: "mdi-twitter",
url: props.creator.socials.xUrl
url: brandingStore.value.socials.xUrl
})
}
if (props.creator.socials.linkedInUrl !== null) {
if (brandingStore.value.socials.linkedInUrl !== null) {
socials.push({
icon: 'mdi-linkedin',
url: props.creator.socials.linkedInUrl
url: brandingStore.value.socials.linkedInUrl
})
}
if (props.creator.socials.tikTokUrl !== null) {
if (brandingStore.value.socials.tikTokUrl !== null) {
socials.push({
icon: '/images/socials/tiktok-white.png',
url: props.creator.socials.tikTokUrl
url: brandingStore.value.socials.tikTokUrl
})
}
if (props.creator.socials.youtubeUrl !== null) {
if (brandingStore.value.socials.youtubeUrl !== null) {
socials.push({
icon: 'mdi-youtube',
url: props.creator.socials.youtubeUrl
url: brandingStore.value.socials.youtubeUrl
})
}
if (props.creator.socials.redditUrl !== null) {
if (brandingStore.value.socials.redditUrl !== null) {
socials.push({
icon: 'mdi-reddit',
url: props.creator.socials.redditUrl
url: brandingStore.value.socials.redditUrl
})
}
if (props.creator.socials.websiteUrl !== null) {
if (brandingStore.value.socials.websiteUrl !== null) {
socials.push({
icon: 'mdi-web',
url: props.creator.socials.websiteUrl
url: brandingStore.value.socials.websiteUrl
})
}
return socials;
}
const props = defineProps({
creator: {type: Object, required: true}
});
// Calculer si l'utilisateur est abonné
const isSticky = ref(false);
const mainContainer = ref(null);