cart: apply form validation

This commit is contained in:
2025-10-14 22:41:20 +03:00
parent adfef2cd5c
commit c9829c0e66
5 changed files with 116 additions and 74 deletions

View File

@@ -1,11 +1,14 @@
import { Form } from "antd";
import { useEffect } from "react";
import useBreakPoint from "hooks/useBreakPoint.ts";
import CartDesktopLayout from "pages/cart/components/CartDesktopLayout.tsx";
import CartMobileTabletLayout from "pages/cart/components/CartMobileTabletLayout.tsx";
import useBreakPoint from "hooks/useBreakPoint.ts";
export default function CartPage() {
const { isDesktop } = useBreakPoint();
const [form] = Form.useForm();
// Prevent keyboard from appearing automatically on mobile
useEffect(() => {
// Blur any focused element when component mounts
@@ -24,9 +27,17 @@ export default function CartPage() {
// Enhanced desktop layout
if (isDesktop) {
return <CartDesktopLayout />;
return (
<Form form={form}>
<CartDesktopLayout form={form} />
</Form>
);
}
// Mobile/Tablet Layout (existing code)
return <CartMobileTabletLayout />;
return (
<Form form={form}>
<CartMobileTabletLayout form={form} />
</Form>
);
}