diff --git a/frontend/application/app/globals.css b/frontend/application/app/globals.css index b2453c5..9ba09bb 100644 --- a/frontend/application/app/globals.css +++ b/frontend/application/app/globals.css @@ -137,6 +137,11 @@ } } +/* Sonner Toasts Vazirmatn Font */ +[data-sonner-toaster] { + font-family: "Vazirmatn", sans-serif !important; +} + /* Custom scrollbar for a professional look */ ::-webkit-scrollbar { width: 6px; diff --git a/frontend/application/app/trust-seals/page.tsx b/frontend/application/app/trust-seals/page.tsx index 3b49903..18e984e 100644 --- a/frontend/application/app/trust-seals/page.tsx +++ b/frontend/application/app/trust-seals/page.tsx @@ -1,8 +1,6 @@ import React from 'react'; import { Metadata } from 'next'; import EnamadBadge from '@/components/EnamadBadge'; -import Header from '@/components/Header'; -import Footer from '@/components/Footer'; import { ShieldCheck, Award, FileCheck, CheckCircle2, Building2, ExternalLink } from 'lucide-react'; export const metadata: Metadata = { @@ -47,9 +45,7 @@ export default function TrustSealsPage() { ]; return ( -
-
- +
{/* Banner Section */}
@@ -129,8 +125,6 @@ export default function TrustSealsPage() {
- -
); } diff --git a/frontend/application/components/AddressModal.tsx b/frontend/application/components/AddressModal.tsx index 2d80c39..e733814 100644 --- a/frontend/application/components/AddressModal.tsx +++ b/frontend/application/components/AddressModal.tsx @@ -5,6 +5,7 @@ import { X, MapPin, User, Phone, Hash, Save, Check } from "lucide-react"; import { toPersian, cn } from "../lib/utils"; import { Address } from "../lib/store/userStore"; import { IRAN_PROVINCES, PROVINCE_CITIES } from "../lib/data/provinces"; +import SearchableSelect from "./SearchableSelect"; import { toast } from "sonner"; interface AddressModalProps { @@ -206,44 +207,35 @@ export default function AddressModal({ isOpen, onClose, onSave, editingAddress } {/* Row 3: Province & City */}
- + /> {errors.province &&

{errors.province}

}
{formData.province && PROVINCE_CITIES[formData.province] ? ( - + placeholder="انتخاب شهر..." + searchPlaceholder="جستجوی شهر..." + onChange={(c) => setFormData({...formData, city: c})} + /> ) : ( { + if (isOpen) { + document.body.style.overflow = "hidden"; + } else { + document.body.style.overflow = "unset"; + } + return () => { + document.body.style.overflow = "unset"; + }; + }, [isOpen]); return ( diff --git a/frontend/application/components/CheckoutPage.tsx b/frontend/application/components/CheckoutPage.tsx index 8f6169e..82c4572 100644 --- a/frontend/application/components/CheckoutPage.tsx +++ b/frontend/application/components/CheckoutPage.tsx @@ -26,6 +26,7 @@ import { useSettingsStore } from "../lib/store/settingsStore"; import { productService } from "../lib/services/productService"; import TopUpModal from "./TopUpModal"; import AddressModal from "./AddressModal"; +import SearchableSelect from "./SearchableSelect"; import { IRAN_PROVINCES, PROVINCE_CITIES } from "../lib/data/provinces"; import { toast } from "sonner"; import { useRouter } from 'next/navigation'; @@ -50,6 +51,7 @@ export default function CheckoutPage() { const [manualPhone, setManualPhone] = useState(''); const [manualProvince, setManualProvince] = useState(''); const [manualCity, setManualCity] = useState(''); + const [manualZipCode, setManualZipCode] = useState(''); const [manualAddress, setManualAddress] = useState(''); const handleCopy = (text: string, title: string) => { @@ -120,10 +122,10 @@ export default function CheckoutPage() { const selectedAddr = profile.addresses?.find(a => a.id === selectedAddressId); let shippingAddressStr = ''; if (selectedAddr) { - shippingAddressStr = `${selectedAddr.province}، ${selectedAddr.city}، ${selectedAddr.detail} (گیرنده: ${selectedAddr.receptorName} - ${toPersian(selectedAddr.phone)})`; + shippingAddressStr = `${selectedAddr.province}، ${selectedAddr.city}، ${selectedAddr.detail}${selectedAddr.zipCode ? ` (کد پستی: ${selectedAddr.zipCode})` : ''} (گیرنده: ${selectedAddr.receptorName} - ${toPersian(selectedAddr.phone)})`; } else if (manualAddress) { const provCity = [manualProvince, manualCity].filter(Boolean).join('، '); - shippingAddressStr = `${provCity ? provCity + '، ' : ''}${manualAddress}${manualName ? ` (گیرنده: ${manualName}${manualPhone ? ` - ${toPersian(manualPhone)}` : ''})` : ''}`; + shippingAddressStr = `${provCity ? provCity + '، ' : ''}${manualAddress}${manualZipCode ? ` (کد پستی: ${manualZipCode})` : ''}${manualName ? ` (گیرنده: ${manualName}${manualPhone ? ` - ${toPersian(manualPhone)}` : ''})` : ''}`; } const orderId = await addOrder({ @@ -314,37 +316,30 @@ export default function CheckoutPage() {
- + />
{manualProvince && PROVINCE_CITIES[manualProvince] ? ( - + placeholder="انتخاب شهر..." + searchPlaceholder="جستجوی شهر..." + onChange={(c) => setManualCity(c)} + /> ) : (
+
+ + setManualZipCode(e.target.value.replace(/[^0-9]/g, ''))} + className="w-full bg-medical-gray-50 border border-medical-gray-200 rounded-2xl py-3 sm:py-4 px-4 sm:px-6 text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-canina-blue/20 dir-ltr text-right" + placeholder="۱۲۳۴۵۶۷۸۹۰" + /> +
)} diff --git a/frontend/application/components/Header.tsx b/frontend/application/components/Header.tsx index ab26b7e..a1650eb 100644 --- a/frontend/application/components/Header.tsx +++ b/frontend/application/components/Header.tsx @@ -152,16 +152,16 @@ export default function Header({ {isMobileMenuOpen ? : } - -
C
-
- + +
C
+
+ Canina - + {getText('brand_name_fa', "ایران")} - + نماینده رسمی CANINA PHARMA GMBH GERMANY
@@ -185,7 +185,7 @@ export default function Header({
{/* Left Action Buttons */} -
+
{/* Prescription Upload Button */} )} diff --git a/frontend/application/components/ProductPage.tsx b/frontend/application/components/ProductPage.tsx index 36a9155..857f1f8 100644 --- a/frontend/application/components/ProductPage.tsx +++ b/frontend/application/components/ProductPage.tsx @@ -185,16 +185,16 @@ export default function ProductPage({ productSlug }: { productSlug: string }) {
{/* Standard Breadcrumb Navigation & Integrated Back Button */} -
-
- router.push('/')}>خانه - - router.push('/shop')}>فروشگاه - - {product.nameFa || product.name} +
+
+ router.push('/')}>خانه + + router.push('/shop')}>فروشگاه + + {product.nameFa || product.name}
-
+
+ + {isOpen && ( +
+
+ + setSearchQuery(e.target.value)} + placeholder={searchPlaceholder} + className="w-full bg-medical-gray-50 border border-medical-gray-200 rounded-xl py-1.5 pr-8 pl-3 text-xs font-bold text-medical-gray-900 outline-none focus:border-canina-blue" + /> + {searchQuery && ( + + )} +
+
+ {filteredOptions.length === 0 ? ( +
+ موردی یافت نشد +
+ ) : ( + filteredOptions.map((opt) => ( + + )) + )} +
+
+ )} +
+ ); +}