diff --git a/src/routes/login/+page.svelte b/src/routes/login/+page.svelte index d2b3cf78..067b784f 100644 --- a/src/routes/login/+page.svelte +++ b/src/routes/login/+page.svelte @@ -2,6 +2,7 @@ import { goto } from '$app/navigation' import { setUser } from '$lib/auth.js' import Button from '$lib/components/input/Button.svelte' + import Link from '$lib/components/input/Link.svelte' import TextInput from '$lib/components/input/TextInput.svelte' import Card from '$lib/components/ui/Card.svelte' import { toast } from '$lib/components/ui/toasts/toasts.js' @@ -118,5 +119,9 @@ > Log in +
+

+ Don't have an account? Sign up +

diff --git a/src/routes/signup/+page.svelte b/src/routes/signup/+page.svelte new file mode 100644 index 00000000..f91f7134 --- /dev/null +++ b/src/routes/signup/+page.svelte @@ -0,0 +1,58 @@ + + + + Sign up | Choose Instance + + +
+

Sign Up

+

Choose an instance

+
{ + if (instance != '') { + validating = true + + if (await validateInstance(instance.trim())) { + goto(`/signup/${instance}`) + } else { + toast({ + content: 'Could not contact that instance URL', + type: 'error', + }) + } + + validating = false + } + }} + > + { + instance = instance.toLowerCase().replaceAll(' ', '') + }} + /> + + +
diff --git a/src/routes/signup/+page.ts b/src/routes/signup/+page.ts new file mode 100644 index 00000000..f5902515 --- /dev/null +++ b/src/routes/signup/+page.ts @@ -0,0 +1,8 @@ +import { LINKED_INSTANCE_URL } from "$lib/instance.js"; +import { redirect } from "@sveltejs/kit"; + +export const load = () => { + if (LINKED_INSTANCE_URL) { + throw redirect(300, `/signup/${LINKED_INSTANCE_URL}`) + } +} \ No newline at end of file diff --git a/src/routes/signup/[instance]/+page.svelte b/src/routes/signup/[instance]/+page.svelte new file mode 100644 index 00000000..7779b3dd --- /dev/null +++ b/src/routes/signup/[instance]/+page.svelte @@ -0,0 +1,189 @@ + + + + Sign up + + +
+ + {#if data.site_view.site.icon} + + {/if} + {data.site_view.site.name} + + +

Create account

+ {#if data.site_view.local_site.registration_mode == 'Closed'} +

Registrations are closed for this instance.

+ {:else} + + + + + {#if data.site_view.local_site.registration_mode == 'RequireApplication'} + + + To join this instance, you need to fill out this application, and wait to + be accepted. + + {#if data.site_view.local_site.application_question} + + {/if} +