navigate to product description always

This commit is contained in:
2025-10-14 23:47:00 +03:00
parent 573666be97
commit c53cd31063
2 changed files with 20 additions and 44 deletions

View File

@@ -41,8 +41,8 @@ export function MenuList({ data, categoryRefs }: MenuListProps) {
// Handle product click - open dialog on desktop, navigate on mobile/tablet
const handleProductClick = (item: Product) => {
localStorage.setItem("product", JSON.stringify(item));
if (isDesktop) {
localStorage.setItem("product", JSON.stringify(item));
if (isDesktop) {
setIsDialogOpen(true);
} else {
navigate(`/${restaurantName}/product/${item.id}`);
@@ -95,17 +95,19 @@ export function MenuList({ data, categoryRefs }: MenuListProps) {
}}
style={{ marginBottom: "1rem" }}
>
{!isDesktop && <ImageWithFallback
src={category.image || "/default.png"}
fallbackSrc="/default.png"
alt={category.name}
width="100%"
height={130}
className={styles.categoryMenuItemImage}
loadingContainerStyle={{
width: "100%",
}}
/>}
{!isDesktop && (
<ImageWithFallback
src={category.image || "/default.png"}
fallbackSrc="/default.png"
alt={category.name}
width="100%"
height={130}
className={styles.categoryMenuItemImage}
loadingContainerStyle={{
width: "100%",
}}
/>
)}
<ProTitle
style={{
fontSize: "1.25rem",
@@ -251,7 +253,7 @@ export function MenuList({ data, categoryRefs }: MenuListProps) {
height={90}
/>
<AddToCartButton item={item} />
<AddToCartButton />
{items.find((i) => i.id === item.id) && (
<Badge