import React, { useState, useEffect } from 'react' import Link from 'next/link' import tabs from '../data/tabs.json' import constants from '../constants.json' // FIXME: window resize event listener to show sidebar on resize export default function Layout (props) { let href = props.route const [sidebarOpen, setSidebarOpen] = useState(true) if (href === '/' || href === '') { href = 'index' } const closeSideBar = () => { if (typeof window !== 'undefined') { console.log('window.innerWidth', window.innerWidth) if (window.innerWidth < constants.mobileWindowWidth) { setSidebarOpen(false) } } } useEffect(() => { closeSideBar() }, []) return (