Skip to content

Commit 93c2ef1

Browse files
committed
Update breadcrumbs in Quotas after mobx migration
1 parent 48cd773 commit 93c2ef1

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

frontend/src/components/pages/quotas/quotas-list.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Alert, AlertIcon, Button, DataTable, Result, Skeleton } from '@redpanda
1414
import { useQuery } from '@tanstack/react-query';
1515
import { SkipIcon } from 'components/icons';
1616
import { config } from 'config';
17-
import { useLayoutEffect, useMemo } from 'react';
17+
import { useMemo } from 'react';
1818

1919
import {
2020
Quota_EntityType,
@@ -23,7 +23,6 @@ import {
2323
} from '../../../protogen/redpanda/api/dataplane/v1/quota_pb';
2424
import { listQuotas } from '../../../protogen/redpanda/api/dataplane/v1/quota-QuotaService_connectquery';
2525
import type { QuotaResponse, QuotaResponseSetting } from '../../../state/rest-interfaces';
26-
import { uiState } from '../../../state/ui-state';
2726
import { InfoText } from '../../../utils/tsx-utils';
2827
import { prettyBytes, prettyNumber } from '../../../utils/utils';
2928
import PageContent from '../../misc/page-content';
@@ -97,13 +96,6 @@ const useQuotasQuery = () => {
9796
};
9897

9998
const QuotasList = () => {
100-
// Set page title and breadcrumbs using useLayoutEffect for synchronous execution
101-
// This runs before browser paint, ensuring header renders immediately (fixes CI E2E tests)
102-
useLayoutEffect(() => {
103-
uiState.pageBreadcrumbs = [{ title: 'Quotas', linkTo: '/quotas' }];
104-
uiState.pageTitle = 'Quotas';
105-
}, []);
106-
10799
const { data, error, isLoading } = useQuotasQuery();
108100

109101
const quotasData = useMemo(() => {

frontend/src/routes/quotas.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111

1212
import { createFileRoute } from '@tanstack/react-router';
1313
import { ScaleIcon } from 'components/icons';
14+
import { useLayoutEffect } from 'react';
1415

1516
import QuotasList from '../components/pages/quotas/quotas-list';
17+
import { uiState } from '../state/ui-state';
1618

1719
export const Route = createFileRoute('/quotas')({
1820
staticData: {
@@ -23,5 +25,11 @@ export const Route = createFileRoute('/quotas')({
2325
});
2426

2527
function QuotasWrapper() {
28+
// Set page title and breadcrumbs in route wrapper for early execution
29+
useLayoutEffect(() => {
30+
uiState.pageBreadcrumbs = [{ title: 'Quotas', linkTo: '' }];
31+
uiState.pageTitle = 'Quotas';
32+
}, []);
33+
2634
return <QuotasList />;
2735
}

0 commit comments

Comments
 (0)