diff --git a/src/components/layout.js b/src/components/layout.js index b28b7f3..c96c880 100644 --- a/src/components/layout.js +++ b/src/components/layout.js @@ -1,3 +1,4 @@ +import React, { useState } from 'react' import Link from 'next/link' import tabs from '../data/tabs.json' @@ -5,16 +6,21 @@ import constants from '../constants.json' export default function Layout (props) { let href = props.route + const [sidebarOpen, setSidebarOpen] = useState(true) if (href === '/' || href === '') { href = 'index' } + if (typeof window !== 'undefined') { + console.log(window) + } + return (
- { console.log('CLOSE MENU') }} className='menuicon'> + { setSidebarOpen(!sidebarOpen) }} className='menuicon'>
@@ -23,19 +29,23 @@ export default function Layout (props) { Frylabs
- {Object.keys(tabs).map((key) => { - const item = tabs[key] - return ( - - {item.text} - - ) - })} - + {sidebarOpen + ? + : null}
{props.children} diff --git a/src/defaultStyles.css b/src/defaultStyles.css index 8ab097b..9d9fbf2 100644 --- a/src/defaultStyles.css +++ b/src/defaultStyles.css @@ -164,11 +164,8 @@ body { } .loadingindicator { - position: fixed; - top: 50%; - left: 50%; - -webkit-transform: translate(-50%, -50%); - transform: translate(-50%, -50%); + text-align: center; + vertical-align: middle; color: #fff; font-size: 30px;