From 5b201eba5b37b9a23f3b3dd0ac3cdcd661573359 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sun, 22 Dec 2024 10:19:03 +0100 Subject: [PATCH] Refactor method to make it more readable --- .../Framework/Features/Navigation/DocumentationSidebar.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php b/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php index 2808fccf51d..b9eeccf4e05 100644 --- a/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php +++ b/packages/framework/src/Framework/Features/Navigation/DocumentationSidebar.php @@ -53,8 +53,9 @@ public function getItemsInGroup(?string $group): Collection public function isGroupActive(string $group): bool { - return Hyde::makeSlug(Render::getPage()->navigationMenuGroup()) === $group - || $this->isPageIndexPage() && $this->shouldIndexPageBeActive($group); + $normalized = Hyde::makeSlug(Render::getPage()->navigationMenuGroup()); + + return ($normalized === $group) || ($this->isPageIndexPage() && $this->shouldIndexPageBeActive($group)); } public function makeGroupTitle(string $group): string