Skip to content

Commit

Permalink
feat(mellow-svelte): add login page
Browse files Browse the repository at this point in the history
  • Loading branch information
DominusKelvin committed Sep 23, 2024
1 parent 57c9c88 commit 53d4e44
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions templates/mellow-svelte/assets/js/pages/auth/login.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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)
</script>

<svelte:head>
Expand Down Expand Up @@ -53,11 +55,11 @@
</Link>
<h1 class="text-2xl">Log into your account</h1>
<p class="text-lg text-gray">Welcome back, please enter your details</p>
{#if $form.errors?.email || $form.errors?.login}
{#if $form.errors.email || $form.errors.login}
<p
class="my-4 w-full rounded-sm border-red-400 bg-red-100 p-4 text-red-500"
>
{$form.errors?.login || $form.errors?.email}
{$form.errors.login || $form.errors.email}
</p>
{/if}
</section>
Expand Down

0 comments on commit 53d4e44

Please sign in to comment.