diff --git a/api.zip b/api.zip deleted file mode 100644 index cdd74e3..0000000 Binary files a/api.zip and /dev/null differ diff --git a/app/[locale]/cart/page.tsx b/app/[locale]/cart/page.tsx index b3fd3e1..51add10 100644 --- a/app/[locale]/cart/page.tsx +++ b/app/[locale]/cart/page.tsx @@ -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 ( -
-

{t("cart")}

+
+

{t("cart")}

- + {Object.entries(itemsBySeller).map( ([sellerId, { seller, items }]) => (
diff --git a/app/[locale]/favorites/page.tsx b/app/[locale]/favorites/page.tsx index a6d2e2b..989c90c 100644 --- a/app/[locale]/favorites/page.tsx +++ b/app/[locale]/favorites/page.tsx @@ -12,7 +12,7 @@ export default function FavoritesPage() { if (isLoading) { return ( -
+

{t("favorite_products")}

{Array.from({ length: 10 }).map((_, i) => ( @@ -30,7 +30,7 @@ export default function FavoritesPage() { } return ( -

{t("favorite_products")}

diff --git a/app/[locale]/openStore/page.tsx b/app/[locale]/openStore/page.tsx index bf14c8c..7d78101 100644 --- a/app/[locale]/openStore/page.tsx +++ b/app/[locale]/openStore/page.tsx @@ -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"); }, } ); diff --git a/components/layout/Header.tsx b/components/layout/Header.tsx index 8173c60..0b72748 100644 --- a/components/layout/Header.tsx +++ b/components/layout/Header.tsx @@ -26,10 +26,8 @@ export default function Header({ locale = "ru" }: HeaderProps) { const [isMobileSearchOpen, setIsMobileSearchOpen] = useState(false); const [isLoginOpen, setIsLoginOpen] = useState(false); const t = useTranslations(); - - const { isAuthenticated, isLoading } = useAuthStatus(); - + const { isAuthenticated } = useAuthStatus(); useEffect(() => { setIsClient(true); @@ -43,8 +41,6 @@ export default function Header({ locale = "ru" }: HeaderProps) { } }, [isAuthenticated, locale]); - - const toggleCategoryMenu = useCallback(() => { setIsCategoryOpen((prev) => !prev); }, []); @@ -53,14 +49,12 @@ export default function Header({ locale = "ru" }: HeaderProps) { setIsCategoryOpen(false); }, []); - - if (!isClient) return null; return ( <>
-
+
@@ -76,7 +70,7 @@ export default function Header({ locale = "ru" }: HeaderProps) { - +
{localQuantity} {isSyncing && ( )} {syncError && ( - + )}
- +
{/* Payment Type */} -
+

{t("payment_type")}

{paymentTypes.map((type) => ( @@ -166,13 +166,13 @@ export default function OrderSummary({
{/* Delivery Type */} - + /> */} {/* Region Selection */} -
+
@@ -204,7 +204,7 @@ export default function OrderSummary({ {/* Province Selection */} {selectedRegion && provincesForSelectedRegion.length > 0 && ( -
+
@@ -212,7 +212,7 @@ export default function OrderSummary({ value={selectedProvince?.toString() || ""} onValueChange={(value) => onProvinceChange(parseInt(value))} > - + @@ -227,7 +227,7 @@ export default function OrderSummary({ )} {/* Note */} -
+