From a7d9591c44b3686221695d28f6e794484b5cba30 Mon Sep 17 00:00:00 2001 From: anmolsinghbhatia Date: Tue, 25 Apr 2023 18:02:13 +0530 Subject: [PATCH] feat: product updates tag and date added --- .../components/ui/product-updates-modal.tsx | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/apps/app/components/ui/product-updates-modal.tsx b/apps/app/components/ui/product-updates-modal.tsx index b37517343..b3388d31e 100644 --- a/apps/app/components/ui/product-updates-modal.tsx +++ b/apps/app/components/ui/product-updates-modal.tsx @@ -3,10 +3,14 @@ import useSWR from "swr"; // headless ui import { Dialog, Transition } from "@headlessui/react"; +// component +import { MarkdownRenderer, Spinner } from "components/ui"; // icons import { XMarkIcon } from "@heroicons/react/20/solid"; +// services import workspaceService from "services/workspace.service"; -import { MarkdownRenderer } from "components/ui"; +// helper +import { renderLongDateFormat } from "helpers/date-time.helper"; type Props = { isOpen: boolean; @@ -15,7 +19,6 @@ type Props = { export const ProductUpdatesModal: React.FC = ({ isOpen, setIsOpen }) => { const { data: updates } = useSWR("PRODUCT_UPDATES", () => workspaceService.getProductUpdates()); - console.log("updates:", updates); return ( @@ -60,9 +63,29 @@ export const ProductUpdatesModal: React.FC = ({ isOpen, setIsOpen }) => { - {updates && - updates.length > 0 && - updates.map((item: any) => )} + {updates && updates.length > 0 ? ( + updates.map((item: any, index: number) => ( + <> +
+ + {item.tag_name} + + {renderLongDateFormat(item.published_at)} + {index === 0 && ( + + New + + )} +
+ + + )) + ) : ( +
+ + Loading... +
+ )}