From e47ab573a7022f90e1458dbe1a7e94b858fe5e71 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Tue, 28 May 2024 11:53:57 +0530 Subject: [PATCH] chore: analytics tab enhancement (#4615) --- .../analytics/project-modal/main-content.tsx | 29 +++++++++--------- web/pages/[workspaceSlug]/analytics.tsx | 30 +++++++++---------- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/web/components/analytics/project-modal/main-content.tsx b/web/components/analytics/project-modal/main-content.tsx index 030760a1c..e91282801 100644 --- a/web/components/analytics/project-modal/main-content.tsx +++ b/web/components/analytics/project-modal/main-content.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { Fragment } from "react"; import { observer } from "mobx-react"; import { Tab } from "@headlessui/react"; import { ICycle, IModule, IProject } from "@plane/types"; @@ -20,20 +20,21 @@ export const ProjectAnalyticsModalMainContent: React.FC = observer((props return ( - + {ANALYTICS_TABS.map((tab) => ( - - `rounded-0 w-full md:w-max md:rounded-3xl border-b md:border border-custom-border-200 focus:outline-none px-0 md:px-4 py-2 text-xs hover:bg-custom-background-80 ${ - selected - ? "border-custom-primary-100 text-custom-primary-100 md:bg-custom-background-80 md:text-custom-text-200 md:border-custom-border-200" - : "border-transparent" - }` - } - onClick={() => {}} - > - {tab.title} + + {({ selected }) => ( + + )} ))} diff --git a/web/pages/[workspaceSlug]/analytics.tsx b/web/pages/[workspaceSlug]/analytics.tsx index 75e6be7f9..499efc917 100644 --- a/web/pages/[workspaceSlug]/analytics.tsx +++ b/web/pages/[workspaceSlug]/analytics.tsx @@ -34,23 +34,21 @@ const AnalyticsPage: NextPageWithLayout = observer(() => { {workspaceProjectIds && workspaceProjectIds.length > 0 ? (
- + {ANALYTICS_TABS.map((tab) => ( - - `rounded-0 w-full border-b border-custom-border-200 px-0 py-2 text-xs hover:bg-custom-background-80 focus:outline-none md:w-max md:rounded-3xl md:border md:px-4 ${ - selected - ? "border-custom-primary-100 text-custom-primary-100 md:border-custom-border-200 md:bg-custom-background-80 md:text-custom-text-200" - : "border-transparent" - }` - } - onClick={() => { - router.query.analytics_tab = tab.key; - router.push(router); - }} - > - {tab.title} + + {({ selected }) => ( + + )} ))}