flotilla/src/app/components/SignUpProfile.svelte

37 lines
1.1 KiB
Svelte
Raw Normal View History

2025-02-14 18:53:36 +00:00
<script lang="ts">
import type {Profile} from "@welshman/util"
2025-08-18 22:02:17 +00:00
import {makeProfile} from "@welshman/util"
import Icon from "@lib/components/Icon.svelte"
2025-02-14 18:53:36 +00:00
import Button from "@lib/components/Button.svelte"
2025-08-18 22:02:17 +00:00
import ModalFooter from "@lib/components/ModalFooter.svelte"
2025-02-14 18:53:36 +00:00
import ProfileEditForm from "@app/components/ProfileEditForm.svelte"
2025-08-18 22:02:17 +00:00
import SignUpKey from "@app/components/SignUpKey.svelte"
import {pushModal} from "@app/modal"
2025-02-14 18:53:36 +00:00
2025-04-15 16:36:39 +00:00
const initialValues = {
profile: makeProfile(),
2025-08-18 22:02:17 +00:00
shouldBroadcast: false,
2025-04-15 16:36:39 +00:00
}
2025-08-18 22:02:17 +00:00
const back = () => history.back()
2025-02-14 18:53:36 +00:00
2025-08-18 22:02:17 +00:00
const onsubmit = (values: {profile: Profile}) => pushModal(SignUpKey, values)
2025-02-14 18:53:36 +00:00
</script>
2025-08-18 22:02:17 +00:00
<div class="flex flex-col gap-4">
<ProfileEditForm isSignup {initialValues} {onsubmit}>
{#snippet footer()}
<ModalFooter>
<Button class="btn btn-link" onclick={back}>
<Icon icon="alt-arrow-left" />
Go back
</Button>
<Button class="btn btn-primary" type="submit">
Create Account
<Icon icon="alt-arrow-right" />
</Button>
</ModalFooter>
{/snippet}
</ProfileEditForm>
</div>