Fix navigation between cart and menu on mobile

On mobile when the Sidebar menu is open and you want to switch to cart, it would toggle the sidebar and close it instead of switching view.
This commit is contained in:
ltueth 2022-03-12 20:42:06 +01:00 committed by GitHub
parent 6e6db0773b
commit c5cc9390a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,7 +35,7 @@ const UserNav: FC<Props> = ({ className }) => {
variant="naked" variant="naked"
onClick={() => { onClick={() => {
setSidebarView('CART_VIEW') setSidebarView('CART_VIEW')
toggleSidebar() openSidebar()
}} }}
aria-label={`Cart items: ${itemsCount}`} aria-label={`Cart items: ${itemsCount}`}
> >
@ -76,7 +76,7 @@ const UserNav: FC<Props> = ({ className }) => {
variant="naked" variant="naked"
onClick={() => { onClick={() => {
setSidebarView('MOBILEMENU_VIEW') setSidebarView('MOBILEMENU_VIEW')
toggleSidebar() openSidebar()
}} }}
aria-label="Menu" aria-label="Menu"
> >