Skip to content

Commit

Permalink
Normalize group keys to a proper label instead of slug
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Feb 20, 2024
1 parent 2cf9364 commit e492d12
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/framework/src/Framework/Features/Navigation/NavItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,17 @@ public function addChild(NavItem $item): void

protected static function normalizeGroupKey(?string $group): ?string
{
return $group ? Str::slug($group) : null;
// If there is no group, we return null
if (! $group) {
return null;
}

// If the label is not formatted, we format it here
if ($group === strtolower($group)) {
return Hyde::makeTitle($group);
}

return $group;
}

protected static function makeIdentifier(string $label): string
Expand Down

0 comments on commit e492d12

Please sign in to comment.