Pass email prop from verify page to modal to render immediately

This commit is contained in:
Harsh Mahajan
2025-09-22 17:43:35 +05:30
parent efc877b305
commit 3e107fdaa7
2 changed files with 4 additions and 3 deletions
@@ -16,7 +16,7 @@
import { logout } from '$lib/helpers/logout';
import { browser } from '$app/environment';
let { show = $bindable(false) } = $props();
let { show = $bindable(false), email: emailFromParent = null } = $props();
let creating = $state(false);
let emailSent = $state(false);
let resendTimer = $state(0);
@@ -27,6 +27,7 @@
const EMAIL_SENT_KEY = 'email-verification-sent';
let cleanUrl = $derived(page.url.origin + page.url.pathname);
const resolvedEmail = $derived(emailFromParent ?? get(user)?.email);
// Determine if we should show the modal
const hasUser = $derived(!!$user);
@@ -165,7 +166,7 @@
will be sent to <Typography.Text
variant="m-600"
color="neutral-secondary"
style="display: inline;">{get(user)?.email}</Typography.Text>
style="display: inline;">{resolvedEmail}</Typography.Text>
</Typography.Text>
<Layout.Stack class="u-margin-block-start-4">
<Layout.Stack direction="row">
@@ -147,7 +147,7 @@
</div>
<!-- email verification modal -->
<SendVerificationEmailModal bind:show={showVerificationModal} />
<SendVerificationEmailModal bind:show={showVerificationModal} email={data.user?.email} />
</div>
<style lang="scss">