Skip to content

Commit

Permalink
feat: Save active tab in url for infra dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
svc-shorpo committed Jan 10, 2024
1 parent c2d35cb commit d48bc1d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/app/src/ServiceDashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ const CHART_HEIGHT = 300;
const DB_STATEMENT_PROPERTY = 'db.statement';

export default function ServiceDashboardPage() {
const [activeTab, setActiveTab] = useQueryParam(
'tab',
withDefault(StringParam, 'infrastructure'),
{ updateType: 'replaceIn' },
);

const [searchQuery, setSearchQuery] = useQueryParam(
'q',
withDefault(StringParam, ''),
Expand Down Expand Up @@ -387,6 +393,9 @@ export default function ServiceDashboardPage() {
variant="pills"
defaultValue="infrastructure"
radius="md"
keepMounted={false}
value={activeTab}
onTabChange={setActiveTab}
>
<div className="px-3 py-2 border-bottom border-dark">
<Tabs.List>
Expand Down

0 comments on commit d48bc1d

Please sign in to comment.