diff options
author | ilyayudovin <46264063+ilyayudovin@users.noreply.github.com> | 2020-06-07 20:20:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-07 20:20:21 +0300 |
commit | 98442762c1bbdf4e4aff317ca8ec660b6817418f (patch) | |
tree | ff56c75b023fa166781275adfd65ea917d275968 /src/Header/Header.tsx | |
parent | 5ff3d0a3a29ebba9c42603369bb16d7419a423d1 (diff) | |
parent | b8b848dfd6e3843c6b455c8344320dcd187b72da (diff) | |
download | which-ui-98442762c1bbdf4e4aff317ca8ec660b6817418f.tar.gz |
Merge branch 'master' into feed
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> ); |