move selfservice tables to medreport schema
add base medusa store frontend
This commit is contained in:
46
app/store/[countryCode]/(main)/layout.tsx
Normal file
46
app/store/[countryCode]/(main)/layout.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
import { Metadata } from 'next';
|
||||
|
||||
import { StoreCartShippingOption } from '@medusajs/types';
|
||||
|
||||
import { listCartOptions, retrieveCart } from '~/medusa/lib/data/cart';
|
||||
import { retrieveCustomer } from '~/medusa/lib/data/customer';
|
||||
import { getBaseURL } from '~/medusa/lib/util/env';
|
||||
import CartMismatchBanner from '~/medusa/modules/layout/components/cart-mismatch-banner';
|
||||
import Footer from '~/medusa/modules/layout/templates/footer';
|
||||
import Nav from '~/medusa/modules/layout/templates/nav';
|
||||
import FreeShippingPriceNudge from '~/medusa/modules/shipping/components/free-shipping-price-nudge';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
metadataBase: new URL(getBaseURL()),
|
||||
};
|
||||
|
||||
export default async function PageLayout(props: { children: React.ReactNode }) {
|
||||
const customer = await retrieveCustomer();
|
||||
const cart = await retrieveCart();
|
||||
let shippingOptions: StoreCartShippingOption[] = [];
|
||||
|
||||
if (cart) {
|
||||
const { shipping_options } = await listCartOptions();
|
||||
|
||||
shippingOptions = shipping_options;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Nav />
|
||||
{customer && cart && (
|
||||
<CartMismatchBanner customer={customer} cart={cart} />
|
||||
)}
|
||||
|
||||
{cart && (
|
||||
<FreeShippingPriceNudge
|
||||
variant="popup"
|
||||
cart={cart}
|
||||
shippingOptions={shippingOptions}
|
||||
/>
|
||||
)}
|
||||
{props.children}
|
||||
<Footer />
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user