update restaurant details source & add loyalty icon
This commit is contained in:
@@ -658,14 +658,18 @@
|
||||
height: 60;
|
||||
}
|
||||
|
||||
.heartButton {
|
||||
.loyaltyButton {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
top: 1px;
|
||||
left: 1px;
|
||||
z-index: 99;
|
||||
background-color: var(--primary) !important;
|
||||
color: white !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
:global(.rtl) .heartButton {
|
||||
right: 5px;
|
||||
:global(.ant-app-rtl) .loyaltyButton {
|
||||
right: 1px !important;
|
||||
}
|
||||
|
||||
.productLink {
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user