diff --git a/src/routes/(dashboard)/settings/(components)/avatar-form.svelte b/src/routes/(dashboard)/settings/(components)/avatar-form.svelte deleted file mode 100644 index 0bb613b..0000000 --- a/src/routes/(dashboard)/settings/(components)/avatar-form.svelte +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - Avatar image - - This is the image that will be displayed on your profile, in dashboards and in emails. - - - - - - Avatar - - - {user?.initials} - - - - - - Update avatar - - - diff --git a/src/routes/(dashboard)/settings/(components)/email-form.svelte b/src/routes/(dashboard)/settings/(components)/email-form.svelte deleted file mode 100644 index acd356b..0000000 --- a/src/routes/(dashboard)/settings/(components)/email-form.svelte +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - Modify your email - Use a different email by requesting a token and entering it for verification below. - - - - - - New email -
- - Request token -
- -
-
-
- - - - Email verification token - - - - - - - Password - - - - - Confirm email change - -
-
diff --git a/src/routes/(dashboard)/settings/(components)/name-form.svelte b/src/routes/(dashboard)/settings/(components)/name-form.svelte deleted file mode 100644 index c084ca6..0000000 --- a/src/routes/(dashboard)/settings/(components)/name-form.svelte +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - Change your name - - You can change the name that will be displayed on your profile and in emails as well as your - username. - - - - - - - Display name - - - - - - - Username - - - - - Update name - - - diff --git a/src/routes/(dashboard)/settings/(components)/password-form.svelte b/src/routes/(dashboard)/settings/(components)/password-form.svelte deleted file mode 100644 index 8b07ec1..0000000 --- a/src/routes/(dashboard)/settings/(components)/password-form.svelte +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - Password change - You can change your account password here. - - - - - - Current Password - - - - - New Password - - - - - Confirm new password - - - - - Update password - - - diff --git a/src/routes/(dashboard)/settings/+layout.svelte b/src/routes/(dashboard)/settings/+layout.svelte deleted file mode 100644 index 7e38bab..0000000 --- a/src/routes/(dashboard)/settings/+layout.svelte +++ /dev/null @@ -1,35 +0,0 @@ - - -
-
-

Settings

-

Manage your account settings and set e-mail preferences.

-
- -
- -
- -
-
-
diff --git a/src/routes/(dashboard)/settings/+page.server.ts b/src/routes/(dashboard)/settings/+page.server.ts deleted file mode 100644 index 8f1e189..0000000 --- a/src/routes/(dashboard)/settings/+page.server.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type { PageServerLoad } from './$types'; -import { superValidate } from 'sveltekit-superforms/server'; -import { fail, type Actions } from '@sveltejs/kit'; -import { nameFormSchema } from './(components)/name-form.svelte'; -import { emailConfirmFormSchema, emailRequestFormSchema } from './(components)/email-form.svelte'; -import { passwordFormSchema } from './(components)/password-form.svelte'; -import { avatarFormSchema } from './(components)/avatar-form.svelte'; - -export const load: PageServerLoad = async () => { - return { - forms: { - name: await superValidate(nameFormSchema), - emailRequest: await superValidate(emailRequestFormSchema), - emailConfirm: await superValidate(emailConfirmFormSchema), - password: await superValidate(passwordFormSchema), - avatar: await superValidate(avatarFormSchema), - debug: false - } - }; -}; - -export const actions: Actions = { - name: async ({ request, locals }: { request: Request; locals: App.Locals }) => { - const form = await superValidate(request, nameFormSchema); - if (!form.valid) { - return fail(400, { - form - }); - } - await locals.pocketBase.collection('users').update(locals.id, form.data); - return { form }; - }, - emailRequest: async ({ request, locals }: { request: Request; locals: App.Locals }) => { - console.log(request); - const form = await superValidate(request, emailRequestFormSchema); - if (!form.valid) { - return fail(400, { - form - }); - } - await locals.pocketBase.collection('users').requestEmailChange(form.data.newEmail); - return { form }; - }, - emailConfirm: async ({ request, locals }: { request: Request; locals: App.Locals }) => { - const form = await superValidate(request, emailConfirmFormSchema); - if (!form.valid) { - return fail(400, { - form - }); - } - await locals.pocketBase - .collection('users') - .confirmEmailChange(form.data.token, form.data.password); - return { form }; - }, - password: async ({ request, locals }: { request: Request; locals: App.Locals }) => { - const form = await superValidate(request, passwordFormSchema); - console.log(form); - if (!form.valid) { - return fail(400, { - form - }); - } - await locals.pocketBase.collection('users').update(locals.id, form.data); - return { form }; - }, - avatar: async ({ request, locals }: { request: Request; locals: App.Locals }) => { - const formData = await request.formData(); - const form = await superValidate(request, avatarFormSchema); - - if (!form.valid) return fail(400, { form }); - - const file = formData.get('file'); - if (file instanceof File) { - await locals.pocketBase.collection('users').update(locals.id, { avatar: file }); - } - return { form }; - } -}; diff --git a/src/routes/(dashboard)/settings/+page.svelte b/src/routes/(dashboard)/settings/+page.svelte deleted file mode 100644 index 21cadb4..0000000 --- a/src/routes/(dashboard)/settings/+page.svelte +++ /dev/null @@ -1,34 +0,0 @@ - - -
-
-

Account

-

Update your account and profile settings.

-
- -
-
- - - -
-
- -
-
-
diff --git a/src/routes/(dashboard)/settings/appearance/+page.server.ts b/src/routes/(dashboard)/settings/appearance/+page.server.ts deleted file mode 100644 index e435a79..0000000 --- a/src/routes/(dashboard)/settings/appearance/+page.server.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { superValidate } from 'sveltekit-superforms/server'; -import type { PageServerLoad } from '../$types'; -import { appearanceFormSchema } from './appearance-form.svelte'; -import { fail, type Actions } from '@sveltejs/kit'; - -export const load: PageServerLoad = async () => { - return { - form: await superValidate(appearanceFormSchema) - }; -}; - -export const actions: Actions = { - default: async ({ request, locals }: { request: Request; locals: App.Locals }) => { - const form = await superValidate(request, appearanceFormSchema); - if (!form.valid) { - return fail(400, { - form - }); - } - await locals.pocketBase - .collection('users') - .update(locals.id, { appearanceMode: form.data.theme }); - return { form }; - } -}; diff --git a/src/routes/(dashboard)/settings/appearance/appearance-form.svelte b/src/routes/(dashboard)/settings/appearance/appearance-form.svelte deleted file mode 100644 index 09d8e33..0000000 --- a/src/routes/(dashboard)/settings/appearance/appearance-form.svelte +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - Theme - Select the theme for the dashboard. - - -