From 619dc1e6edd3d18d122a3a584633a6ef30a6a500 Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Sat, 18 May 2024 16:50:17 +0100 Subject: [PATCH] Add custom message box Add headers and descriptions for different sections --- front/src/lib/types.ts | 1 + front/src/pages/Checkout.svelte | 89 +++++++++++++++++++++++++-------- 2 files changed, 68 insertions(+), 22 deletions(-) diff --git a/front/src/lib/types.ts b/front/src/lib/types.ts index 85084f6..b21d496 100644 --- a/front/src/lib/types.ts +++ b/front/src/lib/types.ts @@ -35,6 +35,7 @@ export type Checkout = { town: string; postcode: string; }; + message: string; }; export type JSONResponse = { diff --git a/front/src/pages/Checkout.svelte b/front/src/pages/Checkout.svelte index 3121827..39d556c 100644 --- a/front/src/pages/Checkout.svelte +++ b/front/src/pages/Checkout.svelte @@ -3,6 +3,7 @@ import { ArrowLeft, SealWarning, ArrowRight } from "phosphor-svelte"; import { type CartItem, type Checkout } from '../lib/types'; + import { expandOnTyping } from "../lib/utils"; import Cart from "../lib/cart"; const CheckoutData: Checkout = { @@ -16,11 +17,13 @@ town: "", postcode: "", }, + message: "", } $: nameValid = CheckoutData.personal.name.length > 1 $: emailValid = CheckoutData.personal.email.length > 1 $: phoneValid = isNaN(CheckoutData.personal.phone) + $: messageValid = messageValid = CheckoutData.message.length <= 200; let items: [string, CartItem][]; let totalPrice: number; @@ -43,8 +46,11 @@
-

Checkout

+

Checkout

+

Contact Information

+

This is for updates on your order

+
+
+

Special Requests

+

Have a noisy dog, and don't want us to knock? Let us know here!

+
+
+ +