Skip to content

Commit 463aa07

Browse files
committed
fix: review fixes
1 parent 5dcff7a commit 463aa07

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export function TenantOverview({
200200
<div className={b()}>
201201
<div className={b('info')}>
202202
<Flex alignItems="center" gap="2" className={b('top-label')}>
203-
<div>{tenantType}</div>
203+
{tenantType}
204204
{monitoringTabAvailable && (
205205
<Button view="normal" onClick={handleOpenMonitoring}>
206206
<Icon data={DisplayPulse} size={16} />

src/routes.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22

33
import type {Location} from 'history';
44
import isEmpty from 'lodash/isEmpty';
5-
import {compile} from 'path-to-regexp';
5+
import {compile, match} from 'path-to-regexp';
66
import qs from 'qs';
77
import type {QueryParamConfig} from 'use-query-params';
88
import {StringParam} from 'use-query-params';
@@ -26,7 +26,7 @@ export const TABLET = 'tablet';
2626
const routes = {
2727
clusters: `/${CLUSTERS}`,
2828
cluster: `/:environment?/${CLUSTER}/:activeTab?`,
29-
tenant: `/${TENANT}`,
29+
tenant: `/:environment?/${TENANT}`,
3030
node: `/:environment?/${NODE}/:id/:activeTab?`,
3131
pDisk: `/:environment?/${PDISK}`,
3232
vDisk: `/:environment?/${VDISK}`,
@@ -210,9 +210,11 @@ export function useTabletPagePath() {
210210
}
211211

212212
export function checkIsClustersPage(pathname: string) {
213-
return pathname.endsWith(routes.clusters);
213+
const matchFn = match(routes.clusters);
214+
return Boolean(matchFn(pathname));
214215
}
215216

216217
export function checkIsTenantPage(pathname: string) {
217-
return pathname.endsWith(routes.tenant);
218+
const matchFn = match(routes.tenant);
219+
return Boolean(matchFn(pathname));
218220
}

0 commit comments

Comments
 (0)