From 88da720c0fd173cf0e13e860e3a6f5703818c780 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Thu, 9 Jul 2020 15:38:29 -0400 Subject: [PATCH] Create CustomAppBar component --- src/CustomAppBar.js | 56 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/CustomAppBar.js diff --git a/src/CustomAppBar.js b/src/CustomAppBar.js new file mode 100644 index 0000000..575633b --- /dev/null +++ b/src/CustomAppBar.js @@ -0,0 +1,56 @@ +import React from "react"; +import {makeStyles, Tooltip, Typography, AppBar, Toolbar, IconButton, Zoom} from "@material-ui/core" +import MenuIcon from "@material-ui/icons/Menu"; +import DarkModeIcon from '@material-ui/icons/Brightness4'; +import LightModeIcon from '@material-ui/icons/Brightness7'; + + +export default function CustomAppBar(props){ + const useStyles = makeStyles((theme) => ({ + root: { + flexGrow: 1, + }, + menuButton: { + marginLeft: theme.spacing(2), + }, + title: { + flexGrow: 1, + }, + tooltip: { + fontSize: theme.typography.pxToRem(14), + } + })); + + const classes = useStyles(props.theme); + + const toggleDarkMode = () => props.setDarkMode(!props.darkMode); + + return( +
+ + + + {props.title} + + + + + {props.darkMode ? : } + + + + + + + + + {/* Empty toolbar is to offset content below AppBar */} + +
+ ); +} \ No newline at end of file