From 6a01af0c923b200fbcf66a01a48504d7894f49e6 Mon Sep 17 00:00:00 2001 From: RaviAnand Mohabir Date: Wed, 28 Aug 2024 08:56:49 +0200 Subject: [PATCH] feat: :sparkles: remove popover if tag doesn't have description --- .../[locale]/menu/menu-item-tag.tsx | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/app/(frontend)/[locale]/menu/menu-item-tag.tsx b/src/app/(frontend)/[locale]/menu/menu-item-tag.tsx index 255b63a..c8779fc 100644 --- a/src/app/(frontend)/[locale]/menu/menu-item-tag.tsx +++ b/src/app/(frontend)/[locale]/menu/menu-item-tag.tsx @@ -1,26 +1,24 @@ -import { Box, HStack, Stack } from "@styled-system/jsx"; -import { Media, MenuItemTag } from "@/payload-types"; +import type { MenuItemTag } from "@/payload-types"; +import { Box } from "@styled-system/jsx"; -import { HoverCard } from "@/components/ui/hover-card"; -import { IconButton } from "@/components/ui/icon-button"; -import Image from "next/image"; -import { Image as ImageIcon } from "lucide-react"; -import { Locale } from "@/i18n/settings"; -import MenuItemImage from "@/app/(frontend)/[locale]/menu/menu-item-image"; import RichText from "@/components/rich-text"; -import { TabContentBaseProps } from "@ark-ui/react"; -import { Tabs } from "@/components/ui/tabs"; -import { Text } from "@/components/ui/text"; +import { HoverCard } from "@/components/ui/hover-card"; import { css } from "@styled-system/css"; -import { formatToCHF } from "@/utils/formatters"; -import { getMenuItems } from "@/api"; export default function MenuItemTag({ tag }: { tag: MenuItemTag }) { + if (!tag.description) { + return ( + + {tag.name} + + ); + } + return ( - {(tag as MenuItemTag).name} + {tag.name} @@ -28,12 +26,7 @@ export default function MenuItemTag({ tag }: { tag: MenuItemTag }) { - {(tag as MenuItemTag).description !== undefined && ( - - )} +