diff --git a/components/cart/CartSidebarView/CartSidebarView.tsx b/components/cart/CartSidebarView/CartSidebarView.tsx index 0ad7b95f1..b35fdb18b 100644 --- a/components/cart/CartSidebarView/CartSidebarView.tsx +++ b/components/cart/CartSidebarView/CartSidebarView.tsx @@ -10,6 +10,7 @@ import CartItem from '../CartItem' import s from './CartSidebarView.module.css' const CartSidebarView: FC = () => { + const { closeSidebar } = useUI() const { data, isEmpty } = useCart() const { price: subTotal } = usePrice( data && { @@ -23,7 +24,6 @@ const CartSidebarView: FC = () => { currencyCode: data.currency.code, } ) - const { closeSidebar } = useUI() const handleClose = () => closeSidebar() const items = data?.line_items.physical_items ?? [] diff --git a/components/common/Layout/Layout.tsx b/components/common/Layout/Layout.tsx index d53f0a740..f76a75561 100644 --- a/components/common/Layout/Layout.tsx +++ b/components/common/Layout/Layout.tsx @@ -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 = () => (
@@ -20,9 +21,7 @@ const Loading = () => ( const dynamicProps = { loading: () => , } -const CartSidebarView = dynamic( - () => import('@components/cart/CartSidebarView') -) + const LoginView = dynamic( () => import('@components/auth/LoginView'), dynamicProps @@ -67,14 +66,17 @@ const Layout: FC = ({ children, pageProps }) => {
{children}