cart: adjust layout

This commit is contained in:
2025-11-16 15:33:01 +03:00
parent 841dad4346
commit b19b5b6ee2
5 changed files with 15 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
import { Button, Typography } from "antd"; import { Button, Typography, Layout } from "antd";
import BackIcon from "components/Icons/BackIcon"; import BackIcon from "components/Icons/BackIcon";
import { FunctionComponent, ReactNode } from "react"; import { FunctionComponent, ReactNode } from "react";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
@@ -33,9 +33,12 @@ const ProHeader: FunctionComponent<ProHeaderProps> = ({
}; };
return ( return (
<div <Layout.Header
style={{ style={{
position: "sticky",
top: 0,
display: "flex", display: "flex",
zIndex: 1,
flexDirection: isRTL ? "row-reverse" : "row", flexDirection: isRTL ? "row-reverse" : "row",
justifyContent: "space-between", justifyContent: "space-between",
alignItems: "center", // This centers vertically alignItems: "center", // This centers vertically
@@ -97,7 +100,7 @@ const ProHeader: FunctionComponent<ProHeaderProps> = ({
) : ( ) : (
children children
)} )}
</div> </Layout.Header>
); );
}; };

View File

@@ -1,7 +1,6 @@
.cartContainer { .cartContainer {
padding: 15px; padding: 15px;
transition: all 0.3s ease; transition: all 0.3s ease;
height: 92vh;
overflow: auto; overflow: auto;
scrollbar-width: none; scrollbar-width: none;
} }

View File

@@ -1,5 +1,5 @@
import { PlusOutlined } from "@ant-design/icons"; import { PlusOutlined } from "@ant-design/icons";
import { Card, Divider, Form, Space } from "antd"; import { Card, Divider, Form, Space, Layout } from "antd";
import ArabicPrice from "components/ArabicPrice"; import ArabicPrice from "components/ArabicPrice";
import CartActionsButtons from "components/CartActionsButtons/CartActionsButtons.tsx"; import CartActionsButtons from "components/CartActionsButtons/CartActionsButtons.tsx";
import ImageWithFallback from "components/ImageWithFallback"; import ImageWithFallback from "components/ImageWithFallback";
@@ -62,9 +62,9 @@ export default function CartMobileTabletLayout({
}; };
return ( return (
<> <Layout>
<ProHeader>{t("cart.title")}</ProHeader> <ProHeader>{t("cart.title")}</ProHeader>
<div <Layout.Content
className={`${styles.cartContainer} '${styles.cartLayout}' ${getResponsiveClass()}`} className={`${styles.cartContainer} '${styles.cartLayout}' ${getResponsiveClass()}`}
> >
<Space <Space
@@ -287,11 +287,9 @@ export default function CartMobileTabletLayout({
{/* Invoice Summary */} {/* Invoice Summary */}
<OrderSummary /> <OrderSummary />
{/* space keeper*/}
<div style={{ height: "10vh" }} />
</Space> </Space>
</div> </Layout.Content>
<CartFooter form={form} /> <CartFooter form={form} />
</> </Layout>
); );
} }

View File

@@ -1,5 +1,5 @@
import { colors } from "ThemeConstants.ts"; import { colors } from "ThemeConstants.ts";
import { Button, FormInstance, message } from "antd"; import { Button, FormInstance, message, Layout } from "antd";
import { selectCart } from "features/order/orderSlice.ts"; import { selectCart } from "features/order/orderSlice.ts";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Link, useNavigate, useParams } from "react-router-dom"; import { Link, useNavigate, useParams } from "react-router-dom";
@@ -30,7 +30,7 @@ export default function CartFooter({ form }: CartFooterProps) {
}; };
return ( return (
<div className={styles.cartFooter}> <Layout.Footer className={styles.cartFooter}>
<Link <Link
to={`/${subdomain}/menu?${orderType ? `orderType=${orderType}` : ""}`} to={`/${subdomain}/menu?${orderType ? `orderType=${orderType}` : ""}`}
style={{ style={{
@@ -64,6 +64,6 @@ export default function CartFooter({ form }: CartFooterProps) {
> >
{t("cart.checkout")} {t("cart.checkout")}
</Button> </Button>
</div> </Layout.Footer>
); );
} }

View File

@@ -1,7 +1,7 @@
.cartFooter { .cartFooter {
width: 100%; width: 100%;
padding: 16px 16px 0; padding: 16px 16px 0;
position: fixed; position: sticky;
bottom: 0; bottom: 0;
left: 0; left: 0;
height: 80px; height: 80px;