feat: complete all remaining backlog tasks 25.1 to 25.14
Deploy Canina / deploy (push) Waiting to run
Deploy Canina / deploy (push) Waiting to run
This commit is contained in:
1 parent
1542c85b29
commit
ce30ade808
4 files changed
+103
-25
No files matched your search
@@ -80,6 +80,8 @@ export default function ProductPage({ productSlug }: { productSlug: string }) {
|
||||
const [showRefillModal, setShowRefillModal] = useState(false);
|
||||
const [itemQuantity, setItemQuantity] = useState(1);
|
||||
const [allProducts, setAllProducts] = useState<Product[]>([]);
|
||||
const [showNotifier, setShowNotifier] = useState(false);
|
||||
const [notifierPhone, setNotifierPhone] = useState('');
|
||||
const [isMounted, setIsMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -672,17 +674,38 @@ export default function ProductPage({ productSlug }: { productSlug: string }) {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Add to Cart Button - 60% Width */}
|
||||
<button
|
||||
onClick={() => {
|
||||
addItem(product, itemQuantity, { quantity: calculation.dailyDose, unit: calculation.unit });
|
||||
toast.success(`${toPersian(itemQuantity)} عدد ${product.name} به سبد خرید اضافه شد`);
|
||||
}}
|
||||
className="w-[60%] flex items-center justify-center gap-1.5 px-4 bg-medical-gray-900 text-white rounded-2xl h-16 font-black text-sm hover:bg-canina-blue transition-all shadow-xl shadow-black/10 font-vazir whitespace-nowrap"
|
||||
>
|
||||
<ShoppingBag className="w-5 h-5 mb-1" />
|
||||
افزودن به سبد خرید
|
||||
</button>
|
||||
{/* Add to Cart / Preorder / Stock Notify Button - 60% Width */}
|
||||
{(product as any).isPreorder ? (
|
||||
<button
|
||||
onClick={() => {
|
||||
addItem(product, itemQuantity, { quantity: calculation.dailyDose, unit: calculation.unit });
|
||||
toast.success(`پیشخرید ${toPersian(itemQuantity)} عدد ${product.name} به سبد شما اضافه شد`);
|
||||
}}
|
||||
className="w-[60%] flex items-center justify-center gap-1.5 px-4 bg-purple-700 text-white rounded-2xl h-16 font-black text-sm hover:bg-purple-800 transition-all shadow-xl shadow-purple-900/20 font-vazir whitespace-nowrap"
|
||||
>
|
||||
<Sparkles className="w-5 h-5 mb-1 text-amber-300" />
|
||||
{(product as any).preorderDeposit > 0 ? `پیشخرید (بیعانه: ${((product as any).preorderDeposit).toLocaleString('fa-IR')} تومان)` : 'ثبت پیشخرید (رایگان)'}
|
||||
</button>
|
||||
) : (product.packageSize || 0) <= 0 ? (
|
||||
<button
|
||||
onClick={() => setShowNotifier(true)}
|
||||
className="w-[60%] flex items-center justify-center gap-1.5 px-4 bg-amber-500 text-white rounded-2xl h-16 font-black text-sm hover:bg-amber-600 transition-all shadow-xl shadow-amber-500/20 font-vazir whitespace-nowrap"
|
||||
>
|
||||
<Bell className="w-5 h-5 mb-1" />
|
||||
موجود شد اطلاع بده
|
||||
</button>
|
||||
) : (
|
||||
<button
|
||||
onClick={() => {
|
||||
addItem(product, itemQuantity, { quantity: calculation.dailyDose, unit: calculation.unit });
|
||||
toast.success(`${toPersian(itemQuantity)} عدد ${product.name} به سبد خرید اضافه شد`);
|
||||
}}
|
||||
className="w-[60%] flex items-center justify-center gap-1.5 px-4 bg-medical-gray-900 text-white rounded-2xl h-16 font-black text-sm hover:bg-canina-blue transition-all shadow-xl shadow-black/10 font-vazir whitespace-nowrap"
|
||||
>
|
||||
<ShoppingBag className="w-5 h-5 mb-1" />
|
||||
افزودن به سبد خرید
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="mt-6 flex flex-col gap-3 border-t border-medical-gray-50 pt-6">
|
||||
|
||||
Reference in new issue
Block a user