update restaurant details source & add loyalty icon

This commit is contained in:
2025-10-20 21:42:48 +03:00
parent c7f5620f5a
commit 6a6f92aefc
15 changed files with 305 additions and 205 deletions

View File

@@ -1,4 +1,5 @@
import { Badge, Card } from "antd";
import { StarOutlined } from "@ant-design/icons";
import { Badge, Button, Card } from "antd";
import ArabicPrice from "components/ArabicPrice";
import ImageWithFallback from "components/ImageWithFallback";
import { ItemDescriptionIcons } from "components/ItemDescriptionIcons/ItemDescriptionIcons";
@@ -9,7 +10,7 @@ import { AddToCartButton } from "pages/menu/components/AddToCartButton/AddToCart
import { ProductPreviewDialog } from "pages/menu/components/ProductPreviewDialog";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
import { useNavigate, useParams } from "react-router-dom";
import { useAppSelector } from "redux/hooks";
import { colors } from "ThemeConstants";
import { Product } from "utils/types/appTypes";
@@ -31,7 +32,7 @@ export function MenuList({ data, categoryRefs }: MenuListProps) {
const products = data?.products;
const { isMobile, isTablet, isDesktop } = useBreakPoint();
const { items } = useAppSelector((state) => state.order);
const restaurantName = localStorage.getItem("restaurantName");
const { id } = useParams();
const navigate = useNavigate();
const { t } = useTranslation();
const { themeName } = useAppSelector((state) => state.theme);
@@ -45,7 +46,7 @@ export function MenuList({ data, categoryRefs }: MenuListProps) {
if (isDesktop) {
setIsDialogOpen(true);
} else {
navigate(`/${restaurantName}/product/${item.id}`);
navigate(`/${id}/product/${item.id}`);
}
};
@@ -238,6 +239,14 @@ export function MenuList({ data, categoryRefs }: MenuListProps) {
</div>
</div>
<div style={{ position: "relative" }}>
{item.isHasLoyalty && (
<Button
className={styles.loyaltyButton}
icon={<StarOutlined />}
style={{ width: 24, height: 24 }}
/>
)}
<ImageWithFallback
src={item.image_small || "/default.png"}
fallbackSrc="/default.png"