Skip to content

Commit 1c0ca89

Browse files
MekloHugo Marcellin
andauthored
Remove TabNavLink wrapper (#28)
Co-authored-by: Hugo Marcellin <[email protected]>
1 parent a9d9592 commit 1c0ca89

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

src/components/App/app-top-bar.tsx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
useMemo,
1414
useState,
1515
} from 'react';
16-
import { capitalize, Tab, TabProps, Tabs, useTheme } from '@mui/material';
16+
import { capitalize, Tab, Tabs, useTheme } from '@mui/material';
1717
import { PeopleAlt } from '@mui/icons-material';
1818
import { logout, TopBar } from '@gridsuite/commons-ui';
1919
import { useParameterState } from '../parameters';
@@ -32,28 +32,19 @@ import AppPackage from '../../../package.json';
3232
import { AppState } from '../../redux/reducer';
3333
import { MainPaths } from '../../routes';
3434

35-
const TabNavLink: FunctionComponent<TabProps & { href: string }> = (
36-
props,
37-
context
38-
) => (
39-
<Tab
40-
{...props}
41-
iconPosition="start"
42-
LinkComponent={forwardRef((props, ref) => (
43-
<NavLink ref={ref} to={props.href} {...props} />
44-
))}
45-
/>
46-
);
47-
4835
const tabs = new Map<MainPaths, ReactElement>([
4936
[
5037
MainPaths.users,
51-
<TabNavLink
38+
<Tab
5239
icon={<PeopleAlt />}
5340
label={<FormattedMessage id="appBar.tabs.users" />}
5441
href={`/${MainPaths.users}`}
5542
value={MainPaths.users}
5643
key={`tab-${MainPaths.users}`}
44+
iconPosition="start"
45+
LinkComponent={forwardRef((props, ref) => (
46+
<NavLink ref={ref} to={props.href} {...props} />
47+
))}
5748
/>,
5849
],
5950
]);

0 commit comments

Comments
 (0)