mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-28 17:55:15 +02:00
## About the changes - [x] Show admin menu on billing page in cloud offering. Category menu was not showing up because we have 2 different pages for billing (hosted or not) - [x] Fix menu tab padding https://linear.app/unleash/issue/1-1266/update-menu-for-billing-page
60 lines
1.9 KiB
TypeScript
60 lines
1.9 KiB
TypeScript
import { lazy } from 'react';
|
|
|
|
import { Tab, Tabs } from '@mui/material';
|
|
import { Route, Routes, useLocation } from 'react-router-dom';
|
|
import { CenteredNavLink } from '../menu/CenteredNavLink';
|
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
|
|
|
const NetworkOverview = lazy(() => import('./NetworkOverview/NetworkOverview'));
|
|
const NetworkTraffic = lazy(() => import('./NetworkTraffic/NetworkTraffic'));
|
|
|
|
const tabs = [
|
|
{
|
|
label: 'Overview',
|
|
path: '/admin/network',
|
|
},
|
|
{
|
|
label: 'Traffic',
|
|
path: '/admin/network/traffic',
|
|
},
|
|
];
|
|
|
|
export const Network = () => {
|
|
const { pathname } = useLocation();
|
|
|
|
return (
|
|
<div>
|
|
<PageContent
|
|
withTabs
|
|
header={
|
|
<Tabs
|
|
value={pathname}
|
|
indicatorColor="primary"
|
|
textColor="primary"
|
|
variant="scrollable"
|
|
allowScrollButtonsMobile
|
|
>
|
|
{tabs.map(({ label, path }) => (
|
|
<Tab
|
|
key={label}
|
|
value={path}
|
|
label={
|
|
<CenteredNavLink to={path}>
|
|
<span>{label}</span>
|
|
</CenteredNavLink>
|
|
}
|
|
sx={{ padding: 0 }}
|
|
/>
|
|
))}
|
|
</Tabs>
|
|
}
|
|
>
|
|
<Routes>
|
|
<Route path="traffic" element={<NetworkTraffic />} />
|
|
<Route path="*" element={<NetworkOverview />} />
|
|
</Routes>
|
|
</PageContent>
|
|
</div>
|
|
);
|
|
};
|