Now the sidebar closes when the cookie banner is toggled
This commit is contained in:
parent
d2a7ff94cb
commit
2e1acb5758
|
@ -21,9 +21,19 @@ const useStyles = makeStyles({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const LegalLinks = () => {
|
type Props = {
|
||||||
|
toggleSidebar: Function,
|
||||||
|
}
|
||||||
|
|
||||||
|
const LegalLinks = (props: Props) => {
|
||||||
const classes = useStyles()
|
const classes = useStyles()
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
|
const openCookiesHandler = () => {
|
||||||
|
dispatch(openCookieBanner(true))
|
||||||
|
props.toggleSidebar()
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Block className={classes.container} justify="space-around">
|
<Block className={classes.container} justify="space-around">
|
||||||
<Link className={classes.link} to="https://safe.gnosis.io/terms" target="_blank">
|
<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">
|
<Link className={classes.link} to="https://safe.gnosis.io/imprint" target="_blank">
|
||||||
Imprint
|
Imprint
|
||||||
</Link>
|
</Link>
|
||||||
<GnoButtonLink className={classes.buttonLink} onClick={() => dispatch(openCookieBanner(true))}>
|
<GnoButtonLink className={classes.buttonLink} onClick={openCookiesHandler}>
|
||||||
Cookies
|
Cookies
|
||||||
</GnoButtonLink>
|
</GnoButtonLink>
|
||||||
</Block>
|
</Block>
|
||||||
|
|
|
@ -131,7 +131,7 @@ const Sidebar = ({
|
||||||
setDefaultSafe={setDefaultSafeAction}
|
setDefaultSafe={setDefaultSafeAction}
|
||||||
defaultSafe={defaultSafe}
|
defaultSafe={defaultSafe}
|
||||||
/>
|
/>
|
||||||
<LegalLinks />
|
<LegalLinks toggleSidebar={toggleSidebar} />
|
||||||
</Drawer>
|
</Drawer>
|
||||||
</ClickAwayListener>
|
</ClickAwayListener>
|
||||||
{children}
|
{children}
|
||||||
|
|
Loading…
Reference in New Issue