flotilla/src/app/components/SignUp.svelte

43 lines
1.5 KiB
Svelte
Raw Normal View History

2024-08-16 22:17:30 +00:00
<script lang="ts">
2025-09-10 22:26:39 +00:00
import Key from "@assets/icons/key-minimalistic.svg?dataurl"
2025-12-18 02:43:13 +00:00
import Letter from "@assets/icons/letter.svg?dataurl"
2024-08-16 22:17:30 +00:00
import Icon from "@lib/components/Icon.svelte"
import Button from "@lib/components/Button.svelte"
import LogIn from "@app/components/LogIn.svelte"
import InfoNostr from "@app/components/InfoNostr.svelte"
2025-08-18 22:02:17 +00:00
import SignUpProfile from "@app/components/SignUpProfile.svelte"
import {pushModal} from "@app/util/modal"
2025-12-18 02:43:13 +00:00
import {POMADE_SIGNERS, PLATFORM_NAME} from "@app/core/state"
2024-12-03 00:21:54 +00:00
2025-12-18 02:43:13 +00:00
const hasPomade = POMADE_SIGNERS.length >= 3
2024-12-03 00:21:54 +00:00
2025-12-18 02:43:13 +00:00
const login = () => pushModal(LogIn)
2024-08-16 22:17:30 +00:00
2025-12-18 02:43:13 +00:00
const useEmail = () => pushModal(SignUpProfile, {flow: "email"})
2025-02-14 18:53:36 +00:00
2025-12-18 02:43:13 +00:00
const useNostr = () => pushModal(SignUpProfile, {flow: "nostr"})
2024-08-16 22:17:30 +00:00
</script>
2025-12-18 02:43:13 +00:00
<div class="column gap-4">
2024-08-16 22:17:30 +00:00
<h1 class="heading">Sign up with Nostr</h1>
<p class="m-auto max-w-sm text-center">
2024-10-22 18:04:40 +00:00
{PLATFORM_NAME} is built using the
2025-08-18 22:02:17 +00:00
<Button class="link" onclick={() => pushModal(InfoNostr)}>nostr protocol</Button>, which gives
users control over their digital identity using <strong>cryptographic key pairs</strong>.
2024-08-16 22:17:30 +00:00
</p>
2025-12-18 02:43:13 +00:00
{#if hasPomade}
<Button onclick={useEmail} class="btn btn-primary">
<Icon icon={Letter} />
Sign up with email
2024-11-27 00:39:49 +00:00
</Button>
{/if}
2025-12-18 02:43:13 +00:00
<Button onclick={useNostr} class="btn {hasPomade ? 'btn-neutral' : 'btn-primary'}">
2025-09-10 22:26:39 +00:00
<Icon icon={Key} />
2025-08-18 22:02:17 +00:00
Generate a key
</Button>
<div class="text-sm">
Already have an account?
<Button class="link" onclick={login}>Log in instead</Button>
2024-08-16 22:17:30 +00:00
</div>
2025-12-18 02:43:13 +00:00
</div>