import { h, Fragment } from 'preact'; import Link from './components/Link'; import LinkedLogo from './components/LinkedLogo'; import { Link as RouterLink } from 'preact-router/match'; import { useCallback, useState } from 'preact/hooks'; import { useSidebar } from './context'; function NavLink({ className = '', href, text, ...other }) { const external = href.startsWith('http'); const El = external ? Link : RouterLink; const props = external ? { rel: 'noopener nofollow', target: '_blank' } : {}; return ( {text} ); } export default function Sidebar() { const { showSidebar, setShowSidebar } = useSidebar(); const handleDismiss = useCallback(() => { setShowSidebar(false); }, [setShowSidebar]); return ( {showSidebar ?
: ''}
); }