diff options
Diffstat (limited to 'src/Header/Header.tsx')
-rw-r--r-- | src/Header/Header.tsx | 70 |
1 files changed, 44 insertions, 26 deletions
diff --git a/src/Header/Header.tsx b/src/Header/Header.tsx index 8e8a301..0ee6b5f 100644 --- a/src/Header/Header.tsx +++ b/src/Header/Header.tsx @@ -2,45 +2,63 @@ import React from 'react'; import { AppBar, Toolbar, - Tabs, - Tab + 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 { - page: string; setPage: (newPage: string) => void; } -const useStyles = makeStyles(theme => ({ - tab: { - '& .MuiTab-wrapper': { - padding: theme.spacing(2), - flexDirection: 'row', - fontSize: '0.8125rem' - } +const useStyles = makeStyles({ + root: { + display: 'flex', + justifyContent: 'space-around', + width: '60%', + margin: 'auto' + }, + logo: { + fontWeight: 'bold' } -})); - -const tabs = ['Profile', 'Feed']; +}); -const Header: React.FC<PropTypes> = ({ page /* , setPage */ }) => { +const Header: React.FC<PropTypes> = ({ setPage }) => { const classes = useStyles(); - const handleChange = () => {}; + const handleHome = (): void => { + setPage('feed'); + }; + + const handleProfile = (): void => { + setPage('profile'); + }; + + const handleNotifications = (): void => {}; return ( - <AppBar position="static"> - <Toolbar> - <Tabs onChange={handleChange} value={page}> - {tabs.map((tab: string) => ( - <Tab - label={tab} - key={tab} - className={classes.tab} - /> - ))} - </Tabs> + <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> ); |