File tree 3 files changed +33
-25
lines changed
3 files changed +33
-25
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import ProgressionSidebar from '@node-core/ui-components/Common/ProgressionSidebar' ;
4
4
import { 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' ;
6
7
import type { FC } from 'react' ;
7
8
8
9
import Link from '@/components/Link' ;
@@ -21,6 +22,7 @@ const WithProgressionSidebar: FC<WithProgressionSidebarProps> = ({
21
22
} ) => {
22
23
const { getSideNavigation } = useSiteNavigation ( ) ;
23
24
const pathname = usePathname ( ) ;
25
+ const locale = useLocale ( ) ;
24
26
const t = useTranslations ( ) ;
25
27
const { push } = useRouter ( ) ;
26
28
const [ [ , sidebarNavigation ] ] = getSideNavigation ( [ navKey ] , context ) ;
@@ -35,7 +37,7 @@ const WithProgressionSidebar: FC<WithProgressionSidebarProps> = ({
35
37
return (
36
38
< ProgressionSidebar
37
39
groups = { mappedProgressionSidebarItems }
38
- pathname = { pathname ! }
40
+ pathname = { pathname ?. replace ( `/ ${ locale } ` , '' ) }
39
41
title = { t ( 'components.common.sidebar.title' ) }
40
42
onSelect = { push }
41
43
as = { Link }
Original file line number Diff line number Diff line change 2
2
3
3
import Sidebar from '@node-core/ui-components/Containers/Sidebar' ;
4
4
import { 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' ;
6
7
import type { FC } from 'react' ;
7
8
8
9
import Link from '@/components/Link' ;
@@ -18,6 +19,7 @@ type WithSidebarProps = {
18
19
const WithSidebar : FC < WithSidebarProps > = ( { navKeys, context } ) => {
19
20
const { getSideNavigation } = useSiteNavigation ( ) ;
20
21
const pathname = usePathname ( ) ! ;
22
+ const locale = useLocale ( ) ;
21
23
const t = useTranslations ( ) ;
22
24
const { push } = useRouter ( ) ;
23
25
@@ -31,7 +33,7 @@ const WithSidebar: FC<WithSidebarProps> = ({ navKeys, context }) => {
31
33
return (
32
34
< Sidebar
33
35
groups = { mappedSidebarItems }
34
- pathname = { pathname }
36
+ pathname = { pathname . replace ( `/ ${ locale } ` , '' ) }
35
37
title = { t ( 'components.common.sidebar.title' ) }
36
38
onSelect = { value => push ( value ) }
37
39
as = { Link }
Original file line number Diff line number Diff line change 1
- .wrapper {
1
+ .sideBarItem {
2
2
@apply flex
3
3
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;
18
7
19
- > section {
20
- @apply hidden
21
- sm:flex;
8
+ a {
9
+ @apply inline-flex
10
+ items-center
11
+ gap-2
12
+ p-2;
22
13
}
23
14
24
- > span {
25
- @apply flex
15
+ . label {
16
+ @apply font-regular
26
17
w-full
27
- sm:hidden ;
18
+ text-sm ;
28
19
}
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;
29
33
}
You can’t perform that action at this time.
0 commit comments