diff options
-rw-r--r-- | src/Header/Header.tsx | 30 | ||||
-rw-r--r-- | src/Header/SearchBar.tsx | 3 | ||||
-rw-r--r-- | src/index.tsx | 5 |
3 files changed, 27 insertions, 11 deletions
diff --git a/src/Header/Header.tsx b/src/Header/Header.tsx index c92208a..0ee6b5f 100644 --- a/src/Header/Header.tsx +++ b/src/Header/Header.tsx @@ -8,10 +8,15 @@ import { 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'; -const useStyles = makeStyles(theme => ({ +interface PropTypes { + setPage: (newPage: string) => void; +} + +const useStyles = makeStyles({ root: { display: 'flex', justifyContent: 'space-around', @@ -19,14 +24,22 @@ const useStyles = makeStyles(theme => ({ margin: 'auto' }, logo: { - fontWeight: 'bold', + fontWeight: 'bold' } -})); +}); -const Header: React.FC = () => { +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="fixed"> @@ -36,10 +49,13 @@ const Header: React.FC = () => { </Typography> <SearchBar /> <div> - <IconButton> + <IconButton onClick={handleHome}> + <HomeIcon /> + </IconButton> + <IconButton onClick={handleNotifications}> <NotificationsIcon /> </IconButton> - <IconButton> + <IconButton onClick={handleProfile}> <AccountCircle /> </IconButton> </div> diff --git a/src/Header/SearchBar.tsx b/src/Header/SearchBar.tsx index ed59874..182a1a4 100644 --- a/src/Header/SearchBar.tsx +++ b/src/Header/SearchBar.tsx @@ -9,8 +9,7 @@ const useStyles = makeStyles(theme => ({ borderRadius: '2px', padding: theme.spacing(0.5), display: 'flex', - alignItems: 'center', - // marginRight: theme.spacing(8), + alignItems: 'center' } })); diff --git a/src/index.tsx b/src/index.tsx index b0a8fdc..48bad48 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -13,7 +13,7 @@ const theme = createMuiTheme({ palette: { primary: { main: teal[700] - }, + } } }); @@ -43,8 +43,9 @@ const App: React.FC = () => { return ( <ThemeProvider theme={theme}> <CssBaseline /> - <Header /> + <Header setPage={setPage} /> <PollCard author={pollProps.author} contents={pollProps.contents} /> + <h1> We are on page {page}! </h1> </ThemeProvider> ); }; |