Skip to content

Commit

Permalink
fix: allow to translate collapsible navigation group
Browse files Browse the repository at this point in the history
  • Loading branch information
dziraf committed Nov 30, 2023
1 parent 5536980 commit 9f0bac1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/frontend/hooks/use-navigation-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ export function useNavigationResources(
if (!resource.navigation || resource.navigation.name === null) {
memo[key] = enrichResource(resource, resource.navigation?.icon)
} else if (memo[key] && memo[key].elements && resource.navigation?.name) {
(memo[key].elements as Array<NavigationElementProps>).push(enrichResource(resource))
memo[key].label = translateLabel(`navigation.${resource.navigation?.name}`)
memo[key].elements.push(enrichResource(resource))
} else {
memo[key] = {
elements: [enrichResource(resource)],
label: resource.navigation?.name,
label: translateLabel(`navigation.${resource.navigation?.name}`),
icon: resource.navigation?.icon,
onClick: (): void => setOpenElements({
...openElements,
Expand Down

0 comments on commit 9f0bac1

Please sign in to comment.