Sidebar component wip

This commit is contained in:
Mikhail Mikheev 2019-09-12 17:25:19 +04:00
parent de5013140d
commit 1140a6c976
2 changed files with 18 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import React, { Suspense } from 'react'
import { Provider } from 'react-redux'
import { ConnectedRouter } from 'connected-react-router'
import { hot } from 'react-hot-loader/root'
import Sidebar from '~/components/Sidebar'
import PageFrame from '../layout/PageFrame'
import Loader from '../Loader'
import { history, store } from '~/store'
@ -21,6 +22,7 @@ const Root = () => (
<PageFrame>
<Suspense fallback={<Loader />}>
<AppRoutes />
<Sidebar />
</Suspense>
</PageFrame>
</ConnectedRouter>

View File

@ -0,0 +1,16 @@
// @flow
import React, { useState } from 'react'
import { makeStyles } from '@material-ui/core/styles'
import Drawer from '@material-ui/core/Drawer'
const Sidebar = () => {
const [isOpen, setIsOpen] = useState<boolean>(true)
const toggleSidebar = () => {
setIsOpen((prevIsOpen) => !prevIsOpen)
}
return <Drawer open={isOpen} onKeyDown={toggleSidebar}>Wop</Drawer>
}
export default Sidebar