mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-31 13:47:02 +02:00
feat: show only link to /admin in mobile menu (#9647)
This commit is contained in:
parent
b55732d719
commit
5a55181561
@ -12,6 +12,7 @@ import {
|
|||||||
SecondaryNavigation,
|
SecondaryNavigation,
|
||||||
SecondaryNavigationList,
|
SecondaryNavigationList,
|
||||||
AdminSettingsNavigation,
|
AdminSettingsNavigation,
|
||||||
|
AdminSettingsLink,
|
||||||
} from './NavigationList';
|
} from './NavigationList';
|
||||||
import { FullListItem, MiniListItem } from './ListItems';
|
import { FullListItem, MiniListItem } from './ListItems';
|
||||||
import { useInitialPathname } from './useInitialPathname';
|
import { useInitialPathname } from './useInitialPathname';
|
||||||
@ -35,6 +36,7 @@ export const MobileNavigationSidebar: FC<{
|
|||||||
NewInUnleash?: typeof NewInUnleash;
|
NewInUnleash?: typeof NewInUnleash;
|
||||||
}> = ({ onClick, NewInUnleash }) => {
|
}> = ({ onClick, NewInUnleash }) => {
|
||||||
const { routes } = useRoutes();
|
const { routes } = useRoutes();
|
||||||
|
const newAdminUIEnabled = useUiFlag('adminNavUI');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -45,11 +47,15 @@ export const MobileNavigationSidebar: FC<{
|
|||||||
mode='full'
|
mode='full'
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
/>
|
/>
|
||||||
<SecondaryNavigationList
|
{newAdminUIEnabled ? (
|
||||||
routes={routes.adminRoutes}
|
<AdminSettingsLink mode={'full'} onClick={onClick} />
|
||||||
mode='full'
|
) : (
|
||||||
onClick={onClick}
|
<SecondaryNavigationList
|
||||||
/>
|
routes={routes.adminRoutes}
|
||||||
|
mode='full'
|
||||||
|
onClick={onClick}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<OtherLinksList />
|
<OtherLinksList />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { VFC } from 'react';
|
import type { VFC } from 'react';
|
||||||
import { Link, useLocation } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { Divider, Drawer, styled } from '@mui/material';
|
import { Divider, Drawer, styled } from '@mui/material';
|
||||||
import { ReactComponent as UnleashLogo } from 'assets/img/logoDarkWithText.svg';
|
import { ReactComponent as UnleashLogo } from 'assets/img/logoDarkWithText.svg';
|
||||||
import { ReactComponent as UnleashLogoWhite } from 'assets/img/logoWithWhiteText.svg';
|
import { ReactComponent as UnleashLogoWhite } from 'assets/img/logoWithWhiteText.svg';
|
||||||
@ -8,8 +8,8 @@ import theme from 'themes/theme';
|
|||||||
import { ThemeMode } from 'component/common/ThemeMode/ThemeMode';
|
import { ThemeMode } from 'component/common/ThemeMode/ThemeMode';
|
||||||
import { MobileNavigationSidebar } from 'component/layout/MainLayout/NavigationSidebar/NavigationSidebar';
|
import { MobileNavigationSidebar } from 'component/layout/MainLayout/NavigationSidebar/NavigationSidebar';
|
||||||
import { NewInUnleash } from 'component/layout/MainLayout/NavigationSidebar/NewInUnleash/NewInUnleash';
|
import { NewInUnleash } from 'component/layout/MainLayout/NavigationSidebar/NewInUnleash/NewInUnleash';
|
||||||
import { useUiFlag } from 'hooks/useUiFlag';
|
|
||||||
import { AdminMobileNavigation } from 'component/layout/MainLayout/AdminMenu/AdminNavigationItems';
|
import { AdminMobileNavigation } from 'component/layout/MainLayout/AdminMenu/AdminNavigationItems';
|
||||||
|
import { useNewAdminMenu } from 'hooks/useNewAdminMenu';
|
||||||
|
|
||||||
const StyledDrawerHeader = styled('div')(({ theme }) => ({
|
const StyledDrawerHeader = styled('div')(({ theme }) => ({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
@ -33,10 +33,7 @@ export const DrawerMenu: VFC<IDrawerMenuProps> = ({
|
|||||||
open = false,
|
open = false,
|
||||||
toggleDrawer,
|
toggleDrawer,
|
||||||
}) => {
|
}) => {
|
||||||
const newAdminUIEnabled = useUiFlag('adminNavUI');
|
const showOnlyAdminMenu = useNewAdminMenu();
|
||||||
const location = useLocation();
|
|
||||||
const showOnlyAdminMenu =
|
|
||||||
newAdminUIEnabled && location.pathname.indexOf('/admin') === 0;
|
|
||||||
const onClick = () => {
|
const onClick = () => {
|
||||||
toggleDrawer();
|
toggleDrawer();
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user