fixed some bugs
This commit is contained in:
@@ -105,7 +105,7 @@ export default function CartPage() {
|
||||
const orderData = userStore.getOrderData();
|
||||
if (!orderData) {
|
||||
console.error("User data not found");
|
||||
router.push("/login");
|
||||
router.push("/");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ export default function CartPage() {
|
||||
customer_name: name,
|
||||
customer_phone: phone,
|
||||
customer_address: selectedProvinceData.name,
|
||||
shipping_method: deliveryType === "PICK_UP" ? "pickup" : "standart",
|
||||
shipping_method: "standart",
|
||||
payment_type_id: paymentType.id,
|
||||
region: selectedRegion,
|
||||
note: note || undefined,
|
||||
@@ -138,12 +138,12 @@ export default function CartPage() {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="container mx-auto px-2 md:px-4 lg:px-6 mb-18">
|
||||
<h1 className="text-3xl font-bold mb-6 pt-3">{t("cart")}</h1>
|
||||
<div className=" mx-auto px-2 md:px-4 lg:px-6 mb-18">
|
||||
<h1 className="text-xl md:text-2xl lg:text-3xl font-bold mb-4 md:mb-6 pt-3">{t("cart")}</h1>
|
||||
|
||||
<div className="flex flex-col md:flex-row gap-6">
|
||||
<div className="flex-1">
|
||||
<Card className="p-6 rounded-xl">
|
||||
<Card className="p-4 md:p-6 rounded-xl">
|
||||
{Object.entries(itemsBySeller).map(
|
||||
([sellerId, { seller, items }]) => (
|
||||
<div key={sellerId} className="mb-6">
|
||||
|
||||
@@ -12,7 +12,7 @@ export default function FavoritesPage() {
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="container mx-auto px-4 py-8 min-h-screen">
|
||||
<div className=" mx-auto px-4 py-8 min-h-screen">
|
||||
<h1 className="text-3xl font-bold mb-6">{t("favorite_products")}</h1>
|
||||
<div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4">
|
||||
{Array.from({ length: 10 }).map((_, i) => (
|
||||
@@ -30,7 +30,7 @@ export default function FavoritesPage() {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="container mx-auto px-2 md:px-4 lg:px-6 pb-12 space-y-8 max-w-[1504px]
|
||||
<div className=" mx-auto px-2 md:px-4 lg:px-6 pb-12 space-y-8 max-w-[1504px]
|
||||
">
|
||||
<h1 className="bg-white text-3xl p-4 font-bold mb-0 pb-6">{t("favorite_products")}</h1>
|
||||
<div className="bg-white grid grid-cols-2 sm:grid-cols-3 rounded-b-lg md:grid-cols-4 lg:grid-cols-5 gap-3 p-4">
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { useOpenStore } from "@/lib/hooks";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
import { toast } from "sonner";
|
||||
|
||||
interface OpenStorePageProps {
|
||||
locale?: string;
|
||||
@@ -68,7 +68,7 @@ export default function OpenStorePage({
|
||||
const [fileName, setFileName] = useState("");
|
||||
|
||||
const { mutate: submitOpenStore, isPending: loading } = useOpenStore();
|
||||
const { toast } = useToast();
|
||||
|
||||
|
||||
const t = translations || {
|
||||
title: "Форма подачи заявления на открытие магазина",
|
||||
@@ -160,10 +160,9 @@ export default function OpenStorePage({
|
||||
},
|
||||
{
|
||||
onSuccess: () => {
|
||||
toast({
|
||||
title: "Success",
|
||||
description: "Your store request has been submitted successfully",
|
||||
});
|
||||
toast.success("Your store request has been submitted successfully");
|
||||
|
||||
|
||||
setFormData({
|
||||
firstName: "",
|
||||
lastName: "",
|
||||
@@ -174,11 +173,7 @@ export default function OpenStorePage({
|
||||
setFileName("");
|
||||
},
|
||||
onError: (error: any) => {
|
||||
toast({
|
||||
title: "Error",
|
||||
description: error?.message || "Failed to submit store request",
|
||||
variant: "destructive",
|
||||
});
|
||||
toast.error(error?.message || "Failed to submit store request");
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user