diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index a7a8ea09..59e617f0 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -23,8 +23,7 @@ const MainLayout: React.FunctionComponent = ({ const samplesNames = Object.keys(pages); const panelRef = useRef(null); - - const stylePanelContentsOnExpand = () => { + const setDataExpanded = () => { if (panelRef.current) { console.log(panelRef.current.getAttribute('data-expanded')); panelRef.current.getAttribute('data-expanded') === 'true' @@ -33,11 +32,6 @@ const MainLayout: React.FunctionComponent = ({ } }; - //Style .panelContents when clicking on a link. - const stylePanelContentsOnLink = () => { - panelRef.current.setAttribute('data-expanded', 'false'); - }; - const oldPathSyntaxMatch = router.asPath.match(/(\?wgsl=[01])#(\S+)/); if (oldPathSyntaxMatch) { const slug = oldPathSyntaxMatch[2]; @@ -65,7 +59,7 @@ const MainLayout: React.FunctionComponent = ({
{ - stylePanelContentsOnExpand(); + setDataExpanded(); }} >
@@ -92,7 +86,7 @@ const MainLayout: React.FunctionComponent = ({ { - stylePanelContentsOnLink(); + setDataExpanded(); }} > {slug}