File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 22
33import ProgressionSidebar from '@node-core/ui-components/Common/ProgressionSidebar' ;
44import { usePathname } from 'next/navigation' ;
5- import { useTranslations , type RichTranslationValues } from 'next-intl' ;
5+ import {
6+ useLocale ,
7+ useTranslations ,
8+ type RichTranslationValues ,
9+ } from 'next-intl' ;
610import type { FC } from 'react' ;
711
812import Link from '@/components/Link' ;
@@ -21,6 +25,7 @@ const WithProgressionSidebar: FC<WithProgressionSidebarProps> = ({
2125} ) => {
2226 const { getSideNavigation } = useSiteNavigation ( ) ;
2327 const pathname = usePathname ( ) ;
28+ const locale = useLocale ( ) ;
2429 const t = useTranslations ( ) ;
2530 const { push } = useRouter ( ) ;
2631 const [ [ , sidebarNavigation ] ] = getSideNavigation ( [ navKey ] , context ) ;
@@ -35,7 +40,7 @@ const WithProgressionSidebar: FC<WithProgressionSidebarProps> = ({
3540 return (
3641 < ProgressionSidebar
3742 groups = { mappedProgressionSidebarItems }
38- pathname = { pathname ! }
43+ pathname = { pathname ?. replace ( `/ ${ locale } ` , '' ) }
3944 title = { t ( 'components.common.sidebar.title' ) }
4045 onSelect = { push }
4146 as = { Link }
Original file line number Diff line number Diff line change 22
33import Sidebar from '@node-core/ui-components/Containers/Sidebar' ;
44import { usePathname } from 'next/navigation' ;
5- import { useTranslations , type RichTranslationValues } from 'next-intl' ;
5+ import {
6+ useLocale ,
7+ useTranslations ,
8+ type RichTranslationValues ,
9+ } from 'next-intl' ;
610import type { FC } from 'react' ;
711
812import Link from '@/components/Link' ;
@@ -18,6 +22,7 @@ type WithSidebarProps = {
1822const WithSidebar : FC < WithSidebarProps > = ( { navKeys, context } ) => {
1923 const { getSideNavigation } = useSiteNavigation ( ) ;
2024 const pathname = usePathname ( ) ! ;
25+ const locale = useLocale ( ) ;
2126 const t = useTranslations ( ) ;
2227 const { push } = useRouter ( ) ;
2328
@@ -31,7 +36,7 @@ const WithSidebar: FC<WithSidebarProps> = ({ navKeys, context }) => {
3136 return (
3237 < Sidebar
3338 groups = { mappedSidebarItems }
34- pathname = { pathname }
39+ pathname = { pathname . replace ( `/ ${ locale } ` , '' ) }
3540 title = { t ( 'components.common.sidebar.title' ) }
3641 onSelect = { value => push ( value ) }
3742 as = { Link }
You can’t perform that action at this time.
0 commit comments