diff --git a/src/routes/(app)/website/+page.server.js b/src/routes/(app)/website/+page.server.js index fbe45cd..9b792fd 100644 --- a/src/routes/(app)/website/+page.server.js +++ b/src/routes/(app)/website/+page.server.js @@ -10,11 +10,10 @@ export const load = async ({ fetch }) => { }); const { site } = await blogRes.json(); - site.primary_color_hex = "#" + site.primary_color_hex - site.secondary_color_hex = "#" + site.secondary_color_hex - site.text_color_hex = "#" + site.text_color_hex + // site.primary_color_hex = "#" + site.primary_color_hex + // site.secondary_color_hex = "#" + site.secondary_color_hex + // site.text_color_hex = "#" + site.text_color_hex - // console.log("getting back", site) return { blog_info: site, form: await superValidate(site, zod(schema)) @@ -32,9 +31,9 @@ export const actions = { } let data = structuredClone(form.data); - data.primary_color_hex = data.primary_color_hex.slice(1); - data.secondary_color_hex = data.secondary_color_hex.slice(1); - data.text_color_hex = data.text_color_hex.slice(1); + // data.primary_color_hex = data.primary_color_hex.slice(1); + // data.secondary_color_hex = data.secondary_color_hex.slice(1); + // data.text_color_hex = data.text_color_hex.slice(1); const res = await event.fetch(config.api_url + "/dashboard/website", { method: "PUT", diff --git a/src/routes/(app)/website/+page.svelte b/src/routes/(app)/website/+page.svelte index 5d39b05..6588038 100644 --- a/src/routes/(app)/website/+page.svelte +++ b/src/routes/(app)/website/+page.svelte @@ -83,20 +83,14 @@
- +
-
- +
+

Basics

- - -
- +
Blog name @@ -121,48 +115,48 @@ - - - Primary color - { - if (e.detail.hex) $formData.primary_color_hex = e.detail.hex; - }} - hex={data.blog_info.primary_color_hex} - {...attrs} - /> - - - - - - - Secondary color - { - if (e.detail.hex) $formData.secondary_color_hex = e.detail.hex; - }} - hex={data.blog_info.secondary_color_hex} - {...attrs} - /> - - - - - - - Text color - { - if (e.detail.hex) $formData.text_color_hex = e.detail.hex; - }} - hex={data.blog_info.text_color_hex} - {...attrs} - /> - - - - + Custom domain @@ -179,21 +173,43 @@ {/if} - - +
+
+
+
+

Auto publish

+
+
+ + + Auto Publish +
+ +
+
+ + Automatically creates a blog post for you when you upload a video +
+
+
-
- +
+

Freebies

- - -
- +
+ + + Freebie title +
+ +
+
+ +
Send freebie @@ -207,19 +223,6 @@ > - - - Freebie Name -
- -
-
- -
Freebie file @@ -276,66 +279,8 @@ >The text displayed next to the signup form on your blog. - - -
-
- -
-

Auto publish

- - -
- - - - Auto Publish -
- -
-
- - Automatically creates a blog post for you when you upload a video -
- - - Freebie Name -
- -
-
- -
- - - Freebie file -
- - handleFileChange(e, $formData.freebie_url).then((x) => { - $formData.freebie_url = x; - })} - bind:disabled={disable_freebies} - /> - -
-
- Maximum size of 5MB (TEMPORARY) - -
-
-
+
diff --git a/src/routes/(app)/website/schema.js b/src/routes/(app)/website/schema.js index 89b945c..6c9ccc3 100644 --- a/src/routes/(app)/website/schema.js +++ b/src/routes/(app)/website/schema.js @@ -3,14 +3,14 @@ import { z } from "zod"; export const schema = z.object({ id: z.string(), name: z.string().min(4).max(32), - primary_color_hex: z.string().length(7), - secondary_color_hex: z.string().length(7), - text_color_hex: z.string().length(7), + // primary_color_hex: z.string().length(7), + // secondary_color_hex: z.string().length(7), + // text_color_hex: z.string().length(7), domain: z.string().refine((key) => key === null || /^[a-z0-9\.\-]*$/.test(key), { message: "Invalid domain" }).nullable(), use_freebie: z.boolean().default(false), - freebie_name: z.string().nullable(), + freebie_title: z.string().nullable(), freebie_url: z.string().nullable(), freebie_image_url: z.string().nullable(), freebie_text: z.string().nullable(), @@ -20,13 +20,6 @@ export const schema = z.object({ }).superRefine((data, ctx) => { console.log(data); if (data.use_freebie) { - if (!data.freebie_name || data.freebie_name.length === 0) { - ctx.addIssue({ - path: ['freebie_name'], - message: "A freebie name' is required when 'Use freebie' is true.", - code: "custom" - }); - } if (!data.freebie_url) { ctx.addIssue({ path: ['freebie_url'],