mirror of
https://github.com/supabase/supabase.git
synced 2026-06-09 19:50:28 +08:00
Add Postgres Resources section to menu
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user