forked from ivanpaulovich/clean-architecture-manga
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85bbeb7
commit f7db16b
Showing
12 changed files
with
1,110 additions
and
123 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
import React from "react"; | ||
import classNames from "classnames" | ||
import AppBar from "@material-ui/core/AppBar"; | ||
import Toolbar from "@material-ui/core/Toolbar"; | ||
import IconButton from "@material-ui/core/IconButton"; | ||
import MenuIcon from '@material-ui/icons/Menu'; | ||
import PropTypes from "prop-types" | ||
import { withStyles } from "@material-ui/core/styles"; | ||
import { fade } from "@material-ui/core/styles/colorManipulator" | ||
|
||
const styles = (theme) => ({ | ||
appBar: { | ||
zIndex: theme.zIndex.drawer + 1, | ||
transition: theme.transitions.create(["width", "margin"], { | ||
easing: theme.transitions.easing.sharp, | ||
duration: theme.transitions.duration.leavingScreen, | ||
}), | ||
}, | ||
appBarShift: { | ||
// marginLeft: theme.drawer.width, | ||
width: `calc(100% - ${theme.drawer.width}px)`, | ||
transition: theme.transitions.create(["width", "margin"], { | ||
easing: theme.transitions.easing.sharp, | ||
duration: theme.transitions.duration.enteringScreen, | ||
}), | ||
}, | ||
root: { | ||
width: "100%", | ||
}, | ||
grow: { | ||
flexGrow: 1, | ||
}, | ||
menuButton: { | ||
marginLeft: -12, | ||
marginRight: 20, | ||
}, | ||
title: { | ||
display: "none", | ||
[theme.breakpoints.up("sm")]: { | ||
display: "block", | ||
}, | ||
}, | ||
search: { | ||
position: "relative", | ||
borderRadius: theme.shape.borderRadius, | ||
backgroundColor: fade(theme.palette.common.white, 0.15), | ||
"&:hover": { | ||
backgroundColor: fade(theme.palette.common.white, 0.25), | ||
}, | ||
marginRight: theme.spacing.unit * 2, | ||
marginLeft: 0, | ||
width: "100%", | ||
[theme.breakpoints.up("sm")]: { | ||
marginLeft: theme.spacing.unit * 3, | ||
width: "auto", | ||
}, | ||
}, | ||
searchIcon: { | ||
width: theme.spacing.unit * 9, | ||
height: "100%", | ||
position: "absolute", | ||
pointerEvents: "none", | ||
display: "flex", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
}, | ||
inputRoot: { | ||
color: "inherit", | ||
width: "100%", | ||
}, | ||
inputInput: { | ||
paddingTop: theme.spacing.unit, | ||
paddingRight: theme.spacing.unit, | ||
paddingBottom: theme.spacing.unit, | ||
paddingLeft: theme.spacing.unit * 10, | ||
transition: theme.transitions.create("width"), | ||
width: "100%", | ||
[theme.breakpoints.up("md")]: { | ||
width: 200, | ||
}, | ||
}, | ||
sectionDesktop: { | ||
display: "none", | ||
[theme.breakpoints.up("md")]: { | ||
display: "flex", | ||
}, | ||
}, | ||
sectionMobile: { | ||
display: "flex", | ||
[theme.breakpoints.up("md")]: { | ||
display: "none", | ||
}, | ||
}, | ||
}) | ||
|
||
class Header extends React.Component { | ||
|
||
constructor(props) { | ||
super(props) | ||
} | ||
|
||
render() { | ||
|
||
const { handleChangeNavDrawer, navDrawerOpen, classes } = this.props | ||
|
||
return ( | ||
<AppBar position="fixed" className={classNames(classes.appBar, { | ||
[classes.appBarShift]: navDrawerOpen, | ||
})}> | ||
<Toolbar> | ||
<IconButton | ||
className={classes.menuButton} | ||
color="inherit" | ||
aria-label="Open drawer" | ||
onClick={handleChangeNavDrawer} | ||
> | ||
<MenuIcon /> | ||
</IconButton> | ||
</Toolbar> | ||
</AppBar> | ||
); | ||
} | ||
} | ||
|
||
Header.propTypes = { | ||
styles: PropTypes.object, | ||
handleChangeNavDrawer: PropTypes.func, | ||
classes: PropTypes.object, | ||
navDrawerOpen: PropTypes.bool, | ||
} | ||
export default withStyles(styles)(Header) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.