diff --git a/frontend/src/component/layout/MainLayout/MainLayout.tsx b/frontend/src/component/layout/MainLayout/MainLayout.tsx index 6012fa7174..29393cdbfd 100644 --- a/frontend/src/component/layout/MainLayout/MainLayout.tsx +++ b/frontend/src/component/layout/MainLayout/MainLayout.tsx @@ -1,5 +1,5 @@ import { forwardRef, type ReactNode } from 'react'; -import { Grid, styled } from '@mui/material'; +import { Box, Grid, styled } from '@mui/material'; import Header from 'component/menu/Header/Header'; import Footer from 'component/menu/Footer/Footer'; import Proclamation from 'component/common/Proclamation/Proclamation'; @@ -14,6 +14,8 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/Condit import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled'; import { DraftBanner } from './DraftBanner/DraftBanner'; import { ThemeMode } from 'component/common/ThemeMode/ThemeMode'; +import { NavigationSidebar } from './NavigationSidebar/NavigationSidebar'; +import { useUiFlag } from 'hooks/useUiFlag'; interface IMainLayoutProps { children: ReactNode; @@ -102,6 +104,7 @@ export const MainLayout = forwardRef( ); const StyledMainLayoutContent = SpaciousMainLayoutContent; + const sidebarNavigationEnabled = useUiFlag('navigationSidebar'); return ( <> @@ -117,13 +120,25 @@ export const MainLayout = forwardRef( )} show={} /> - - - - - {children} - - + + } + /> + + + + + {children} + + + + ({ + fill: theme.palette.neutral.main, + stroke: theme.palette.neutral.main, + // same as built-in icons + width: theme.spacing(3), + height: theme.spacing(3), + fontSize: theme.spacing(3), +})); + +const StyledListItem: FC<{ href: string; text: string }> = ({ + href, + text, + children, +}) => { + return ( + + + ({ minWidth: theme.spacing(4) })}> + {children} + + + + + ); +}; + +export const StyledBox = styled(Box)(({ theme }) => ({ + backgroundColor: theme.palette.background.paper, + pt: theme.spacing(3), + pb: theme.spacing(3), + minHeight: '95vh', +})); + +export const NavigationSidebar = () => { + return ( + + + + + + + + + + + + + + + + + } + aria-controls='configure-content' + id='configure-header' + > + + Configure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + aria-controls='admin-content' + id='admin-header' + > + + Admin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts index bfa553d0cf..84cc743592 100644 --- a/frontend/src/interfaces/uiConfig.ts +++ b/frontend/src/interfaces/uiConfig.ts @@ -87,6 +87,7 @@ export type UiFlags = { newCreateProjectUI?: boolean; manyStrategiesPagination?: boolean; enableLegacyVariants?: boolean; + navigationSidebar?: boolean; }; export interface IVersionInfo { diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index f845bd03b6..3827498a33 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -135,6 +135,7 @@ exports[`should create default config 1`] = ` }, }, "migrationLock": true, + "navigationSidebar": false, "newCreateProjectUI": false, "outdatedSdksBanner": false, "parseProjectFromSession": false, diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index b32105dccc..655edc52b2 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -63,7 +63,8 @@ export type IFlagKey = | 'manyStrategiesPagination' | 'newCreateProjectUI' | 'enableLegacyVariants' - | 'debugMetrics'; + | 'debugMetrics' + | 'navigationSidebar'; export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>; @@ -304,6 +305,10 @@ const flags: IFlags = { process.env.UNLEASH_EXPERIMENTAL_DEBUG_METRICS, false, ), + navigationSidebar: parseEnvVarBoolean( + process.env.UNLEASH_EXPERIMENTAL_SIDEBAR_NAVIGATION, + false, + ), }; export const defaultExperimentalOptions: IExperimentalOptions = { diff --git a/src/server-dev.ts b/src/server-dev.ts index aee1a815f0..a03ec4938c 100644 --- a/src/server-dev.ts +++ b/src/server-dev.ts @@ -56,6 +56,7 @@ process.nextTick(async () => { createProjectWithEnvironmentConfig: true, manyStrategiesPagination: true, enableLegacyVariants: false, + navigationSidebar: true, }, }, authentication: {