@@ -25,13 +25,13 @@ import { createPortal } from 'react-dom';
2525import { Helmet } from 'react-helmet-async' ;
2626import { useIntl } from 'react-intl' ;
2727import { Navigate , Outlet } from 'react-router-dom' ;
28+ import { useFlags } from '~adapters/helpers/feature-flags' ;
2829import { useCurrentBranchQuery } from '~adapters/queries/branch' ;
2930import { CenteredLayout } from '~design-system' ;
3031import { useLocation , useRouter } from '~shared/components/hoc/withRouter' ;
3132import { isFile , isPortfolioLike } from '~shared/helpers/component' ;
3233import { isDefined } from '~shared/helpers/types' ;
3334import { getProjectOverviewUrl } from '~shared/helpers/urls' ;
34- import { useNewUI } from '~shared/helpers/useNewUI' ;
3535import { ComponentQualifier } from '~shared/types/component' ;
3636import { HttpStatus } from '~shared/types/request' ;
3737import { validateProjectAlmBinding } from '~sq-server-commons/api/alm-settings' ;
@@ -71,7 +71,7 @@ function ComponentContainer({ hasFeature }: Readonly<WithAvailableFeaturesProps>
7171 } = useLocation ( ) ;
7272 const router = useRouter ( ) ;
7373 const intl = useIntl ( ) ;
74- const [ newUI ] = useNewUI ( ) ;
74+ const { frontEndEngineeringEnableSidebarNavigation } = useFlags ( ) ;
7575
7676 const [ component , setComponent ] = React . useState < Component > ( ) ;
7777 const [ projectComponent , setProjectComponent ] = React . useState < Component > ( ) ;
@@ -401,16 +401,20 @@ function ComponentContainer({ hasFeature }: Readonly<WithAvailableFeaturesProps>
401401 { project : component ?. name ?? '' } ,
402402 ) }
403403 />
404- { newUI && component && ! isFile ( component . qualifier ) && < ComponentNav component = { component } /> }
404+ { frontEndEngineeringEnableSidebarNavigation && component && ! isFile ( component . qualifier ) && (
405+ < ComponentNav component = { component } />
406+ ) }
405407 < Layout . ContentGrid >
406- { ! newUI && component && ! isFile ( component . qualifier ) && (
407- < LegacyComponentNavCompatibleWithNewLayout
408- component = { component }
409- isInProgress = { isInProgress }
410- isPending = { isPending }
411- projectBindingErrors = { projectBindingErrors }
412- />
413- ) }
408+ { ! frontEndEngineeringEnableSidebarNavigation &&
409+ component &&
410+ ! isFile ( component . qualifier ) && (
411+ < LegacyComponentNavCompatibleWithNewLayout
412+ component = { component }
413+ isInProgress = { isInProgress }
414+ isPending = { isPending }
415+ projectBindingErrors = { projectBindingErrors }
416+ />
417+ ) }
414418 < Layout . PageGrid >
415419 < Layout . PageContent >
416420 { loading ? (
0 commit comments