Add Postgres Resources section to menu

This commit is contained in:
Terry Sutton
2023-01-25 17:16:56 -03:30
parent fb9e7d722d
commit f2a9aec58a
2 changed files with 43 additions and 2 deletions

View File

@@ -12,8 +12,17 @@ const NavigationMenuGuideList: React.FC<Props> = ({ id, active }) => {
// get url
const url = router.asPath
// remove the end of the url if a deep link
const firstLevelRoute = url?.split('/')?.slice(0, 4)?.join('/')
// We need to decide how deep we want the menu to be for matching urls
// if the links are really deep, we don't want to match all the way out
// But we need to reach out further to make the structure of /resources/postgres/ work
// look at /resources/postgres/ vs /auth/phone-login for how these are different
let firstLevelRoute
if (url.includes('resources/postgres/')) {
firstLevelRoute = url?.split('/')?.slice(0, 5)?.join('/')
} else {
firstLevelRoute = url?.split('/')?.slice(0, 4)?.join('/')
}
return (
<Accordion.Root