move selfservice tables to medreport schema
add base medusa store frontend
This commit is contained in:
30
app/store/[countryCode]/(checkout)/checkout/page.tsx
Normal file
30
app/store/[countryCode]/(checkout)/checkout/page.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { retrieveCart } from "@lib/data/cart"
|
||||
import { retrieveCustomer } from "@lib/data/customer"
|
||||
import PaymentWrapper from "@modules/checkout/components/payment-wrapper"
|
||||
import CheckoutForm from "@modules/checkout/templates/checkout-form"
|
||||
import CheckoutSummary from "@modules/checkout/templates/checkout-summary"
|
||||
import { Metadata } from "next"
|
||||
import { notFound } from "next/navigation"
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Checkout",
|
||||
}
|
||||
|
||||
export default async function Checkout() {
|
||||
const cart = await retrieveCart()
|
||||
|
||||
if (!cart) {
|
||||
return notFound()
|
||||
}
|
||||
|
||||
const customer = await retrieveCustomer()
|
||||
|
||||
return (
|
||||
<div className="grid grid-cols-1 small:grid-cols-[1fr_416px] content-container gap-x-40 py-12">
|
||||
<PaymentWrapper cart={cart}>
|
||||
<CheckoutForm cart={cart} customer={customer} />
|
||||
</PaymentWrapper>
|
||||
<CheckoutSummary cart={cart} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
45
app/store/[countryCode]/(checkout)/layout.tsx
Normal file
45
app/store/[countryCode]/(checkout)/layout.tsx
Normal file
@@ -0,0 +1,45 @@
|
||||
import { LocalizedClientLink } from '~/medusa/modules/common/components';
|
||||
import { ChevronDownIcon } from '~/medusa/modules/common/icons';
|
||||
import { MedusaCTA } from '~/medusa/modules/layout/components';
|
||||
|
||||
export default function CheckoutLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<div className="small:min-h-screen relative w-full bg-white">
|
||||
<div className="h-16 border-b bg-white">
|
||||
<nav className="content-container flex h-full items-center justify-between">
|
||||
<LocalizedClientLink
|
||||
href="/cart"
|
||||
className="text-small-semi text-ui-fg-base flex flex-1 basis-0 items-center gap-x-2 uppercase"
|
||||
data-testid="back-to-cart-link"
|
||||
>
|
||||
<ChevronDownIcon className="rotate-90" size={16} />
|
||||
<span className="small:block txt-compact-plus text-ui-fg-subtle hover:text-ui-fg-base mt-px hidden">
|
||||
Back to shopping cart
|
||||
</span>
|
||||
<span className="small:hidden txt-compact-plus text-ui-fg-subtle hover:text-ui-fg-base mt-px block">
|
||||
Back
|
||||
</span>
|
||||
</LocalizedClientLink>
|
||||
<LocalizedClientLink
|
||||
href="/"
|
||||
className="txt-compact-xlarge-plus text-ui-fg-subtle hover:text-ui-fg-base uppercase"
|
||||
data-testid="store-link"
|
||||
>
|
||||
Medusa Store
|
||||
</LocalizedClientLink>
|
||||
<div className="flex-1 basis-0" />
|
||||
</nav>
|
||||
</div>
|
||||
<div className="relative" data-testid="checkout-container">
|
||||
{children}
|
||||
</div>
|
||||
<div className="flex w-full items-center justify-center py-4">
|
||||
<MedusaCTA />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
20
app/store/[countryCode]/(checkout)/not-found.tsx
Normal file
20
app/store/[countryCode]/(checkout)/not-found.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Metadata } from 'next';
|
||||
|
||||
import InteractiveLink from '~/medusa/modules/common/components/interactive-link';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: '404',
|
||||
description: 'Something went wrong',
|
||||
};
|
||||
|
||||
export default async function NotFound() {
|
||||
return (
|
||||
<div className="flex min-h-[calc(100vh-64px)] flex-col items-center justify-center gap-4">
|
||||
<h1 className="text-2xl-semi text-ui-fg-base">Page not found</h1>
|
||||
<p className="text-small-regular text-ui-fg-base">
|
||||
The page you tried to access does not exist.
|
||||
</p>
|
||||
<InteractiveLink href="/">Go to frontpage</InteractiveLink>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user