mirror of
https://github.com/vercel/commerce.git
synced 2025-06-18 21:21:21 +00:00
Fix the body scroll when the sidebar is open
This commit is contained in:
parent
5d8f3375e8
commit
381936dc99
@ -61,16 +61,16 @@ const Layout: FC<Props> = ({ children, pageProps }) => {
|
|||||||
<main className="fit">{children}</main>
|
<main className="fit">{children}</main>
|
||||||
<Footer pages={pageProps.pages} />
|
<Footer pages={pageProps.pages} />
|
||||||
|
|
||||||
<Sidebar open={displaySidebar} onClose={closeSidebar}>
|
|
||||||
<CartSidebarView />
|
|
||||||
</Sidebar>
|
|
||||||
|
|
||||||
<Modal open={displayModal} onClose={closeModal}>
|
<Modal open={displayModal} onClose={closeModal}>
|
||||||
{modalView === 'LOGIN_VIEW' && <LoginView />}
|
{modalView === 'LOGIN_VIEW' && <LoginView />}
|
||||||
{modalView === 'SIGNUP_VIEW' && <SignUpView />}
|
{modalView === 'SIGNUP_VIEW' && <SignUpView />}
|
||||||
{modalView === 'FORGOT_VIEW' && <ForgotPassword />}
|
{modalView === 'FORGOT_VIEW' && <ForgotPassword />}
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
<Sidebar open={displaySidebar} onClose={closeSidebar}>
|
||||||
|
<CartSidebarView />
|
||||||
|
</Sidebar>
|
||||||
|
|
||||||
<FeatureBar
|
<FeatureBar
|
||||||
title="This site uses cookies to improve your experience. By clicking, you agree to our Privacy Policy."
|
title="This site uses cookies to improve your experience. By clicking, you agree to our Privacy Policy."
|
||||||
hide={acceptedCookies}
|
hide={acceptedCookies}
|
||||||
|
@ -90,6 +90,7 @@ function uiReducer(state: State, action: Action) {
|
|||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
displayModal: true,
|
displayModal: true,
|
||||||
|
displaySidebar: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 'CLOSE_MODAL': {
|
case 'CLOSE_MODAL': {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user