Renames StoredDataUrls to Images

This commit is contained in:
Jonathan Bourdon
2024-08-06 01:04:09 -04:00
parent cb25586d9a
commit a745fcbcc9
5 changed files with 12 additions and 12 deletions

View File

@@ -37,7 +37,7 @@ const props = defineProps({
const emits = defineEmits(['closeRequested']) const emits = defineEmits(['closeRequested'])
const selectedFile = ref("") const selectedFile = ref("")
const fileUrl = ref(props.creator.storedDataUrls.bannerPictureUrl) const fileUrl = ref(props.creator.images.banner)
const onFileSelected = () => { const onFileSelected = () => {
if (selectedFile.value) { if (selectedFile.value) {
@@ -61,7 +61,7 @@ const publish = async () => {
`/api/creators/${props.creator.id}/banner`, `/api/creators/${props.creator.id}/banner`,
formData) formData)
props.creator.storedDataUrls.bannerPictureUrl = fileUrl props.creator.images.banner = fileUrl
emits('closeRequested') emits('closeRequested')
} catch (error) { } catch (error) {
console.error(error) console.error(error)

View File

@@ -37,7 +37,7 @@ const props = defineProps({
const emits = defineEmits(['closeRequested']) const emits = defineEmits(['closeRequested'])
const selectedFile = ref("") const selectedFile = ref("")
const fileUrl = ref(props.creator.storedDataUrls.profilePictureUrl) const fileUrl = ref(props.creator.images.logo)
const onFileSelected = () => { const onFileSelected = () => {
if (selectedFile.value) { if (selectedFile.value) {
@@ -61,7 +61,7 @@ const publish = async () => {
`/api/creators/${props.creator.id}/logo`, `/api/creators/${props.creator.id}/logo`,
formData) formData)
props.creator.storedDataUrls.profilePictureUrl = fileUrl props.creator.images.logoUrl = fileUrl
emits('closeRequested') emits('closeRequested')
} catch (error) { } catch (error) {
console.error(error) console.error(error)

View File

@@ -69,7 +69,7 @@ const closeDialog = () => {
<button> <button>
<img <img
@click="openDialog('BannerPicker')" @click="openDialog('BannerPicker')"
:src="userStore.creator.storedDataUrls.bannerPictureUrl" :src="userStore.creator.images.banner"
class="w-full transition duration-200 ease-in-out transform hover:brightness-125" class="w-full transition duration-200 ease-in-out transform hover:brightness-125"
alt="Tutorial Banner" alt="Tutorial Banner"
> >
@@ -85,7 +85,7 @@ const closeDialog = () => {
<img <img
@click="openDialog('LogoPicker')" @click="openDialog('LogoPicker')"
class="custom-border hover:brightness-125 active:bg-gray-600 shadow flex items-center transition duration-200 ease-in-out w-48 h-48 rounded-full" class="custom-border hover:brightness-125 active:bg-gray-600 shadow flex items-center transition duration-200 ease-in-out w-48 h-48 rounded-full"
:src="userStore.creator.storedDataUrls.profilePictureUrl" :src="userStore.creator.images.logo"
alt="Profile Image" alt="Profile Image"
> >
</button> </button>

View File

@@ -26,7 +26,7 @@
<!--Banner--> <!--Banner-->
<div> <div>
<img class=" w-full drop-shadow-[0_15px_10px_rgba(0,0,0,0.7)]" <img class=" w-full drop-shadow-[0_15px_10px_rgba(0,0,0,0.7)]"
:src="creator.storedDataUrls.bannerPictureUrl || '/images/hutopymedia/banners/tutorialbanner.png'" :src="creator.images.banner"
alt="Profile Banner" style="max-height: 425px"> alt="Profile Banner" style="max-height: 425px">
</div> </div>
</div> </div>
@@ -43,7 +43,7 @@
<div class="absolute lg:ml-72 transform -translate-y-1/2 lg:-translate-y-1/2 z-20"> <div class="absolute lg:ml-72 transform -translate-y-1/2 lg:-translate-y-1/2 z-20">
<img <img
class="rounded-full border-solid border-2 z-20 lg:max-w-[200px] max-w-[200px] h-auto" class="rounded-full border-solid border-2 z-20 lg:max-w-[200px] max-w-[200px] h-auto"
:src="creator.storedDataUrls.profilePictureUrl" :src="creator.images.logo"
alt="Profile Picture" alt="Profile Picture"
:style="{ borderColor: creator.profileColors.accent || '#A30E79', height: '150px' /* Adjust the height here */ }" :style="{ borderColor: creator.profileColors.accent || '#A30E79', height: '150px' /* Adjust the height here */ }"
/> />

View File

@@ -50,7 +50,7 @@
<div class="flex justify-center text-2xl ">Photo de profil</div> <div class="flex justify-center text-2xl ">Photo de profil</div>
</div> </div>
<div class="flex justify-center py-4"> <div class="flex justify-center py-4">
<img :src="profilePictureUrl" <img :src="logoImageUrl"
:style="{ borderColor: user.profileColors.accent || '#23393B' , borderWidth: '3px', borderStyle: 'solid' }" :style="{ borderColor: user.profileColors.accent || '#23393B' , borderWidth: '3px', borderStyle: 'solid' }"
class="rounded-full max-w-48 max-w-48" class="rounded-full max-w-48 max-w-48"
@error="handleProfileImageError" @error="handleProfileImageError"
@@ -95,8 +95,8 @@ const props = defineProps({
user: {} user: {}
}); });
const bannerImageUrl = ref(props.user.storedDataUrls.bannerPictureUrl); const bannerImageUrl = ref(props.user.images.banner);
const profilePictureUrl = ref(props.user.storedDataUrls.profilePictureUrl); const logoImageUrl = ref(props.user.images.logo);
const bannerImage = ref(null); const bannerImage = ref(null);
const profilePicture = ref(null); const profilePicture = ref(null);
@@ -130,7 +130,7 @@ const onProfileFileChange = (event) => {
if (file) { if (file) {
const reader = new FileReader(); const reader = new FileReader();
reader.onload = (e) => { reader.onload = (e) => {
profilePictureUrl.value = e.target.result; logoImageUrl.value = e.target.result;
}; };
reader.readAsDataURL(file); reader.readAsDataURL(file);
emit('updateProfilePicture', file); emit('updateProfilePicture', file);