diff options
author | Eugene Sokolov <eug-vs@keemail.me> | 2020-08-11 23:17:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-11 23:17:28 +0300 |
commit | 94067ef2a0d9ac5c2aa5f45eca5366a2251ac04a (patch) | |
tree | 51e502c7d1be7c8ad2179daf2f5c9bfd27911636 /src/components/Header/MobileHeader.tsx | |
parent | c6723fa8a2a303f356b1756b45b2190203c96582 (diff) | |
parent | b5ce9be31993f5b4bee9abbe57d775b7ea407507 (diff) | |
download | which-ui-94067ef2a0d9ac5c2aa5f45eca5366a2251ac04a.tar.gz |
Merge pull request #76 from which-ecosystem/redesign
Initial header redesign
Diffstat (limited to 'src/components/Header/MobileHeader.tsx')
-rw-r--r-- | src/components/Header/MobileHeader.tsx | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/components/Header/MobileHeader.tsx b/src/components/Header/MobileHeader.tsx new file mode 100644 index 0000000..a20d54a --- /dev/null +++ b/src/components/Header/MobileHeader.tsx @@ -0,0 +1,43 @@ +import React from 'react'; +import { + AppBar, + Toolbar, + useScrollTrigger, + Slide +} from '@material-ui/core'; +import { makeStyles } from '@material-ui/core/styles'; + +interface PropTypes { + menu: JSX.Element; + logo: JSX.Element; + search: JSX.Element; +} + +const useStyles = makeStyles({ + root: { + display: 'flex', + justifyContent: 'space-between' + } +}); + + +const MobileHeader: React.FC<PropTypes> = React.memo(props => { + const classes = useStyles(); + const trigger = useScrollTrigger(); + const { menu, search, logo } = props; + + return ( + <Slide appear={false} direction="down" in={!trigger}> + <AppBar position="fixed"> + <Toolbar className={classes.root}> + {menu} + {logo} + {search} + </Toolbar> + </AppBar> + </Slide> + ); +}); + +export default MobileHeader; + |