Skip to content

Commit

Permalink
Fixed issue #1682 - rewrote buttons to be clickable on the entire bot…
Browse files Browse the repository at this point in the history
…ton space
  • Loading branch information
izhuravlev committed Feb 15, 2021
1 parent 2919f2c commit 3cc375e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 31 deletions.
36 changes: 21 additions & 15 deletions src/frontend/next/src/components/Header/DesktopHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const useStyles = makeStyles((theme) => ({
float: 'right',
margin: '0 0.5rem 0 0.5rem',
},
links: {
buttonText: {
color: theme.palette.primary.contrastText,
fontFamily: 'Roboto, sans-serif',
textDecoration: 'none',
Expand All @@ -49,22 +49,28 @@ export default function DesktopHeader() {
</a>
</Link>
<div className={classes.grow} />
<IconButton color="inherit" className={classes.button} aria-label="search">
<Link href="/search">

<Link href="/search" passHref>
<IconButton
color="inherit"
className={classes.button}
aria-label="search"
component="a"
>
<SearchIcon className={classes.searchIcon} />
</Link>
</IconButton>
</IconButton>
</Link>

<Button color="inherit" size="medium" className={classes.button}>
<Link href="/">
<a className={classes.links}>Home</a>
</Link>
</Button>
<Button color="inherit" size="medium" className={classes.button}>
<Link href="/about">
<a className={classes.links}>About</a>
</Link>
</Button>
<Link href="/" passHref>
<Button color="inherit" size="medium" className={classes.button} component="a">
<p className={classes.buttonText}>Home</p>
</Button>
</Link>
<Link href="/about" passHref>
<Button color="inherit" size="medium" className={classes.button} component="a">
<p className={classes.buttonText}>About</p>
</Button>
</Link>
<Login />
</Toolbar>
</AppBar>
Expand Down
43 changes: 27 additions & 16 deletions src/frontend/next/src/components/Header/MobileHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const useStyles = makeStyles((theme) => ({
menuIcon: {
fontSize: '2.5rem',
},
links: {
buttonText: {
color: theme.palette.background.default,
fontFamily: 'Roboto, sans-serif',
textDecoration: 'none',
Expand All @@ -46,6 +46,9 @@ const useStyles = makeStyles((theme) => ({
list: {
width: 250,
},
sideList: {
padding: 0,
},
paper: {
backgroundColor: theme.palette.primary.main,
},
Expand Down Expand Up @@ -86,19 +89,21 @@ export default function MobileHeader() {
onClick={toggleDrawer(side, false)}
onKeyDown={toggleDrawer(side, false)}
>
<List className={classes.item}>
<ListItem button className={classes.item}>
<Link href="/">
<a className={classes.links}>Home</a>
</Link>
</ListItem>
<List className={classes.sideList}>
<Link href="/" passHref>
<ListItem button className={classes.item} component="a">
<p className={classes.buttonText}>Home</p>
</ListItem>
</Link>
<Divider className={classes.line} />
<ListItem button className={classes.item}>
<Link href="/about">
<a className={classes.links}>About</a>
</Link>
</ListItem>

<Link href="/about" passHref>
<ListItem button className={classes.item} component="a">
<p className={classes.buttonText}>About</p>
</ListItem>
</Link>
<Divider className={classes.line} />

<Login isMobile />
<Divider className={classes.line} />
</List>
Expand All @@ -115,11 +120,17 @@ export default function MobileHeader() {
</a>
</Link>
<div className={classes.grow} />
<IconButton color="inherit" className={classes.button} aria-label="search">
<Link href="/search">
<Link href="/search" passHref>
<IconButton
color="inherit"
className={classes.button}
aria-label="search"
component="a"
>
<SearchIcon className={classes.searchIcon} />
</Link>
</IconButton>
</IconButton>
</Link>

<IconButton
onClick={toggleDrawer('right', true)}
edge="start"
Expand Down

0 comments on commit 3cc375e

Please sign in to comment.