fix: Update analytics page layout fixes (#2623)

This commit is contained in:
sriram veeraghanta 2023-11-03 00:09:13 +05:30 committed by GitHub
parent 3c884fd46e
commit 5efc6993cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,57 +58,55 @@ const AnalyticsPage: NextPageWithLayout = observer(() => {
}, [user, workspaceSlug]); }, [user, workspaceSlug]);
return ( return (
<AppLayout header={<WorkspaceAnalyticsHeader />}> <>
<> {projects && projects.length > 0 ? (
{projects && projects.length > 0 ? ( <div className="h-full flex flex-col overflow-hidden bg-custom-background-100">
<div className="h-full flex flex-col overflow-hidden bg-custom-background-100"> <Tab.Group as={Fragment}>
<Tab.Group as={Fragment}> <Tab.List as="div" className="space-x-2 border-b border-custom-border-200 px-5 py-3">
<Tab.List as="div" className="space-x-2 border-b border-custom-border-200 px-5 py-3"> {ANALYTICS_TABS.map((tab) => (
{ANALYTICS_TABS.map((tab) => ( <Tab
<Tab key={tab.key}
key={tab.key} className={({ selected }) =>
className={({ selected }) => `rounded-3xl border border-custom-border-200 px-4 py-2 text-xs hover:bg-custom-background-80 ${
`rounded-3xl border border-custom-border-200 px-4 py-2 text-xs hover:bg-custom-background-80 ${ selected ? "bg-custom-background-80" : ""
selected ? "bg-custom-background-80" : "" }`
}` }
} onClick={() => trackAnalyticsEvent(tab.key)}
onClick={() => trackAnalyticsEvent(tab.key)} >
> {tab.title}
{tab.title} </Tab>
</Tab> ))}
))} </Tab.List>
</Tab.List> <Tab.Panels as={Fragment}>
<Tab.Panels as={Fragment}> <Tab.Panel as={Fragment}>
<Tab.Panel as={Fragment}> <ScopeAndDemand fullScreen />
<ScopeAndDemand fullScreen /> </Tab.Panel>
</Tab.Panel> <Tab.Panel as={Fragment}>
<Tab.Panel as={Fragment}> <CustomAnalytics fullScreen />
<CustomAnalytics fullScreen /> </Tab.Panel>
</Tab.Panel> </Tab.Panels>
</Tab.Panels> </Tab.Group>
</Tab.Group> </div>
</div> ) : (
) : ( <>
<> <EmptyState
<EmptyState title="You can see your all projects' analytics here"
title="You can see your all projects' analytics here" description="Let's create your first project and analyze the stats with various graphs."
description="Let's create your first project and analyze the stats with various graphs." image={emptyAnalytics}
image={emptyAnalytics} primaryButton={{
primaryButton={{ icon: <Plus className="h-4 w-4" />,
icon: <Plus className="h-4 w-4" />, text: "New Project",
text: "New Project", onClick: () => {
onClick: () => { const e = new KeyboardEvent("keydown", {
const e = new KeyboardEvent("keydown", { key: "p",
key: "p", });
}); document.dispatchEvent(e);
document.dispatchEvent(e); },
}, }}
}} />
/> </>
</> )}
)} </>
</>
</AppLayout>
); );
}); });