component: add SideDrawer component

This commit is contained in:
oscarzhou 2020-12-13 16:10:51 +13:00
parent 67a49ad12b
commit 4b0878dd16
3 changed files with 48 additions and 0 deletions

View File

@ -3,10 +3,12 @@ import React from 'react';
import Aux from '../../hoc/Auxiliary';
import classes from './Layout.css';
import Toolbar from '../Navigation/Toolbar/Toolbar';
import SideDrawer from '../Navigation/SideDrawer/SideDrawer';
const layout = (props) => (
<Aux>
<Toolbar />
<SideDrawer />
<main className={classes.Content}>
{props.children}
</main>

View File

@ -0,0 +1,27 @@
.SideDrawer {
position: fixed;
width: 280px;
max-width: 70%;
height: 100%;
left: 0;
top: 0;
z-index: 200;
background-color: white;
padding: 32px 16px;
box-sizing: border-box;
transition: transform 0.3s ease-out;
}
@media (min-width: 500px) {
.SideDrawer {
display: none;
}
}
.Open {
transform: translateX(0);
}
.Close {
transform: translateX(-100%);
}

View File

@ -0,0 +1,19 @@
import React from 'react';
import classes from './SideDrawer.css';
import Logo from '../../Logo/Logo';
import NavigationItems from '../NavigationItems/NavigationItems';
const sideDrawer = () => {
return (
<div className={classes.SideDrawer}>
<Logo />
<nav>
<NavigationItems />
</nav>
</div>
)
}
export default sideDrawer;