diff --git a/package.json b/package.json index ebe6e406..3322990f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "photon-lemmy", - "version": "0.9.6", + "version": "0.9.7", "private": true, "scripts": { "dev": "vite dev", diff --git a/src/routes/login/+page.svelte b/src/routes/login/+page.svelte index d2b3cf78..14ac6c1b 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' @@ -53,7 +54,7 @@ Login - +

Log in

@@ -118,5 +119,9 @@ > Log in +
+

+ Don't have an account? Sign up +

- +
diff --git a/src/routes/profile/(local_user)/settings/+page.svelte b/src/routes/profile/(local_user)/settings/+page.svelte index 81b42a26..00783b37 100644 --- a/src/routes/profile/(local_user)/settings/+page.svelte +++ b/src/routes/profile/(local_user)/settings/+page.svelte @@ -1,12 +1,14 @@ +{#if deletion.modal} + deleteAccount(4)} + > + Delete account + + +{/if} +

User settings

{#if data.local_user_view?.local_user && formData} @@ -97,4 +194,12 @@ The API didn't return your user settings. {/if} +
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..814cc0db --- /dev/null +++ b/src/routes/signup/[instance]/+page.svelte @@ -0,0 +1,202 @@ + + + + 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} +