flotilla/src/app/components/SignUpComplete.svelte

70 lines
2 KiB
Svelte
Raw Normal View History

2025-08-18 22:02:17 +00:00
<script lang="ts">
import {preventDefault} from "@lib/html"
2025-09-10 22:26:39 +00:00
import AltArrowLeft from "@assets/icons/alt-arrow-left.svg?dataurl"
import HomeSmile from "@assets/icons/home-smile.svg?dataurl"
2025-08-18 22:02:17 +00:00
import Icon from "@lib/components/Icon.svelte"
import Button from "@lib/components/Button.svelte"
import Spinner from "@lib/components/Spinner.svelte"
2026-01-30 22:14:12 +00:00
import Modal from "@lib/components/Modal.svelte"
import ModalBody from "@lib/components/ModalBody.svelte"
2025-08-18 22:02:17 +00:00
import ModalHeader from "@lib/components/ModalHeader.svelte"
2026-02-02 18:09:14 +00:00
import ModalTitle from "@lib/components/ModalTitle.svelte"
2025-08-18 22:02:17 +00:00
import ModalFooter from "@lib/components/ModalFooter.svelte"
import ProgressBar from "@app/components/ProgressBar.svelte"
2025-08-18 22:02:17 +00:00
type Props = {
2026-01-16 18:06:25 +00:00
next: () => void
step?: number
totalSteps?: number
2025-08-18 22:02:17 +00:00
}
const {next, step, totalSteps}: Props = $props()
2025-08-18 22:02:17 +00:00
const back = () => history.back()
const submit = async () => {
loading = true
try {
await next()
} finally {
loading = false
}
}
let loading = $state(false)
2025-08-18 22:02:17 +00:00
</script>
<Modal tag="form" onsubmit={preventDefault(submit)}>
2026-01-30 22:14:12 +00:00
<ModalBody>
<ModalHeader>
2026-02-02 18:09:14 +00:00
<ModalTitle>You're all set!</ModalTitle>
2026-01-30 22:14:12 +00:00
</ModalHeader>
<p>
You've created your profile, saved your keys, and now you're ready to start chatting — all
without asking permission!
</p>
<p>
From your dashboard, you can use invite links, discover community spaces, and keep up-to-date
2026-07-28 16:16:26 +00:00
on spaces you've already joined. Click below to get started!
2026-01-30 22:14:12 +00:00
</p>
</ModalBody>
{#if step && totalSteps}
<ProgressBar current={step} total={totalSteps} />
{/if}
2025-08-18 22:02:17 +00:00
<ModalFooter>
<Button class="button button-link" onclick={back}>
2025-09-10 22:26:39 +00:00
<Icon icon={AltArrowLeft} />
2025-08-18 22:02:17 +00:00
Go back
</Button>
<Button class="button button-primary" type="submit" disabled={loading}>
{#if loading}
<Spinner {loading}>Go to Dashboard</Spinner>
{:else}
<Icon icon={HomeSmile} />
Go to Dashboard
{/if}
2025-08-18 22:02:17 +00:00
</Button>
</ModalFooter>
2026-01-30 22:14:12 +00:00
</Modal>