menu: enhance styles
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
/* Import Ant Design reset */
|
/* Import Ant Design reset */
|
||||||
@import "antd/dist/reset.css";
|
@import "antd/dist/reset.css";
|
||||||
|
|
||||||
/* Import Nunito Sans from Google Fonts */
|
/* Import Outfit from Google Fonts */
|
||||||
@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap");
|
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap");
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--background: #f7f7f7;
|
--background: #f7f7f7;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export default function CheckoutPage() {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const { phone, order, orderType } = useAppSelector(selectCart);
|
const { phone, order, orderType } = useAppSelector(selectCart);
|
||||||
|
const { token } = useAppSelector((state) => state.auth);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Form
|
<Form
|
||||||
@@ -31,7 +32,7 @@ export default function CheckoutPage() {
|
|||||||
<ProHeader>{t("checkout.title")}</ProHeader>
|
<ProHeader>{t("checkout.title")}</ProHeader>
|
||||||
<Layout.Content className={styles.checkoutContainer}>
|
<Layout.Content className={styles.checkoutContainer}>
|
||||||
<AddressSummary />
|
<AddressSummary />
|
||||||
<PhoneCard />
|
{!token && <PhoneCard />}
|
||||||
{orderType === OrderType.ToRoom && (
|
{orderType === OrderType.ToRoom && (
|
||||||
<InputCard
|
<InputCard
|
||||||
title={t("address.roomNo")}
|
title={t("address.roomNo")}
|
||||||
|
|||||||
@@ -44,7 +44,9 @@ export function AddToCartButton({ item }: { item: Product }) {
|
|||||||
(!cartItem.extrasgroupnew || cartItem.extrasgroupnew.length === 0),
|
(!cartItem.extrasgroupnew || cartItem.extrasgroupnew.length === 0),
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
if (restaurant && !restaurant.isOpened) {
|
if (restaurant && !restaurant.isOpened) {
|
||||||
message.warning(t("menu.restaurantIsClosed"));
|
message.warning(t("menu.restaurantIsClosed"));
|
||||||
return;
|
return;
|
||||||
@@ -115,7 +117,9 @@ export function AddToCartButton({ item }: { item: Product }) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePlusClick = () => {
|
const handlePlusClick = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
if (restaurant && !restaurant.isOpened) {
|
if (restaurant && !restaurant.isOpened) {
|
||||||
message.warning(t("menu.restaurantIsClosed"));
|
message.warning(t("menu.restaurantIsClosed"));
|
||||||
return;
|
return;
|
||||||
@@ -163,9 +167,8 @@ export function AddToCartButton({ item }: { item: Product }) {
|
|||||||
position: "absolute",
|
position: "absolute",
|
||||||
bottom: 3,
|
bottom: 3,
|
||||||
[isRTL ? "left" : "right"]: 1,
|
[isRTL ? "left" : "right"]: 1,
|
||||||
backgroundColor: "var(--secondary-background)",
|
background: "#FAFAFA",
|
||||||
borderRadius: 888,
|
borderRadius: 888,
|
||||||
opacity: 0.8,
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
@@ -215,7 +218,7 @@ export function AddToCartButton({ item }: { item: Product }) {
|
|||||||
height: 28,
|
height: 28,
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
bottom: 1,
|
bottom: 1,
|
||||||
[isRTL ? "left" : "right"]: 3,
|
[isRTL ? "left" : "right"]: 2,
|
||||||
minWidth: 28,
|
minWidth: 28,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -236,7 +239,7 @@ export function AddToCartButton({ item }: { item: Product }) {
|
|||||||
size="small"
|
size="small"
|
||||||
icon={
|
icon={
|
||||||
hasOptions ? (
|
hasOptions ? (
|
||||||
<NextIcon iconColor="#fff" iconSize={16} />
|
<NextIcon iconColor="#302E3E" iconSize={16} />
|
||||||
) : (
|
) : (
|
||||||
<PlusOutlined title="add" />
|
<PlusOutlined title="add" />
|
||||||
)
|
)
|
||||||
@@ -244,13 +247,15 @@ export function AddToCartButton({ item }: { item: Product }) {
|
|||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
className={styles.addButton}
|
className={styles.addButton}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: colors.primary,
|
color: "#302E3E",
|
||||||
width: 28,
|
width: 28,
|
||||||
height: 28,
|
height: 28,
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
bottom: 16,
|
bottom: 16,
|
||||||
[isRTL ? "left" : "right"]: 7,
|
[isRTL ? "left" : "right"]: 7,
|
||||||
minWidth: 28,
|
minWidth: 28,
|
||||||
|
boxShadow:
|
||||||
|
"0px 1px 2px 0px #8585851A, 0px 3px 3px 0px #85858517, -1px 7px 4px 0px #8585850D, -1px 13px 5px 0px #85858503, -2px 20px 6px 0px #85858500",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { useAppSelector } from "redux/hooks.ts";
|
|||||||
import { ProductPreviewDialog } from "pages/menu/components/ProductPreviewDialog";
|
import { ProductPreviewDialog } from "pages/menu/components/ProductPreviewDialog";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { AddToCartButton } from "../AddToCartButton/AddToCartButton";
|
import { AddToCartButton } from "../AddToCartButton/AddToCartButton";
|
||||||
|
import { useNavigate, useParams } from "react-router-dom";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
item: Product;
|
item: Product;
|
||||||
@@ -20,6 +21,8 @@ export default function ProductCard({ item }: Props) {
|
|||||||
const { isMobile, isTablet, isDesktop } = useBreakPoint();
|
const { isMobile, isTablet, isDesktop } = useBreakPoint();
|
||||||
const { items } = useAppSelector((state) => state.order);
|
const { items } = useAppSelector((state) => state.order);
|
||||||
const [isDialogOpen, setIsDialogOpen] = useState(false);
|
const [isDialogOpen, setIsDialogOpen] = useState(false);
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const { subdomain } = useParams();
|
||||||
|
|
||||||
// Handle dialog close
|
// Handle dialog close
|
||||||
const handleDialogClose = () => {
|
const handleDialogClose = () => {
|
||||||
@@ -31,10 +34,9 @@ export default function ProductCard({ item }: Props) {
|
|||||||
localStorage.setItem("productId", item.id.toString());
|
localStorage.setItem("productId", item.id.toString());
|
||||||
if (isDesktop) {
|
if (isDesktop) {
|
||||||
setIsDialogOpen(true);
|
setIsDialogOpen(true);
|
||||||
|
} else {
|
||||||
|
navigate(`/${subdomain}/product/${item.id}`);
|
||||||
}
|
}
|
||||||
// else {
|
|
||||||
// navigate(`/${subdomain}/product/${item.id}`);
|
|
||||||
// }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -134,7 +136,7 @@ export default function ProductCard({ item }: Props) {
|
|||||||
style={{
|
style={{
|
||||||
fontSize: "1rem",
|
fontSize: "1rem",
|
||||||
fontWeight: 700,
|
fontWeight: 700,
|
||||||
color: colors.primary,
|
color: "#333333",
|
||||||
textDecoration: "line-through",
|
textDecoration: "line-through",
|
||||||
marginRight: isRTL ? 0 : 10,
|
marginRight: isRTL ? 0 : 10,
|
||||||
marginLeft: isRTL ? 10 : 0,
|
marginLeft: isRTL ? 10 : 0,
|
||||||
@@ -145,9 +147,13 @@ export default function ProductCard({ item }: Props) {
|
|||||||
price={item.price}
|
price={item.price}
|
||||||
strong
|
strong
|
||||||
style={{
|
style={{
|
||||||
fontSize: "1rem",
|
color: "#333333",
|
||||||
fontWeight: 700,
|
fontFamily: "Outfit",
|
||||||
color: colors.primary,
|
fontWeight: 600,
|
||||||
|
fontStyle: "SemiBold",
|
||||||
|
fontSize: "14px",
|
||||||
|
lineHeight: "140%",
|
||||||
|
letterSpacing: "0%",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
|
|||||||
Reference in New Issue
Block a user