Navbar highlighting does not work with Organized Content sections #181

Closed
opened 1 year ago by a258wang · 1 comments
Owner

The navbar entries for pages that use the Organized Content are not blue when viewing only a section of the content. (The highlighting works fine when viewing "Read All.")
image

The navbar entries for pages that use the Organized Content are not blue when viewing only a section of the content. (The highlighting works fine when viewing "Read All.") ![image](/attachments/b61f9d66-7a6c-43bd-95b8-c2446d617f57)
a258wang added this to the Pre launch milestone 1 year ago
Owner

I think this is happening because of this code:

  const isCurrentPage =
    router.pathname === props.route ||
    (props.submenu != null &&
      router.pathname.startsWith(getMainRoute(props.route)));

In the organized content component, when you navigate to a section, we add the section slug to the route, so the router.pathname === props.route check will return false.

I think this is happening because of this code: ``` const isCurrentPage = router.pathname === props.route || (props.submenu != null && router.pathname.startsWith(getMainRoute(props.route))); ``` In the organized content component, when you navigate to a section, we add the section slug to the route, so the `router.pathname === props.route` check will return false.
a258wang was assigned by a3thakra 1 year ago
a3thakra added the
In Progress
label 1 year ago
a3thakra added the
Bug
label 1 year ago
a258wang closed this issue 1 year ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: www/www-new#181
Loading…
There is no content yet.