aboutsummaryrefslogtreecommitdiff
path: root/src/components/Header
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-07-03 21:16:24 +0300
committerGitHub <noreply@github.com>2020-07-03 21:16:24 +0300
commitaf51f6c8a6fabdd8e578e13599b33f121f483a52 (patch)
tree1104abe0fa751b858177324b408f9bdf830ed15a /src/components/Header
parentcb521315c2291eda6b273b5f8a2e014c24ea9758 (diff)
parent14926e00ec1d749d5e2c83bdcd98ed68e9b2f896 (diff)
downloadwhich-ui-af51f6c8a6fabdd8e578e13599b33f121f483a52.tar.gz
Merge pull request #59 from which-ecosystem/pages
Markup landing page and blank notifications page
Diffstat (limited to 'src/components/Header')
-rw-r--r--src/components/Header/Header.tsx17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx
index 72e40f8..294c250 100644
--- a/src/components/Header/Header.tsx
+++ b/src/components/Header/Header.tsx
@@ -22,7 +22,8 @@ const useStyles = makeStyles({
margin: 'auto'
},
logo: {
- fontWeight: 'bold'
+ fontWeight: 'bold',
+ cursor: 'pointer'
},
avatar: {
width: 24,
@@ -36,6 +37,10 @@ const Header: React.FC = () => {
const { navigate } = useNavigate();
const handleHome = (): void => {
+ navigate('home');
+ };
+
+ const handleFeed = (): void => {
navigate('feed');
};
@@ -44,17 +49,19 @@ const Header: React.FC = () => {
else navigate('auth');
};
- const handleNotifications = (): void => {};
+ const handleNotifications = (): void => {
+ navigate('notifications');
+ };
return (
<AppBar position="fixed">
<Toolbar className={classes.root}>
- <Typography variant="h5" className={classes.logo}>
+ <Typography variant="h5" className={classes.logo} onClick={handleHome}>
Which
</Typography>
<SearchBar />
<div>
- <IconButton onClick={handleHome}>
+ <IconButton onClick={handleFeed}>
<HomeIcon />
</IconButton>
<IconButton onClick={handleNotifications}>
@@ -62,7 +69,7 @@ const Header: React.FC = () => {
</IconButton>
<IconButton onClick={handleProfile}>
{
- user?.avatarUrl?.match(/\.(jpeg|jpg|gif|png)$/)
+ user?.avatarUrl
? <Avatar className={classes.avatar} src={user?.avatarUrl} />
: <AccountCircle />
}