mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Sidebar open close handle
This commit is contained in:
parent
255d892177
commit
6688a1417d
2 changed files with 25 additions and 18 deletions
|
@ -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 (
|
||||
<div>
|
||||
<div className='sidebar'>
|
||||
<div className='headercontainer'>
|
||||
<span onClick={() => { console.log('CLOSE MENU') }} className='menuicon'>
|
||||
<span onClick={() => { setSidebarOpen(!sidebarOpen) }} className='menuicon'>
|
||||
<div />
|
||||
<div />
|
||||
<div />
|
||||
|
@ -23,6 +29,8 @@ export default function Layout (props) {
|
|||
Frylabs
|
||||
</div>
|
||||
</div>
|
||||
{sidebarOpen
|
||||
? <div>
|
||||
{Object.keys(tabs).map((key) => {
|
||||
const item = tabs[key]
|
||||
return (
|
||||
|
@ -37,6 +45,8 @@ export default function Layout (props) {
|
|||
Donate
|
||||
</a>
|
||||
</div>
|
||||
: null}
|
||||
</div>
|
||||
<div className='content'>
|
||||
{props.children}
|
||||
</div>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue