From 53d4e44f5364a7388fb03f7a87fb49f3f3ff6013 Mon Sep 17 00:00:00 2001 From: Kelvin Oghenerhoro Omereshone Date: Mon, 23 Sep 2024 01:21:57 +0100 Subject: [PATCH] feat(mellow-svelte): add login page --- .../assets/js/pages/auth/login.svelte | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/templates/mellow-svelte/assets/js/pages/auth/login.svelte b/templates/mellow-svelte/assets/js/pages/auth/login.svelte index f04c442..5aa837b 100644 --- a/templates/mellow-svelte/assets/js/pages/auth/login.svelte +++ b/templates/mellow-svelte/assets/js/pages/auth/login.svelte @@ -12,12 +12,14 @@ rememberMe: false }) - $: disableLoginButton = () => { - if (!$form.email) return true - if (!$form.password) return true - if ($form.processing) return true + const isLoginButtonDisabled = (form) => { + if (!form.email) return true + if (!form.password) return true + if (form.processing) return true return false } + + $: disableLoginButton = isLoginButtonDisabled($form) @@ -53,11 +55,11 @@

Log into your account

Welcome back, please enter your details

- {#if $form.errors?.email || $form.errors?.login} + {#if $form.errors.email || $form.errors.login}

- {$form.errors?.login || $form.errors?.email} + {$form.errors.login || $form.errors.email}

{/if}