refactor(auth): cleanup auth module and streamline the registration flow
This commit is contained in:
@@ -1,72 +1,166 @@
|
||||
<script async setup>
|
||||
import {useBrandingStore} from "@/stores/brandingStore.js";
|
||||
import {onMounted} from "vue";
|
||||
import Footer from "@/views/main/Footer.vue";
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import ActualBanner from "@/views/creators/ActualBanner.vue";
|
||||
import BannerActions from "@/views/creators/BannerActions.vue";
|
||||
import { useBrandingStore } from '@/stores/brandingStore.js';
|
||||
import { onMounted } from 'vue';
|
||||
import Footer from '@/views/main/Footer.vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import ActualBanner from '@/views/creators/ActualBanner.vue';
|
||||
import BannerActions from '@/views/creators/BannerActions.vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const brandingStore = useBrandingStore();
|
||||
const creatorName = window.location.pathname.split('/@')[1]?.split('/')[0] || '';
|
||||
const { t } = useI18n();
|
||||
const brandingStore = useBrandingStore();
|
||||
const creatorName = window.location.pathname.split('/@')[1]?.split('/')[0] || '';
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
|
||||
onMounted(async () => {
|
||||
await brandingStore.updateBrand(creatorName);
|
||||
});
|
||||
onMounted(async () => {
|
||||
await brandingStore.updateBrand(creatorName);
|
||||
});
|
||||
|
||||
const goHome = () => {
|
||||
router.push('/landing');
|
||||
};
|
||||
|
||||
const goBack = () => {
|
||||
router.go(-1);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="min-h-screen max-w-[1024px] bg-hSurface text-hOnSurface">
|
||||
<div v-if="brandingStore.loading">
|
||||
<v-progress-linear indeterminate></v-progress-linear>
|
||||
</div>
|
||||
|
||||
<div class="min-h-screen max-w-[1024px] bg-hSurface text-hOnSurface">
|
||||
<!-- 404 Error State -->
|
||||
<div
|
||||
v-else-if="brandingStore.notFound"
|
||||
class="flex flex-col items-center justify-center min-h-screen p-8"
|
||||
>
|
||||
<div class="text-center max-w-md">
|
||||
<div class="text-6xl font-bold text-gray-400 mb-4">404</div>
|
||||
<h1 class="text-2xl font-semibold mb-4">{{ t('creator.notFound.title') }}</h1>
|
||||
<p class="text-gray-600 mb-8">{{ t('creator.notFound.message', { creator: creatorName }) }}</p>
|
||||
|
||||
<div v-if="brandingStore.loading">
|
||||
<v-progress-linear indeterminate></v-progress-linear>
|
||||
<div class="space-y-4">
|
||||
<v-btn
|
||||
class="w-full"
|
||||
color="primary"
|
||||
size="large"
|
||||
@click="goHome"
|
||||
>
|
||||
{{ t('creator.notFound.goHome') }}
|
||||
</v-btn>
|
||||
|
||||
<v-btn
|
||||
class="w-full"
|
||||
size="large"
|
||||
variant="outlined"
|
||||
@click="goBack"
|
||||
>
|
||||
{{ t('creator.notFound.goBack') }}
|
||||
</v-btn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Error State (non-404 errors) -->
|
||||
<div
|
||||
v-else-if="brandingStore.error && !brandingStore.notFound"
|
||||
class="flex flex-col items-center justify-center min-h-screen p-8"
|
||||
>
|
||||
<div class="text-center max-w-md">
|
||||
<div class="text-4xl font-bold text-red-400 mb-4">⚠️</div>
|
||||
<h1 class="text-2xl font-semibold mb-4">{{ t('creator.error.title') }}</h1>
|
||||
<p class="text-gray-600 mb-8">{{ t('creator.error.message') }}</p>
|
||||
|
||||
<v-btn
|
||||
class="w-full"
|
||||
color="primary"
|
||||
size="large"
|
||||
@click="goHome"
|
||||
>
|
||||
{{ t('creator.error.goHome') }}
|
||||
</v-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Success State -->
|
||||
<div v-else>
|
||||
<div
|
||||
v-if="brandingStore.value.isDeleted"
|
||||
class="bg-red-500 p-2 m-4 text-center font-semibold"
|
||||
>
|
||||
{{ t('creator.layout.deletion.pending') }}
|
||||
</div>
|
||||
<actual-banner></actual-banner>
|
||||
<banner-actions></banner-actions>
|
||||
<router-view></router-view>
|
||||
<Footer></Footer>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
|
||||
<div v-if="brandingStore.value.isDeleted"
|
||||
class="bg-red-500 p-2 m-4 text-center font-semibold">
|
||||
{{ t('creator.layout.deletion.pending') }}
|
||||
</div>
|
||||
<actual-banner></actual-banner>
|
||||
<banner-actions></banner-actions>
|
||||
<router-view></router-view>
|
||||
<Footer></Footer>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
{
|
||||
"en": {
|
||||
"creator": {
|
||||
"layout": {
|
||||
"deletion": {
|
||||
"pending": "This creator page is pending deletion"
|
||||
"en": {
|
||||
"creator": {
|
||||
"layout": {
|
||||
"deletion": {
|
||||
"pending": "This creator page is pending deletion"
|
||||
}
|
||||
},
|
||||
"notFound": {
|
||||
"title": "Creator Not Found",
|
||||
"message": "The creator '{creator}' doesn't exist or may have been removed.",
|
||||
"goHome": "Go to Home",
|
||||
"goBack": "Go Back"
|
||||
},
|
||||
"error": {
|
||||
"title": "Something Went Wrong",
|
||||
"message": "We're having trouble loading this creator page. Please try again later.",
|
||||
"goHome": "Go to Home"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"fr": {
|
||||
"creator": {
|
||||
"layout": {
|
||||
"deletion": {
|
||||
"pending": "Cette page créateur est en attente de suppression"
|
||||
},
|
||||
"fr": {
|
||||
"creator": {
|
||||
"layout": {
|
||||
"deletion": {
|
||||
"pending": "Cette page créateur est en attente de suppression"
|
||||
}
|
||||
},
|
||||
"notFound": {
|
||||
"title": "Créateur Introuvable",
|
||||
"message": "Le créateur '{creator}' n'existe pas ou a peut-être été supprimé.",
|
||||
"goHome": "Aller à l'accueil",
|
||||
"goBack": "Retour"
|
||||
},
|
||||
"error": {
|
||||
"title": "Quelque chose s'est mal passé",
|
||||
"message": "Nous avons des difficultés à charger cette page créateur. Veuillez réessayer plus tard.",
|
||||
"goHome": "Aller à l'accueil"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"es": {
|
||||
"creator": {
|
||||
"layout": {
|
||||
"deletion": {
|
||||
"pending": "Esta página de creador está pendiente de eliminación"
|
||||
},
|
||||
"es": {
|
||||
"creator": {
|
||||
"layout": {
|
||||
"deletion": {
|
||||
"pending": "Esta página de creador está pendiente de eliminación"
|
||||
}
|
||||
},
|
||||
"notFound": {
|
||||
"title": "Creador No Encontrado",
|
||||
"message": "El creador '{creator}' no existe o puede haber sido eliminado.",
|
||||
"goHome": "Ir al Inicio",
|
||||
"goBack": "Volver"
|
||||
},
|
||||
"error": {
|
||||
"title": "Algo Salió Mal",
|
||||
"message": "Tenemos problemas para cargar esta página de creador. Por favor, inténtalo de nuevo más tarde.",
|
||||
"goHome": "Ir al Inicio"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</i18n>
|
||||
|
||||
Reference in New Issue
Block a user