Browse Source

refactor(nc-gui): use lazy noco icon

pull/3801/head
braks 2 years ago
parent
commit
54aec728ba
  1. 20
      packages/nc-gui/pages/forgot-password.vue
  2. 5
      packages/nc-gui/pages/signin.vue
  3. 5
      packages/nc-gui/pages/signup/[[token]].vue

20
packages/nc-gui/pages/forgot-password.vue

@ -5,12 +5,10 @@ definePageMeta({
requiresAuth: false, requiresAuth: false,
}) })
const { api, isLoading } = useApi() const { api, isLoading, error } = useApi()
const { t } = useI18n() const { t } = useI18n()
let error = $ref<string | null>(null)
let success = $ref(false) let success = $ref(false)
const formValidator = ref() const formValidator = ref()
@ -41,18 +39,13 @@ async function resetPassword() {
resetError() resetError()
try { await api.auth.passwordForgot(form).then(() => {
await api.auth.passwordForgot(form)
success = true success = true
} catch (e: any) { })
// todo: errors should not expose what was wrong (i.e. do not show "Password is wrong" messages)
error = await extractSdkResponseErrorMsg(e)
}
} }
function resetError() { function resetError() {
if (error) error = null if (error.value) error.value = null
} }
</script> </script>
@ -62,7 +55,10 @@ function resetError() {
<div <div
class="bg-white mt-[60px] relative flex flex-col justify-center gap-2 w-full max-w-[500px] mx-auto p-8 md:(rounded-lg border-1 border-gray-200 shadow-xl)" class="bg-white mt-[60px] relative flex flex-col justify-center gap-2 w-full max-w-[500px] mx-auto p-8 md:(rounded-lg border-1 border-gray-200 shadow-xl)"
> >
<general-noco-icon class="color-transition hover:(ring ring-accent)" :class="[isLoading ? 'animated-bg-gradient' : '']" /> <LazyGeneralNocoIcon
class="color-transition hover:(ring ring-accent)"
:class="[isLoading ? 'animated-bg-gradient' : '']"
/>
<div class="self-center flex flex-col justify-center items-center text-center gap-2"> <div class="self-center flex flex-col justify-center items-center text-center gap-2">
<h1 class="prose-2xl font-bold my-4 w-full">{{ $t('title.resetPassword') }}</h1> <h1 class="prose-2xl font-bold my-4 w-full">{{ $t('title.resetPassword') }}</h1>

5
packages/nc-gui/pages/signin.vue

@ -65,7 +65,10 @@ function resetError() {
<div <div
class="bg-white mt-[60px] relative flex flex-col justify-center gap-2 w-full max-w-[500px] mx-auto p-8 md:(rounded-lg border-1 border-gray-200 shadow-xl)" class="bg-white mt-[60px] relative flex flex-col justify-center gap-2 w-full max-w-[500px] mx-auto p-8 md:(rounded-lg border-1 border-gray-200 shadow-xl)"
> >
<general-noco-icon class="color-transition hover:(ring ring-accent)" :class="[isLoading ? 'animated-bg-gradient' : '']" /> <LazyGeneralNocoIcon
class="color-transition hover:(ring ring-accent)"
:class="[isLoading ? 'animated-bg-gradient' : '']"
/>
<h1 class="prose-2xl font-bold self-center my-4">{{ $t('general.signIn') }}</h1> <h1 class="prose-2xl font-bold self-center my-4">{{ $t('general.signIn') }}</h1>

5
packages/nc-gui/pages/signup/[[token]].vue

@ -85,7 +85,10 @@ function resetError() {
<div <div
class="bg-white mt-[60px] relative flex flex-col justify-center gap-2 w-full max-w-[500px] mx-auto p-8 md:(rounded-lg border-1 border-gray-200 shadow-xl)" class="bg-white mt-[60px] relative flex flex-col justify-center gap-2 w-full max-w-[500px] mx-auto p-8 md:(rounded-lg border-1 border-gray-200 shadow-xl)"
> >
<general-noco-icon class="color-transition hover:(ring ring-accent)" :class="[isLoading ? 'animated-bg-gradient' : '']" /> <LazyGeneralNocoIcon
class="color-transition hover:(ring ring-accent)"
:class="[isLoading ? 'animated-bg-gradient' : '']"
/>
<h1 class="prose-2xl font-bold self-center my-4"> <h1 class="prose-2xl font-bold self-center my-4">
{{ $t('general.signUp') }} {{ $t('general.signUp') }}

Loading…
Cancel
Save