Skip to content

Commit

Permalink
fix: sidebar-elements localized slug
Browse files Browse the repository at this point in the history
  • Loading branch information
julia-rabello committed Oct 4, 2024
1 parent 0fb2127 commit 547ca86
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/sidebar-elements/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const SidebarElements = ({ slugPrefix, items, subItemLevel }: SidebarProps) => {
</Box>
)
}

const ElementChildren = ({ slug, children }: SidebarElement) => {
const isExpandable = children.length > 0
// const newPathPrefix =
Expand All @@ -209,7 +209,7 @@ const SidebarElements = ({ slugPrefix, items, subItemLevel }: SidebarProps) => {
slugPrefix={slugPrefix}
items={children}
subItemLevel={subItemLevel + 1}
key={`${slug}sd`}
key={`${localizedSlug}sd`}
/>
</Box>
) : null
Expand All @@ -218,10 +218,9 @@ const SidebarElements = ({ slugPrefix, items, subItemLevel }: SidebarProps) => {
return (
<Box className="sidebar-component">
{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 (
<Fragment key={String(key)}>
<ElementRoot {...item} slug={slug} />
Expand Down

0 comments on commit 547ca86

Please sign in to comment.