File tree Expand file tree Collapse file tree 3 files changed +33
-25
lines changed Expand file tree Collapse file tree 3 files changed +33
-25
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 { useLocale , useTranslations } from 'next-intl' ;
6+ import type { RichTranslationValues } from 'next-intl' ;
67import type { FC } from 'react' ;
78
89import Link from '@/components/Link' ;
@@ -21,6 +22,7 @@ const WithProgressionSidebar: FC<WithProgressionSidebarProps> = ({
2122} ) => {
2223 const { getSideNavigation } = useSiteNavigation ( ) ;
2324 const pathname = usePathname ( ) ;
25+ const locale = useLocale ( ) ;
2426 const t = useTranslations ( ) ;
2527 const { push } = useRouter ( ) ;
2628 const [ [ , sidebarNavigation ] ] = getSideNavigation ( [ navKey ] , context ) ;
@@ -35,7 +37,7 @@ const WithProgressionSidebar: FC<WithProgressionSidebarProps> = ({
3537 return (
3638 < ProgressionSidebar
3739 groups = { mappedProgressionSidebarItems }
38- pathname = { pathname ! }
40+ pathname = { pathname ?. replace ( `/ ${ locale } ` , '' ) }
3941 title = { t ( 'components.common.sidebar.title' ) }
4042 onSelect = { push }
4143 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 { useLocale , useTranslations } from 'next-intl' ;
6+ import type { RichTranslationValues } from 'next-intl' ;
67import type { FC } from 'react' ;
78
89import Link from '@/components/Link' ;
@@ -18,6 +19,7 @@ type WithSidebarProps = {
1819const WithSidebar : FC < WithSidebarProps > = ( { navKeys, context } ) => {
1920 const { getSideNavigation } = useSiteNavigation ( ) ;
2021 const pathname = usePathname ( ) ! ;
22+ const locale = useLocale ( ) ;
2123 const t = useTranslations ( ) ;
2224 const { push } = useRouter ( ) ;
2325
@@ -31,7 +33,7 @@ const WithSidebar: FC<WithSidebarProps> = ({ navKeys, context }) => {
3133 return (
3234 < Sidebar
3335 groups = { mappedSidebarItems }
34- pathname = { pathname }
36+ pathname = { pathname . replace ( `/ ${ locale } ` , '' ) }
3537 title = { t ( 'components.common.sidebar.title' ) }
3638 onSelect = { value => push ( value ) }
3739 as = { Link }
Original file line number Diff line number Diff line change 1- .wrapper {
1+ .sideBarItem {
22 @apply flex
33 w-full
4- flex-col
5- items-start
6- gap-8
7- overflow-auto
8- overflow-x-hidden
9- border-r-neutral-200
10- bg-white
11- px-4
12- py-6
13- sm:border-r
14- md:max-w-xs
15- lg:px-6
16- dark:border-r-neutral-900
17- dark:bg-neutral-950;
4+ list-none
5+ text-neutral-800
6+ dark:text-neutral-200;
187
19- > section {
20- @apply hidden
21- sm:flex;
8+ a {
9+ @apply inline-flex
10+ items-center
11+ gap-2
12+ p-2;
2213 }
2314
24- > span {
25- @apply flex
15+ . label {
16+ @apply font-regular
2617 w-full
27- sm:hidden ;
18+ text-sm ;
2819 }
20+
21+ .icon {
22+ @apply size-3
23+ text-neutral-500
24+ dark:text-neutral-200;
25+ }
26+ }
27+
28+ .active {
29+ @apply rounded
30+ bg-green-600
31+ text-white
32+ dark:text-white;
2933}
You can’t perform that action at this time.
0 commit comments