Skip to content

Commit 659e4bd

Browse files
PavelLaptevestib-vega
authored andcommitted
Unify message placement in auth-related forms
1 parent aad2146 commit 659e4bd

File tree

5 files changed

+60
-60
lines changed

5 files changed

+60
-60
lines changed

apps/web/src/routes/(app)/auth/+page.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script lang="ts">
22
import { AUTH_SERVICE } from '$lib/auth/authService.svelte';
33
import { inject } from '@gitbutler/core/context';
4-
// import { goto } from '$app/navigation';
54
import { env } from '$env/dynamic/public';
65
76
const authService = inject(AUTH_SERVICE);

apps/web/src/routes/(app)/login/+page.svelte

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -95,35 +95,35 @@
9595
</div>
9696
</div>
9797

98+
{#if confirmationSent}
99+
<InfoMessage filled outlined={false} style="success" class="m-bottom-16">
100+
{#snippet content()}
101+
<p>Confirmation email sent! Please check your inbox.</p>
102+
{/snippet}
103+
</InfoMessage>
104+
{:else if error}
105+
<InfoMessage filled outlined={false} style="error" class="m-bottom-16">
106+
{#snippet content()}
107+
{#if errorCode === 'email_not_verified'}
108+
<p>
109+
Verify your email before logging in. Check your inbox or <button
110+
type="button"
111+
class="resend-confirm-btn"
112+
onclick={resendConfirmationEmail}
113+
disabled={!email}
114+
>
115+
resend the confirmation email</button
116+
>.
117+
</p>
118+
{:else}
119+
<p>{error}</p>
120+
{/if}
121+
{/snippet}
122+
</InfoMessage>
123+
{/if}
124+
98125
<Button type="submit" style="pop" disabled={!isFormValid}>Log in</Button>
99126
</form>
100-
101-
{#if confirmationSent}
102-
<InfoMessage filled outlined={false} style="success" class="m-top-16">
103-
{#snippet content()}
104-
<p>Confirmation email sent! Please check your inbox.</p>
105-
{/snippet}
106-
</InfoMessage>
107-
{:else if error}
108-
<InfoMessage filled outlined={false} style="error" class="m-top-16">
109-
{#snippet content()}
110-
{#if errorCode === 'email_not_verified'}
111-
<p>
112-
Verify your email before logging in. Check your inbox or <button
113-
type="button"
114-
class="resend-confirm-btn"
115-
onclick={resendConfirmationEmail}
116-
disabled={!email}
117-
>
118-
resend the confirmation email</button
119-
>.
120-
</p>
121-
{:else}
122-
<p>{error}</p>
123-
{/if}
124-
{/snippet}
125-
</InfoMessage>
126-
{/if}
127127
</AuthPageLayout>
128128

129129
<style lang="postcss">

apps/web/src/routes/(app)/login/forgot-password/+page.svelte

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,17 @@
4646
{:else}
4747
<div class="service-form__inputs">
4848
<EmailTextbox bind:value={email} label="Email" />
49+
50+
{#if error}
51+
<InfoMessage filled outlined={false} style="error">
52+
{#snippet content()}
53+
{error}
54+
{/snippet}
55+
</InfoMessage>
56+
{/if}
57+
4958
<Button style="pop" type="submit" onclick={handleSubmit}>Send a reset link</Button>
5059
</div>
51-
52-
{#if error}
53-
<InfoMessage filled outlined={false} style="error" class="m-top-16">
54-
{#snippet content()}
55-
{error}
56-
{/snippet}
57-
</InfoMessage>
58-
{/if}
5960
{/if}
6061
</AuthUtilityLayout>
6162

apps/web/src/routes/(app)/profile/finalize/+page.svelte

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@
6464
await userService.refreshUser();
6565
}
6666
67-
$effect(() => {
68-
if (!isLoggedIn) {
69-
goto(routesService.loginPath());
70-
} else if (isFinalized) {
71-
goto(routesService.homePath());
72-
}
73-
});
67+
// $effect(() => {
68+
// if (!isLoggedIn) {
69+
// goto(routesService.loginPath());
70+
// } else if (isFinalized) {
71+
// goto(routesService.homePath());
72+
// }
73+
// });
7474
</script>
7575

7676
<svelte:head>
77-
<title>GitButler | Login</title>
77+
<title>GitButler | Finalize Account</title>
7878
</svelte:head>
7979

8080
<form onsubmit={handleSubmit} class="finalize-form">

apps/web/src/routes/(app)/signup/+page.svelte

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,24 @@
8282
<PasswordConfirmation bind:this={passwordComponent} bind:password bind:passwordConfirmation />
8383
</div>
8484

85-
<Button type="submit" style="pop" disabled={!isFormValid}>Create account</Button>
86-
</form>
85+
{#if error}
86+
<InfoMessage filled outlined={false} style="error" class="m-bottom-16">
87+
{#snippet content()}
88+
{error}
89+
{/snippet}
90+
</InfoMessage>
91+
{/if}
8792

88-
{#if error}
89-
<InfoMessage filled outlined={false} style="error" class="m-top-16">
90-
{#snippet content()}
91-
{error}
92-
{/snippet}
93-
</InfoMessage>
94-
{/if}
93+
{#if message}
94+
<InfoMessage filled outlined={false} style="success" class="m-bottom-16">
95+
{#snippet content()}
96+
{message}
97+
{/snippet}
98+
</InfoMessage>
99+
{/if}
95100

96-
{#if message}
97-
<InfoMessage filled outlined={false} style="success" class="m-top-16">
98-
{#snippet content()}
99-
{message}
100-
{/snippet}
101-
</InfoMessage>
102-
{/if}
101+
<Button type="submit" style="pop" disabled={!isFormValid}>Create account</Button>
102+
</form>
103103
</AuthPageLayout>
104104

105105
<style lang="postcss">

0 commit comments

Comments
 (0)