diff --git a/src/App.tsx b/src/App.tsx index 997d872..48f2aaa 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,6 +3,7 @@ import { BrowserRouter, Routes, Route, useLocation } from 'react-router-dom' import Home from './pages/Home' import CafeDetail from './pages/CafeDetail' import PaymentSuccess from './pages/PaymentSuccess' +import CafeOwnerRegister from './pages/CafeOwnerRegister' function ScrollToTop() { const { pathname } = useLocation() @@ -22,6 +23,7 @@ export default function App() { } /> } /> } /> + } /> ) diff --git a/src/assets/arrow-right.svg b/src/assets/arrow-right.svg new file mode 100644 index 0000000..2694710 --- /dev/null +++ b/src/assets/arrow-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/ReservationModal.tsx b/src/components/ReservationModal.tsx index 0994263..57f5890 100644 --- a/src/components/ReservationModal.tsx +++ b/src/components/ReservationModal.tsx @@ -117,7 +117,7 @@ export default function ReservationModal({ value={fullName} onChange={(e) => setFullName(e.target.value)} placeholder="نام و نام خانوادگی" - className="w-full rounded-2xl border border-gray-200 px-4 py-3 text-right" + className="w-full rounded-2xl border border-gray-200 px-4 py-3 text-right placeholder:font-light placeholder:text-[#999999]" /> @@ -131,7 +131,7 @@ export default function ReservationModal({ value={mockPhone} readOnly placeholder="مثال: ۰۹۱۲۳۴۵۶۷۸۹" - className="w-full rounded-2xl border border-gray-200 bg-gray-50 px-4 py-3 text-right" + className="w-full rounded-2xl border border-gray-200 bg-gray-50 px-4 py-3 text-right placeholder:font-light placeholder:text-[#999999]" /> diff --git a/src/data/mockCafeFeatures.ts b/src/data/mockCafeFeatures.ts new file mode 100644 index 0000000..8171d11 --- /dev/null +++ b/src/data/mockCafeFeatures.ts @@ -0,0 +1,12 @@ +export interface CafeFeature { + id: string + label: string +} + +export const mockCafeFeatures: CafeFeature[] = [ + { id: 'open-space', label: 'فضای باز' }, + { id: 'family-friendly', label: 'فضای مناسب خانواده' }, + { id: 'smoking-allowed', label: 'امکان کشیدن سیگار' }, + { id: 'parking', label: 'پارکینگ' }, + { id: 'delivery', label: 'امکان سفارش' }, +] diff --git a/src/pages/CafeOwnerRegister.tsx b/src/pages/CafeOwnerRegister.tsx new file mode 100644 index 0000000..37d7a22 --- /dev/null +++ b/src/pages/CafeOwnerRegister.tsx @@ -0,0 +1,282 @@ +import { ReactNode, useState } from "react"; +import InfoIcon from "../components/InfoIcon"; +import { mockCafeFeatures } from "../data/mockCafeFeatures"; + +function ArrowIcon({ className = "" }: { className?: string }) { + return ( + + + + ); +} + +function CheckIcon() { + return ( + + + + ); +} + +function StepCircle({ + active, + children, +}: { + active: boolean; + children: ReactNode; +}) { + return ( + + {children} + + ); +} + +function Stepper({ currentStep }: { currentStep: 1 | 2 }) { + return ( +
+ + اطلاعات نماینده + + ۱ + + ۲ + + اطلاعات کافه + +
+ ); +} + +function FormField({ + label, + placeholder, + value, + onChange, +}: { + label: string; + placeholder: string; + value: string; + onChange: (value: string) => void; +}) { + return ( +
+ + onChange(e.target.value)} + placeholder={placeholder} + className="w-full rounded-2xl border border-gray-200 px-4 py-3 text-right h-14 placeholder:font-light placeholder:text-[#999999]" + /> +
+ ); +} + +function UploadBox({ + label, + buttonLabel, +}: { + label: string; + buttonLabel: string; +}) { + return ( +
+ + +
+ ); +} + +function FeatureChip({ + label, + checked, + onToggle, +}: { + label: string; + checked: boolean; + onToggle: () => void; +}) { + return ( + + ); +} + +export default function CafeOwnerRegister() { + const [step, setStep] = useState<1 | 2>(1); + + const [fullName, setFullName] = useState(""); + const [phone, setPhone] = useState(""); + const [nationalId, setNationalId] = useState(""); + const [cardNumber, setCardNumber] = useState(""); + + const [cafeName, setCafeName] = useState(""); + const [address, setAddress] = useState(""); + const [cafePhone, setCafePhone] = useState(""); + const [selectedFeatures, setSelectedFeatures] = useState([]); + + const toggleFeature = (feature: string) => { + setSelectedFeatures((prev) => + prev.includes(feature) + ? prev.filter((f) => f !== feature) + : [...prev, feature], + ); + }; + + return ( +
+
+ + + +
+ {step === 1 ? ( + <> +
+ +

+ لطفاً یک{" "} + نماینده{" "} + برای کافه معرفی کنید. نماینده باید در اپلیکیشن ثبت‌نام کند و + پرداختها و واریز به کیف پول یا واریز می‌شود. شماره موبایل، کد + ملی و کارت بانکی باید متعلق به یک نفر باشند. +

+
+ + + + + + + ) : ( + <> + + + + + + + +
+ +
+ {mockCafeFeatures.map((feature) => ( + toggleFeature(feature.id)} + /> + ))} +
+
+ + )} +
+ +
+ + +
+
+ ); +}