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

@@ -72,13 +72,7 @@
{{ messageCount }}
</v-btn>
<donation-button :color-border="colorMenu"
:color-accent="colorAccent"
:creator-id="creatorId"
:creator-name="creatorName"
:creator-logo="creatorLogo"
iconColorClass="text-black"
></donation-button>
<donation-button></donation-button>
</div>

View File

@@ -1,8 +1,9 @@
<script setup>
import {useClient} from '@/plugins/api.js';
import {ref} from 'vue';
import {useUserStore} from '@/stores/userStore.js';
import {v7} from 'uuid';
import {useCreatorProfileStore} from "@/stores/creatorProfileStore.js";
import {useUserProfileStore} from "@/stores/userProfileStore.js";
const props = defineProps({
creator: {type: Object, required: true},
@@ -10,7 +11,8 @@ const props = defineProps({
const emits = defineEmits(['content-posted'])
const userStore = useUserStore();
const userProfileStore = useUserProfileStore()
const creatorProfileStore = useCreatorProfileStore()
const isDialogActive = ref(false);
@@ -31,7 +33,7 @@ const removeUrl = (index) => {
async function publishPost() {
const formData = new FormData();
formData.append('id', v7());
formData.append('creatorId', userStore.user.id);
formData.append('creatorId', creatorProfileStore.value.id);
formData.append('title', title.value);
formData.append('description', message.value);
files.value.forEach(file => {
@@ -73,7 +75,7 @@ const closeDialog = () => {
<template>
<button
v-if="creator && userStore.user && creator.id === userStore.user.id"
v-if="creator && userProfileStore.value && creator.id === userProfileStore.value.id"
class="flex items-center text-white transform transition-transform duration-200 hover:text-gray-300 hover:scale-125 px-4"
@click="isDialogActive = true">
<v-icon style="font-size: 35px; height: 35px; width: 55px;">mdi-text-box-plus-outline</v-icon>

View File

@@ -1,12 +1,12 @@
<script setup>
import { useUserStore } from "@/stores/userStore.js";
import { REACTIONS } from "@/Constants/Reactions.js";
import { computed, ref } from "vue";
import { useClient } from "@/plugins/api.js";
import {useAuthStore} from "@/stores/authStore.js"
import MustBeLogged from "@/views/MustBeLogged.vue";
import {useUserProfileStore} from "@/stores/userProfileStore.js";
const userStore = useUserStore();
const userProfileStore = useUserProfileStore();
const authStore = useAuthStore()
const props = defineProps({
@@ -49,8 +49,8 @@ async function reactToContent(reaction) {
const request = {
ContentId: contentId.value,
reaction: reaction,
userId: userStore.user.id,
userName: `${userStore.user.firstName} ${userStore.user.lastName}`,
userId: userProfileStore.value.id,
userName: `${userProfileStore.value.firstName} ${userProfileStore.value.lastName}`,
};
adjustReactionCount(reaction);
await client.post("/api/content/reaction/", request);
@@ -61,8 +61,8 @@ async function reactToContent(reaction) {
const requestAdd = {
ContentId: contentId.value,
reaction: reaction,
userId: userStore.user.id,
userName: `${userStore.user.firstName} ${userStore.user.lastName}`,
userId: userProfileStore.value.id,
userName: `${userProfileStore.value.firstName} ${userProfileStore.value.lastName}`,
};
adjustReactionCount(reaction);
await client.post("/api/content/reaction/", requestAdd);
@@ -71,7 +71,7 @@ async function reactToContent(reaction) {
} else {
const requestRemove = {
ContentId: contentId.value,
userId: userStore.user.id,
userId: userProfileStore.value.id,
};
adjustReactionCount(reaction);
await client.post("/api/content/reaction/remove", requestRemove);
@@ -168,7 +168,7 @@ function adjustReactionCount(newReaction) {
}
function initializeReactions() {
const userReaction = props.content.reactions.find((x) => x.userId === userStore.user.id);
const userReaction = props.content.reactions.find((x) => x.userId === userProfileStore.value.id);
if (userReaction) {
currentReaction.value = userReaction.reaction;
hasReacted.value = true;

View File

@@ -72,13 +72,7 @@
{{ messageCount }}
</v-btn>
<donation-button :color-border="colorMenu"
:color-accent="colorAccent"
:creator-id="creatorId"
:creator-name="creatorName"
:creator-logo="creatorLogo"
iconColorClass="text-black"
></donation-button>
<donation-button></donation-button>
</div>

View File

@@ -72,13 +72,7 @@
{{ messageCount }}
</v-btn>
<donation-button :color-border="colorMenu"
:color-accent="colorAccent"
:creator-id="creatorId"
:creator-name="creatorName"
:creator-logo="creatorLogo"
iconColorClass="text-black"
></donation-button>
<donation-button></donation-button>
</div>

View File

@@ -53,14 +53,7 @@
<div class="flex justify-around py-2">
<Reaction v-if="data" :content="data"></Reaction>
<donation-button v-if="data"
:color-border="data.colorMenu"
:color-accent="data.colorAccent"
:creator-id="data.createdBy"
:creator-name="data.createdByName"
:creator-logo="data.createdByPortraitUrl"
iconColorClass="text-black"
></donation-button>
<donation-button v-if="data"></donation-button>
</div>
</div>

View File

@@ -57,12 +57,6 @@
<Reaction v-if="data" :content="data"></Reaction>
<donation-button v-if="data"
:color-border="data.colorMenu"
:color-accent="data.colorAccent"
:creator-id="data.createdBy"
:creator-name="data.createdByName"
:creator-logo="data.createdByPortraitUrl"
iconColorClass="text-black"
></donation-button>
</div>