mirror of
https://github.com/urbit/developers.urbit.org.git
synced 2024-10-26 15:49:50 +03:00
pages/reference: auto-open drawers when landing on top-level pages
This commit is contained in:
parent
fbe346b3c0
commit
608c875e23
@ -115,8 +115,7 @@ const childPages = (thisLink, children, level = 0) => (
|
||||
|
||||
const pageTree = (thisLink, tree, level = 0) => {
|
||||
const router = useRouter();
|
||||
const firstCrumb = "/" + router.asPath.split("/").slice(1, -1).join("/");
|
||||
|
||||
const firstCrumb = "/" + router.asPath.split("/").slice(1).join("/");
|
||||
const includesThisPage = firstCrumb.includes(thisLink);
|
||||
const isThisPage = router.asPath === thisLink;
|
||||
const [isOpen, toggleTree] = useState(includesThisPage);
|
||||
|
Loading…
Reference in New Issue
Block a user