import type { FunctionalComponent } from 'preact'; import { h, Fragment } from 'preact'; import { useState, useEffect } from 'preact/hooks'; const MenuToggle: FunctionalComponent = () => { const [sidebarShown, setSidebarShown] = useState(false); useEffect(() => { const body = document.getElementsByTagName('body')[0]; if (sidebarShown) { body.classList.add('mobile-sidebar-toggle'); } else { body.classList.remove('mobile-sidebar-toggle'); } }, [sidebarShown]); return ( ); }; export default MenuToggle; ue='astro-icons'>astro-icons Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/scripts (unfollow)
AgeCommit message (Expand)AuthorFilesLines