Now the sidebar closes when the cookie banner is toggled

This commit is contained in:
apane 2019-12-04 09:19:07 -03:00
parent d2a7ff94cb
commit 2e1acb5758
2 changed files with 13 additions and 3 deletions

View File

@ -21,9 +21,19 @@ const useStyles = makeStyles({
},
})
const LegalLinks = () => {
type Props = {
toggleSidebar: Function,
}
const LegalLinks = (props: Props) => {
const classes = useStyles()
const dispatch = useDispatch()
const openCookiesHandler = () => {
dispatch(openCookieBanner(true))
props.toggleSidebar()
}
return (
<Block className={classes.container} justify="space-around">
<Link className={classes.link} to="https://safe.gnosis.io/terms" target="_blank">
@ -38,7 +48,7 @@ const LegalLinks = () => {
<Link className={classes.link} to="https://safe.gnosis.io/imprint" target="_blank">
Imprint
</Link>
<GnoButtonLink className={classes.buttonLink} onClick={() => dispatch(openCookieBanner(true))}>
<GnoButtonLink className={classes.buttonLink} onClick={openCookiesHandler}>
Cookies
</GnoButtonLink>
</Block>

View File

@ -131,7 +131,7 @@ const Sidebar = ({
setDefaultSafe={setDefaultSafeAction}
defaultSafe={defaultSafe}
/>
<LegalLinks />
<LegalLinks toggleSidebar={toggleSidebar} />
</Drawer>
</ClickAwayListener>
{children}