File tree Expand file tree Collapse file tree 20 files changed +86
-27
lines changed Expand file tree Collapse file tree 20 files changed +86
-27
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { cookies } from "next/headers"
3
3
import { notFound } from "next/navigation"
4
4
import { Cart , LineItem } from "@medusajs/medusa"
5
5
6
- import { getI18n } from "../../../../locales/server"
6
+ import { getI18n , setStaticParams , getCurrentLocale } from "../../../../locales/server"
7
7
8
8
import { enrichLineItems } from "@modules/cart/actions"
9
9
import Wrapper from "@modules/checkout/components/payment-wrapper"
@@ -15,6 +15,10 @@ export const metadata: Metadata = {
15
15
title : "checkout.title" ,
16
16
}
17
17
18
+ type Props = {
19
+ params : { countryCode : string ; }
20
+ }
21
+
18
22
const fetchCart = async ( ) => {
19
23
const cartId = cookies ( ) . get ( "_medusa_cart_id" ) ?. value
20
24
@@ -32,7 +36,8 @@ const fetchCart = async () => {
32
36
return cart
33
37
}
34
38
35
- export default async function Checkout ( ) {
39
+ export default async function Checkout ( { params } : Props ) {
40
+ setStaticParams ( params . countryCode )
36
41
const t = await getI18n ( )
37
42
metadata . title = t ( "checkout.title" )
38
43
Original file line number Diff line number Diff line change @@ -2,13 +2,14 @@ import LocalizedClientLink from "@modules/common/components/localized-client-lin
2
2
import ChevronDown from "@modules/common/icons/chevron-down"
3
3
import MedusaCTA from "@modules/layout/components/medusa-cta"
4
4
5
- import { getI18n } from "../../../locales/server"
5
+ import { getI18n , getCurrentLocale , setStaticParams } from "../../../locales/server"
6
6
7
7
export default async function CheckoutLayout ( {
8
8
children,
9
9
} : {
10
10
children : React . ReactNode
11
11
} ) {
12
+ setStaticParams ( getCurrentLocale ( ) ) ;
12
13
const t = await getI18n ( )
13
14
14
15
return (
Original file line number Diff line number Diff line change 1
- import { getI18n } from "../../../locales/server"
1
+ import { getI18n , getCurrentLocale , setStaticParams } from "../../../locales/server"
2
+
2
3
import InteractiveLink from "@modules/common/components/interactive-link"
3
4
import { Metadata } from "next"
4
5
@@ -8,6 +9,7 @@ export const metadata: Metadata = {
8
9
}
9
10
10
11
export default async function NotFound ( ) {
12
+ setStaticParams ( getCurrentLocale ( ) )
11
13
const t = await getI18n ( )
12
14
13
15
metadata . description = t ( "generic.somethingwrong" )
Original file line number Diff line number Diff line change 1
1
import { Metadata } from "next"
2
2
import { notFound } from "next/navigation"
3
3
4
- import { getI18n } from "../../../../../../locales/server"
4
+ import { getI18n , setStaticParams } from "../../../../../../locales/server"
5
5
6
6
import AddressBook from "@modules/account/components/address-book"
7
7
@@ -14,7 +14,12 @@ export const metadata: Metadata = {
14
14
description : "page.adresses.desc" ,
15
15
}
16
16
17
- export default async function Addresses ( ) {
17
+ type Props = {
18
+ params : { countryCode : string ; }
19
+ }
20
+
21
+ export default async function Addresses ( { params } : Props ) {
22
+ setStaticParams ( params . countryCode )
18
23
const t = await getI18n ( )
19
24
metadata . title = t ( "page.adresses.title" )
20
25
metadata . description = t ( "page.adresses.desc" )
Original file line number Diff line number Diff line change 1
1
import { Metadata } from "next"
2
2
import { notFound } from "next/navigation"
3
3
4
- import { getI18n } from "../../../../../../../../locales/server"
4
+ import { getI18n , setStaticParams } from "../../../../../../../../locales/server"
5
5
6
6
import { retrieveOrder } from "@lib/data"
7
7
import OrderDetailsTemplate from "@modules/order/templates/order-details-template"
8
8
9
9
type Props = {
10
- params : { id : string }
10
+ params : { countryCode : string ; id : string }
11
11
}
12
12
13
13
export async function generateMetadata ( { params } : Props ) : Promise < Metadata > {
14
+ setStaticParams ( params . countryCode )
14
15
const t = await getI18n ( )
15
16
const order = await retrieveOrder ( params . id ) . catch ( ( ) => null )
16
17
Original file line number Diff line number Diff line change 1
1
import { Metadata } from "next"
2
2
3
- import { getI18n } from "../../../../../../locales/server"
3
+ import { getI18n , setStaticParams } from "../../../../../../locales/server"
4
4
5
5
import OrderOverview from "@modules/account/components/order-overview"
6
6
import { listCustomerOrders } from "@lib/data"
@@ -11,7 +11,12 @@ export const metadata: Metadata = {
11
11
description : "page.orders.desc" ,
12
12
}
13
13
14
- export default async function Orders ( ) {
14
+ type Props = {
15
+ params : { countryCode : string ; }
16
+ }
17
+
18
+ export default async function Orders ( { params } : Props ) {
19
+ setStaticParams ( params . countryCode )
15
20
const t = await getI18n ( )
16
21
metadata . title = t ( "page.orders.title" )
17
22
metadata . description = t ( "page.orders.desc" )
Original file line number Diff line number Diff line change 1
1
import { Metadata } from "next"
2
2
3
- import { getI18n } from "../../../../../locales/server"
3
+ import { getI18n , setStaticParams } from "../../../../../locales/server"
4
4
5
5
import { getCustomer , listCustomerOrders } from "@lib/data"
6
6
import Overview from "@modules/account/components/overview"
@@ -11,7 +11,12 @@ export const metadata: Metadata = {
11
11
description : "page.account.desc" ,
12
12
}
13
13
14
- export default async function OverviewTemplate ( ) {
14
+ type Props = {
15
+ params : { countryCode : string ; }
16
+ }
17
+
18
+ export default async function OverviewTemplate ( { params } : Props ) {
19
+ setStaticParams ( params . countryCode )
15
20
const t = await getI18n ( )
16
21
metadata . title = t ( "page.account.title" )
17
22
metadata . description = t ( "page.account.desc" )
Original file line number Diff line number Diff line change 1
1
import { Metadata } from "next"
2
2
3
- import { getI18n } from "../../../../../../locales/server"
3
+ import { getI18n , setStaticParams } from "../../../../../../locales/server"
4
4
5
5
import ProfilePhone from "@modules/account//components/profile-phone"
6
6
import ProfileBillingAddress from "@modules/account/components/profile-billing-address"
@@ -16,7 +16,12 @@ export const metadata: Metadata = {
16
16
description : "page.profile.desc" ,
17
17
}
18
18
19
- export default async function Profile ( ) {
19
+ type Props = {
20
+ params : { countryCode : string ; }
21
+ }
22
+
23
+ export default async function Profile ( { params } : Props ) {
24
+ setStaticParams ( params . countryCode )
20
25
const t = await getI18n ( )
21
26
metadata . title = t ( "page.profile.title" )
22
27
metadata . description = t ( "page.profile.desc" )
Original file line number Diff line number Diff line change 1
1
import { getCustomer } from "@lib/data"
2
2
import AccountLayout from "@modules/account/templates/account-layout"
3
3
4
+ import { getCurrentLocale , setStaticParams } from "../../../../locales/server"
5
+
4
6
export default async function AccountPageLayout ( {
5
7
dashboard,
6
8
login,
7
9
} : {
8
10
dashboard ?: React . ReactNode
9
11
login ?: React . ReactNode
10
12
} ) {
13
+ setStaticParams ( getCurrentLocale ( ) )
14
+
11
15
const customer = await getCustomer ( ) . catch ( ( ) => null )
12
16
13
17
return (
Original file line number Diff line number Diff line change 1
1
import { Metadata } from "next"
2
2
3
- import { getI18n } from "../../../../locales/server"
3
+ import { getI18n , getCurrentLocale , setStaticParams } from "../../../../locales/server"
4
4
5
5
import InteractiveLink from "@modules/common/components/interactive-link"
6
6
@@ -10,6 +10,7 @@ export const metadata: Metadata = {
10
10
}
11
11
12
12
export default async function NotFound ( ) {
13
+ setStaticParams ( getCurrentLocale ( ) )
13
14
const t = await getI18n ( )
14
15
15
16
metadata . description = t ( "generic.somethingwrong" )
You can’t perform that action at this time.
0 commit comments