diff options
author | eug-vs <eug-vs@keemail.me> | 2020-06-14 19:52:35 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-06-14 19:52:35 +0300 |
commit | c7f2999ee797ea5e3bfb29517a4f13206162cc6f (patch) | |
tree | f1aa1f0183720e509894e641cd2f5d1b2f9cd163 /src/components/Header/Header.tsx | |
parent | fabc53130685f70078343a6fd96d9a597b22008f (diff) | |
download | which-ui-c7f2999ee797ea5e3bfb29517a4f13206162cc6f.tar.gz |
refactor: use lowercase in folder names
Diffstat (limited to 'src/components/Header/Header.tsx')
-rw-r--r-- | src/components/Header/Header.tsx | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx new file mode 100644 index 0000000..0ee6b5f --- /dev/null +++ b/src/components/Header/Header.tsx @@ -0,0 +1,68 @@ +import React from 'react'; +import { + AppBar, + Toolbar, + IconButton, + Typography +} from '@material-ui/core'; +import { makeStyles } from '@material-ui/core/styles'; +import AccountCircle from '@material-ui/icons/AccountCircle'; +import NotificationsIcon from '@material-ui/icons/Notifications'; +import HomeIcon from '@material-ui/icons/Home'; + +import SearchBar from './SearchBar'; + +interface PropTypes { + setPage: (newPage: string) => void; +} + +const useStyles = makeStyles({ + root: { + display: 'flex', + justifyContent: 'space-around', + width: '60%', + margin: 'auto' + }, + logo: { + fontWeight: 'bold' + } +}); + +const Header: React.FC<PropTypes> = ({ setPage }) => { + const classes = useStyles(); + + const handleHome = (): void => { + setPage('feed'); + }; + + const handleProfile = (): void => { + setPage('profile'); + }; + + const handleNotifications = (): void => {}; + + return ( + <AppBar position="fixed"> + <Toolbar className={classes.root}> + <Typography variant="h5" className={classes.logo}> + Which + </Typography> + <SearchBar /> + <div> + <IconButton onClick={handleHome}> + <HomeIcon /> + </IconButton> + <IconButton onClick={handleNotifications}> + <NotificationsIcon /> + </IconButton> + <IconButton onClick={handleProfile}> + <AccountCircle /> + </IconButton> + </div> + </Toolbar> + </AppBar> + ); +}; + +export default Header; + |