Skip to content

Commit

Permalink
fix condition for page type check
Browse files Browse the repository at this point in the history
  • Loading branch information
Ondřej Chrastina committed Jul 21, 2023
1 parent ca9550f commit eb7d447
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions components/shared/ui/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const isCurrentNavigationItemActive = (navigation: Block_Navigation, router: Nex
const pathSegments = pathWithoutQuerystring.split("/");
const topLevelSegment = pathSegments[1];
const pageLink = navigation.elements.pageLink.linkedItems[0];
return (pageLink?.system.codename === contentTypes.page.codename && pageLink.elements.url.value === topLevelSegment);
return pageLink?.system.type === contentTypes.page.codename && pageLink.elements.url.value === topLevelSegment;
};

const resolveLink = (link: Readonly<Block_Navigation>) => {
Expand Down Expand Up @@ -86,7 +86,6 @@ const MenuList: FC<MenuListProps> = props => {
);
}


const DropdownButton: FC<Props> = props => {
return (
<button
Expand Down

0 comments on commit eb7d447

Please sign in to comment.