From 547ca86e02ad02c506e6e75bbe18d136014e0d7e Mon Sep 17 00:00:00 2001 From: julia-rabello Date: Fri, 4 Oct 2024 18:09:13 -0300 Subject: [PATCH] fix: sidebar-elements localized slug --- src/components/sidebar-elements/index.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/sidebar-elements/index.tsx b/src/components/sidebar-elements/index.tsx index f2ff927..7494e3d 100644 --- a/src/components/sidebar-elements/index.tsx +++ b/src/components/sidebar-elements/index.tsx @@ -194,7 +194,7 @@ const SidebarElements = ({ slugPrefix, items, subItemLevel }: SidebarProps) => { ) } - + const ElementChildren = ({ slug, children }: SidebarElement) => { const isExpandable = children.length > 0 // const newPathPrefix = @@ -209,7 +209,7 @@ const SidebarElements = ({ slugPrefix, items, subItemLevel }: SidebarProps) => { slugPrefix={slugPrefix} items={children} subItemLevel={subItemLevel + 1} - key={`${slug}sd`} + key={`${localizedSlug}sd`} /> ) : null @@ -218,10 +218,9 @@ const SidebarElements = ({ slugPrefix, items, subItemLevel }: SidebarProps) => { return ( {items?.map((item, index) => { - const key = typeof item.slug === 'string' ? String(item.slug) + String(index) : String(item.slug[locale]) + String(index) const slug = typeof item.slug === 'string' ? `${item.slug}` : `${item.slug[locale]}` - + return (