forked from crowetic/commerce
Fix dynamically import Modal component (#539)
* fix: dynamically import Modal component fixes error "document is not defined" if the user decides to display a modal at the beginning (for ads, promotions, etc...) * fix: remove spread operator * remove top level modal import * fix import path for Modal Co-authored-by: Gonzalo Pozzo <gonzalo.pozzo4@gmail.com>
This commit is contained in:
parent
683d309905
commit
c8787865b3
@ -10,7 +10,7 @@ import type { Category } from '@commerce/types/site'
|
||||
import ShippingView from '@components/checkout/ShippingView'
|
||||
import CartSidebarView from '@components/cart/CartSidebarView'
|
||||
import { useAcceptCookies } from '@lib/hooks/useAcceptCookies'
|
||||
import { Sidebar, Button, Modal, LoadingDots } from '@components/ui'
|
||||
import { Sidebar, Button, LoadingDots } from '@components/ui'
|
||||
import PaymentMethodView from '@components/checkout/PaymentMethodView'
|
||||
import CheckoutSidebarView from '@components/checkout/CheckoutSidebarView'
|
||||
|
||||
@ -42,6 +42,11 @@ const FeatureBar = dynamic(
|
||||
dynamicProps
|
||||
)
|
||||
|
||||
const Modal = dynamic(
|
||||
() => import('@components/ui/Modal'),
|
||||
Object.assign(dynamicProps, {ssr: false})
|
||||
)
|
||||
|
||||
interface Props {
|
||||
pageProps: {
|
||||
pages?: Page[]
|
||||
|
Loading…
x
Reference in New Issue
Block a user