Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions apps/site/components/withProgressionSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

import ProgressionSidebar from '@node-core/ui-components/Common/ProgressionSidebar';
import { usePathname } from 'next/navigation';
import { useTranslations, type RichTranslationValues } from 'next-intl';
import {
Comment thread
AugustinMauroy marked this conversation as resolved.
Outdated
useLocale,
useTranslations,
type RichTranslationValues,
} from 'next-intl';
import type { FC } from 'react';

import Link from '@/components/Link';
Expand All @@ -21,6 +25,7 @@ const WithProgressionSidebar: FC<WithProgressionSidebarProps> = ({
}) => {
const { getSideNavigation } = useSiteNavigation();
const pathname = usePathname();
const locale = useLocale();
const t = useTranslations();
const { push } = useRouter();
const [[, sidebarNavigation]] = getSideNavigation([navKey], context);
Expand All @@ -35,7 +40,7 @@ const WithProgressionSidebar: FC<WithProgressionSidebarProps> = ({
return (
<ProgressionSidebar
groups={mappedProgressionSidebarItems}
pathname={pathname!}
pathname={pathname?.replace(`/${locale}`, '')}
title={t('components.common.sidebar.title')}
onSelect={push}
as={Link}
Expand Down
9 changes: 7 additions & 2 deletions apps/site/components/withSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

import Sidebar from '@node-core/ui-components/Containers/Sidebar';
import { usePathname } from 'next/navigation';
import { useTranslations, type RichTranslationValues } from 'next-intl';
import {
useLocale,
useTranslations,
type RichTranslationValues,
} from 'next-intl';
import type { FC } from 'react';

import Link from '@/components/Link';
Expand All @@ -18,6 +22,7 @@ type WithSidebarProps = {
const WithSidebar: FC<WithSidebarProps> = ({ navKeys, context }) => {
const { getSideNavigation } = useSiteNavigation();
const pathname = usePathname()!;
const locale = useLocale();
const t = useTranslations();
const { push } = useRouter();

Expand All @@ -31,7 +36,7 @@ const WithSidebar: FC<WithSidebarProps> = ({ navKeys, context }) => {
return (
<Sidebar
groups={mappedSidebarItems}
pathname={pathname}
pathname={pathname.replace(`/${locale}`, '')}
title={t('components.common.sidebar.title')}
onSelect={value => push(value)}
as={Link}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
.wrapper {
.sideBarItem {
@apply flex
w-full
flex-col
items-start
gap-8
overflow-auto
overflow-x-hidden
border-r-neutral-200
bg-white
px-4
py-6
sm:border-r
md:max-w-xs
lg:px-6
dark:border-r-neutral-900
dark:bg-neutral-950;
list-none
text-neutral-800
dark:text-neutral-200;

> section {
@apply hidden
sm:flex;
a {
@apply inline-flex
items-center
gap-2
p-2;
}

> span {
@apply flex
.label {
@apply font-regular
w-full
sm:hidden;
text-sm;
}

.icon {
@apply size-3
text-neutral-500
dark:text-neutral-200;
}
}

.active {
@apply rounded
bg-green-600
text-white
dark:text-white;
}
Loading