Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
feat: persistent event tab selection
vicke42c0b7a64084d
diff --git a/src/app/(main)/websites/[websiteId]/events/EventsPage.tsx b/src/app/(main)/websites/[websiteId]/events/EventsPage.tsxindex 285a230e8..259e77be7 100644--- a/src/app/(main)/websites/[websiteId]/events/EventsPage.tsx+++ b/src/app/(main)/websites/[websiteId]/events/EventsPage.tsx@@ -9,16 +9,22 @@ import { useMessages } from '@/components/hooks';import { Item, Tabs } from 'react-basics';import { useState } from 'react';import EventProperties from './EventProperties';+import { getItem, setItem } from '@/lib/storage';export default function EventsPage({ websiteId }) {const [label, setLabel] = useState(null);- const [tab, setTab] = useState('activity');+ const [tab, setTab] = useState(getItem('eventTab') || 'activity');const { formatMessage, labels } = useMessages();const handleLabelClick = (value: string) => {setLabel(value !== label ? value : '');};+ const onSelect = (value: any) => {+ setItem('eventTab', value);+ setTab(value);+ };+return (<><WebsiteHeader websiteId={websiteId} />@@ -34,11 +40,7 @@ export default function EventsPage({ websiteId }) {/></GridRow><div>- <Tabs- selectedKey={tab}- onSelect={(value: any) => setTab(value)}- style={{ marginBottom: 30 }}- >+ <Tabs selectedKey={tab} onSelect={onSelect} style={{ marginBottom: 30 }}><Item key="activity">{formatMessage(labels.activity)}</Item><Item key="properties">{formatMessage(labels.properties)}</Item></Tabs>