diff --git a/app/dashboard/shipping/page.tsx b/app/dashboard/shipping/page.tsx index e5108b0..64cd736 100644 --- a/app/dashboard/shipping/page.tsx +++ b/app/dashboard/shipping/page.tsx @@ -170,4 +170,4 @@ export default function ShippingPage() { /> ); -} +} \ No newline at end of file diff --git a/app/dashboard/storefront/page.tsx b/app/dashboard/storefront/page.tsx index fb381b5..64111f4 100644 --- a/app/dashboard/storefront/page.tsx +++ b/app/dashboard/storefront/page.tsx @@ -6,7 +6,7 @@ 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, Globe } from "lucide-react"; +import { Save, Send, Key, MessageSquare, Shield, Globe, Wallet } from "lucide-react"; import { apiRequest } from "@/lib/storeHelper"; import { toast, Toaster } from "sonner"; import BroadcastDialog from "@/components/modals/broadcast-dialog"; @@ -17,6 +17,8 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; +import { Switch } from "@/components/ui/switch"; +import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; const SHIPPING_REGIONS = [ { value: "UK", label: "United Kingdom", emoji: "🇬🇧" }, @@ -31,8 +33,45 @@ interface Storefront { telegramToken: string; shipsFrom: typeof SHIPPING_REGIONS[number]["value"]; shipsTo: typeof SHIPPING_REGIONS[number]["value"]; + wallets: { + bitcoin?: string; + litecoin: string; + monero?: string; + }; + enabledWallets: { + bitcoin: boolean; + litecoin: boolean; + monero: boolean; + }; } +const WALLET_OPTIONS = [ + { + id: 'bitcoin', + name: 'Bitcoin', + emoji: '₿', + placeholder: 'Your BTC address', + disabled: true, + comingSoon: true + }, + { + id: 'litecoin', + name: 'Litecoin', + emoji: 'Ł', + placeholder: 'Your LTC address', + disabled: false, + comingSoon: false + }, + { + id: 'monero', + name: 'Monero', + emoji: 'ɱ', + placeholder: 'Your XMR address', + disabled: true, + comingSoon: true + }, +] as const; + export default function StorefrontPage() { const router = useRouter(); const [storefront, setStorefront] = useState({ @@ -41,6 +80,16 @@ export default function StorefrontPage() { telegramToken: "", shipsFrom: "UK", shipsTo: "WW", + wallets: { + bitcoin: '', + litecoin: '', + monero: '' + }, + enabledWallets: { + bitcoin: false, + litecoin: false, + monero: false + } }); const [broadcastOpen, setBroadcastOpen] = useState(false); @@ -61,8 +110,24 @@ export default function StorefrontPage() { const fetchStorefront = async () => { try { setLoading(true); - const data: Storefront = await apiRequest("/storefront"); - setStorefront(data); + const data = await apiRequest("/storefront"); + setStorefront({ + pgpKey: data.pgpKey || "", + welcomeMessage: data.welcomeMessage || "", + telegramToken: data.telegramToken || "", + shipsFrom: data.shipsFrom || "UK", + shipsTo: data.shipsTo || "WW", + wallets: { + bitcoin: data.wallets?.bitcoin || '', + litecoin: data.wallets?.litecoin || '', + monero: data.wallets?.monero || '' + }, + enabledWallets: { + bitcoin: data.enabledWallets?.bitcoin || false, + litecoin: data.enabledWallets?.litecoin || false, + monero: data.enabledWallets?.monero || false + } + }); } catch (error) { toast.error("Failed to load storefront data."); } finally { @@ -95,10 +160,8 @@ export default function StorefrontPage() { return ( - - - -
+
+ {/* PGP Key Section */}
@@ -106,56 +169,47 @@ export default function StorefrontPage() { PGP Encryption Key
-
-