mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Removing useDialog, cause rerender
This commit is contained in:
@@ -10,6 +10,7 @@ import { useAcceptCookies } from '@lib/hooks/useAcceptCookies'
|
||||
import { CommerceProvider } from '@bigcommerce/storefront-data-hooks'
|
||||
import { Sidebar, Button, Modal, LoadingDots } from '@components/ui'
|
||||
import type { Page } from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
|
||||
import { CartSidebarView } from '@components/cart'
|
||||
|
||||
const Loading = () => (
|
||||
<div className="w-80 h-80 flex items-center text-center justify-center p-3">
|
||||
@@ -20,9 +21,7 @@ const Loading = () => (
|
||||
const dynamicProps = {
|
||||
loading: () => <Loading />,
|
||||
}
|
||||
const CartSidebarView = dynamic(
|
||||
() => import('@components/cart/CartSidebarView')
|
||||
)
|
||||
|
||||
const LoginView = dynamic(
|
||||
() => import('@components/auth/LoginView'),
|
||||
dynamicProps
|
||||
@@ -67,14 +66,17 @@ const Layout: FC<Props> = ({ children, pageProps }) => {
|
||||
<Navbar />
|
||||
<main className="fit">{children}</main>
|
||||
<Footer pages={pageProps.pages} />
|
||||
|
||||
<Sidebar open={displaySidebar} onClose={closeSidebar}>
|
||||
<CartSidebarView />
|
||||
</Sidebar>
|
||||
|
||||
<Modal open={displayModal} onClose={closeModal}>
|
||||
{modalView === 'LOGIN_VIEW' && <LoginView />}
|
||||
{modalView === 'SIGNUP_VIEW' && <SignUpView />}
|
||||
{modalView === 'FORGOT_VIEW' && <ForgotPassword />}
|
||||
</Modal>
|
||||
|
||||
<FeatureBar
|
||||
title="This site uses cookies to improve your experience. By clicking, you agree to our Privacy Policy."
|
||||
hide={acceptedCookies}
|
||||
|
Reference in New Issue
Block a user