diff --git a/src/App.js b/src/App.js index 1c1b8dd..90df0fa 100644 --- a/src/App.js +++ b/src/App.js @@ -1,31 +1,62 @@ -import React, { useState, useEffect } from "react"; +import React, { useState } from "react"; import { ThemeProvider, createMuiTheme } from "@material-ui/core/styles"; -import { Grid } from "@material-ui/core" +import { Box, makeStyles } from "@material-ui/core"; import CustomAppBar from "./CustomAppBar"; import ItemTable from "./ItemTable"; -import ItemView from "./ItemView" +import ItemView from "./ItemView"; +import clsx from "clsx"; +import { objectIsEmpty } from "./utilities" function App(){ const [darkMode, setDarkMode] = useState(false); - const [activeItem, setActiveItem] = useState({}) + const [activeItem, setActiveItem] = useState({}); + const sidebarOpen = !objectIsEmpty(activeItem); const theme = createMuiTheme({ "palette": { "type": darkMode ? "dark" : "light", } - }) + }); + + const transitionWidth = theme.transitions.create(["width"], { + duration: theme.transitions.duration.enteringScreen, + easing: theme.transitions.easing.easeInOut + }); + + const useStyles = makeStyles({ + "leftCol": { + overflow: "auto", + width: "100vw", + height: "100vh", + transition: transitionWidth + }, + "rightCol": { + width: "0", + overflow: "hidden", + height: "100vh", + transition: transitionWidth + }, + "rightColShift": { + width: "50vw", + flexShrink: "0", + overflow: "auto", + transition: transitionWidth + } + }); + + const classes = useStyles(); return ( - - - + + + - - + + - - + + ); }