feat: close menu when navigating home

This commit is contained in:
Jeremy Kahn 2022-09-05 17:54:23 -05:00
parent 07cd343b10
commit 04549a8507

View File

@ -169,6 +169,10 @@ export const Shell = ({ children, userPeerId }: ShellProps) => {
setIsDrawerOpen(false) setIsDrawerOpen(false)
} }
const handleHomeLinkClick = () => {
setIsDrawerOpen(false)
}
const handleLinkButtonClick = async () => { const handleLinkButtonClick = async () => {
await navigator.clipboard.writeText(window.location.href) await navigator.clipboard.writeText(window.location.href)
@ -288,7 +292,7 @@ export const Shell = ({ children, userPeerId }: ShellProps) => {
</ListItem> </ListItem>
<Divider /> <Divider />
<List role="navigation"> <List role="navigation">
<Link to="/"> <Link to="/" onClick={handleHomeLinkClick}>
<ListItem disablePadding> <ListItem disablePadding>
<ListItemButton> <ListItemButton>
<ListItemIcon> <ListItemIcon>