Skip to content

Commit 9b4b213

Browse files
committed
feat: account and orders
1 parent 8936bb6 commit 9b4b213

File tree

28 files changed

+166
-149
lines changed

28 files changed

+166
-149
lines changed

src/app/account/addresses/page.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import AccountLayout from "@modules/account/templates/account-layout"
2+
import AddressesTemplate from "@modules/account/templates/addresses-template"
3+
import { Metadata } from "next"
4+
5+
export const metadata: Metadata = {
6+
title: "Addresses",
7+
description: "View your addresses",
8+
}
9+
10+
export default function Addresses() {
11+
return (
12+
<AccountLayout>
13+
<AddressesTemplate />
14+
</AccountLayout>
15+
)
16+
}

src/app/account/layout.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import PageLayout from "app/page-layout"
2+
3+
export default function AccountPageLayout({
4+
children,
5+
}: {
6+
children: React.ReactNode
7+
}) {
8+
return <PageLayout>{children}</PageLayout>
9+
}

src/app/account/login/page.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import LoginTemplate from "@modules/account/templates/login-template"
2+
import { Metadata } from "next"
3+
4+
export const metadata: Metadata = {
5+
title: "Sign in",
6+
description: "Sign in to your ACME account.",
7+
}
8+
9+
export default function Login() {
10+
return <LoginTemplate />
11+
}

src/app/account/orders/page.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import AccountLayout from "@modules/account/templates/account-layout"
2+
import OrdersTemplate from "@modules/account/templates/orders-template"
3+
import { Metadata } from "next"
4+
5+
export const metadata: Metadata = {
6+
title: "Orders",
7+
description: "Overview of your previous orders..",
8+
}
9+
10+
export default function Orders() {
11+
return (
12+
<AccountLayout>
13+
<OrdersTemplate />
14+
</AccountLayout>
15+
)
16+
}

src/app/account/page.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import AccountLayout from "@modules/account/templates/account-layout"
2+
import OverviewTemplate from "@modules/account/templates/overview-template"
3+
import { Metadata } from "next"
4+
5+
export const metadata: Metadata = {
6+
title: "Account",
7+
description: "Overview of your account activity.",
8+
}
9+
10+
export default function Account() {
11+
return (
12+
<AccountLayout>
13+
<OverviewTemplate />
14+
</AccountLayout>
15+
)
16+
}

src/app/account/profile/page.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import AccountLayout from "@modules/account/templates/account-layout"
2+
import ProfileTemplate from "@modules/account/templates/profile-template"
3+
import { Metadata } from "next"
4+
5+
export const metadata: Metadata = {
6+
title: "Profile",
7+
description: "View and edit your ACME profile.",
8+
}
9+
10+
export default function Profile() {
11+
return (
12+
<AccountLayout>
13+
<ProfileTemplate />
14+
</AccountLayout>
15+
)
16+
}

src/app/collections/[handle]/page.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import PageLayout from "app/page-layout"
2-
import Collection from "./collection"
3-
2+
import CollectionTemplate from "@modules/collections/templates"
43
import { Metadata } from "next"
54

65
type Props = {
76
params: { handle: string }
8-
searchParams: { [key: string]: string | string[] | undefined }
97
}
108

119
const BASEURL = process.env.NEXT_PUBLIC_BASE_URL ?? "https://localhost:3000"
@@ -28,7 +26,7 @@ export default async function CollectionPage({ params }: Props) {
2826

2927
return (
3028
<PageLayout>
31-
<Collection collection={collection} />
29+
<CollectionTemplate collection={collection} />
3230
</PageLayout>
3331
)
3432
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import SkeletonOrderConfirmed from "@modules/skeletons/templates/skeleton-order-confirmed"
2+
3+
export default function Loading() {
4+
return <SkeletonOrderConfirmed />
5+
}

src/app/order/confirmed/[id]/page.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import medusaRequest from "@lib/medusa-fetch"
2+
import OrderCompletedTemplate from "@modules/order/templates/order-completed-template"
3+
import PageLayout from "app/page-layout"
4+
5+
type Props = {
6+
params: { id: string }
7+
}
8+
9+
export default async function CollectionPage({ params }: Props) {
10+
const { order } = await medusaRequest("GET", `/orders/${params.id}`).then(
11+
(res) => res.body
12+
)
13+
14+
return (
15+
<PageLayout>
16+
<OrderCompletedTemplate order={order} />
17+
</PageLayout>
18+
)
19+
}

src/lib/context/account-context.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export const AccountProvider = ({ children }: AccountProviderProps) => {
3838
refetch,
3939
remove,
4040
} = useMeCustomer({ onError: () => {} })
41+
42+
console.log({ customer, retrievingCustomer })
4143
const loginView = useState<LOGIN_VIEW>(LOGIN_VIEW.SIGN_IN)
4244

4345
const router = useRouter()

0 commit comments

Comments
 (0)