From 76c6b4514979d0fd2234f35a528b48ee02f82b91 Mon Sep 17 00:00:00 2001 From: g Date: Fri, 14 Feb 2025 16:46:12 +0000 Subject: [PATCH] Update store page --- app/dashboard/storefront/page.tsx | 94 ++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 3 deletions(-) diff --git a/app/dashboard/storefront/page.tsx b/app/dashboard/storefront/page.tsx index 7a87069..fb381b5 100644 --- a/app/dashboard/storefront/page.tsx +++ b/app/dashboard/storefront/page.tsx @@ -6,16 +6,31 @@ import Layout from "@/components/layout/layout"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Textarea } from "@/components/ui/textarea"; -import { Save, Send, Key, MessageSquare, Shield } from "lucide-react"; +import { Save, Send, Key, MessageSquare, Shield, Globe } from "lucide-react"; import { apiRequest } from "@/lib/storeHelper"; import { toast, Toaster } from "sonner"; import BroadcastDialog from "@/components/modals/broadcast-dialog"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; + +const SHIPPING_REGIONS = [ + { value: "UK", label: "United Kingdom", emoji: "πŸ‡¬πŸ‡§" }, + { value: "EU", label: "European Union", emoji: "πŸ‡ͺπŸ‡Ί" }, + { value: "USA", label: "United States", emoji: "πŸ‡ΊπŸ‡Έ" }, + { value: "WW", label: "Worldwide", emoji: "🌍" }, +] as const; -// βœ… Define the Storefront Type interface Storefront { pgpKey: string; welcomeMessage: string; telegramToken: string; + shipsFrom: typeof SHIPPING_REGIONS[number]["value"]; + shipsTo: typeof SHIPPING_REGIONS[number]["value"]; } export default function StorefrontPage() { @@ -24,13 +39,14 @@ export default function StorefrontPage() { pgpKey: "", welcomeMessage: "", telegramToken: "", + shipsFrom: "UK", + shipsTo: "WW", }); const [broadcastOpen, setBroadcastOpen] = useState(false); const [loading, setLoading] = useState(true); const [saving, setSaving] = useState(false); - // βœ… Fetch Storefront Data useEffect(() => { const authToken = document.cookie .split("; ") @@ -140,6 +156,78 @@ export default function StorefrontPage() { +
+
+ +

+ Shipping Locations +

+
+
+
+ + +
+ +
+ + +
+
+
+