Renames SocialNetworks to Socials

This commit is contained in:
Jonathan Bourdon
2024-08-06 00:15:53 -04:00
parent fd1937b56f
commit f4b060dd9d
3 changed files with 62 additions and 63 deletions

View File

@@ -8,7 +8,7 @@
:style="{ backgroundColor: creator.profileColors.bannerTop || '#6B0065' }">
<div class="w-full flex justify-between lg:justify-end gap-14 mt-2">
<a
v-for="socialNetwork in GetActiveSocialNetworkUrls()"
v-for="socialNetwork in GetSocialsUrls()"
:href="socialNetwork.url"
target="_blank"
class="text-white text-2xl transform transition-transform duration-200 hover:scale-125 hover:text-blue-500">
@@ -85,61 +85,60 @@ const props = defineProps({
creator: {type: Object, required: true},
});
function GetActiveSocialNetworkUrls() {
function GetSocialsUrls() {
const socialNetworks = [];
const userSocialNetworks = props.creator.socialNetworks;
const socials = [];
if (userSocialNetworks.facebookUrl !== null) {
socialNetworks.push({
if (props.creator.socials.facebookUrl !== null) {
socials.push({
icon: "mdi-facebook",
url: props.creator.socialNetworks.facebookUrl
url: props.creator.socials.facebookUrl
})
}
if (userSocialNetworks.instagramUrl !== null) {
socialNetworks.push({
if (props.creator.socials.instagramUrl !== null) {
socials.push({
icon: "mdi-instagram",
url: props.creator.socialNetworks.instagramUrl
url: props.creator.socials.instagramUrl
})
}
if (userSocialNetworks.xUrl !== null) {
socialNetworks.push({
if (props.creator.socials.xUrl !== null) {
socials.push({
icon: "mdi-twitter",
url: props.creator.socialNetworks.xUrl
url: props.creator.socials.xUrl
})
}
if (userSocialNetworks.linkedInUrl !== null) {
socialNetworks.push({
if (props.creator.socials.linkedInUrl !== null) {
socials.push({
icon: 'mdi-linkedin',
url: props.creator.socialNetworks.linkedInUrl
url: props.creator.socials.linkedInUrl
})
}
if (userSocialNetworks.tikTokUrl !== null) {
socialNetworks.push({
if (props.creator.socials.tikTokUrl !== null) {
socials.push({
icon: '/images/socials/tiktok-white.png',
url: props.creator.socialNetworks.tikTokUrl
url: props.creator.socials.tikTokUrl
})
}
if (userSocialNetworks.youtubeUrl !== null) {
socialNetworks.push({
if (props.creator.socials.youtubeUrl !== null) {
socials.push({
icon: 'mdi-youtube',
url: props.creator.socialNetworks.youtubeUrl
url: props.creator.socials.youtubeUrl
})
}
if (userSocialNetworks.redditUrl !== null) {
socialNetworks.push({
if (props.creator.socials.redditUrl !== null) {
socials.push({
icon: 'mdi-reddit',
url: props.creator.socialNetworks.redditUrl
url: props.creator.socials.redditUrl
})
}
if (userSocialNetworks.websiteUrl !== null) {
socialNetworks.push({
if (props.creator.socials.websiteUrl !== null) {
socials.push({
icon: 'mdi-web',
url: props.creator.socialNetworks.websiteUrl
url: props.creator.socials.websiteUrl
})
}
return socialNetworks;
return socials;
}
</script>