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"
33import { notFound } from "next/navigation"
44import { Cart , LineItem } from "@medusajs/medusa"
55
6- import { getI18n } from "../../../../locales/server"
6+ import { getI18n , setStaticParams , getCurrentLocale } from "../../../../locales/server"
77
88import { enrichLineItems } from "@modules/cart/actions"
99import Wrapper from "@modules/checkout/components/payment-wrapper"
@@ -15,6 +15,10 @@ export const metadata: Metadata = {
1515 title : "checkout.title" ,
1616}
1717
18+ type Props = {
19+ params : { countryCode : string ; }
20+ }
21+
1822const fetchCart = async ( ) => {
1923 const cartId = cookies ( ) . get ( "_medusa_cart_id" ) ?. value
2024
@@ -32,7 +36,8 @@ const fetchCart = async () => {
3236 return cart
3337}
3438
35- export default async function Checkout ( ) {
39+ export default async function Checkout ( { params } : Props ) {
40+ setStaticParams ( params . countryCode )
3641 const t = await getI18n ( )
3742 metadata . title = t ( "checkout.title" )
3843
Original file line number Diff line number Diff line change @@ -2,13 +2,14 @@ import LocalizedClientLink from "@modules/common/components/localized-client-lin
22import ChevronDown from "@modules/common/icons/chevron-down"
33import MedusaCTA from "@modules/layout/components/medusa-cta"
44
5- import { getI18n } from "../../../locales/server"
5+ import { getI18n , getCurrentLocale , setStaticParams } from "../../../locales/server"
66
77export default async function CheckoutLayout ( {
88 children,
99} : {
1010 children : React . ReactNode
1111} ) {
12+ setStaticParams ( getCurrentLocale ( ) ) ;
1213 const t = await getI18n ( )
1314
1415 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+
23import InteractiveLink from "@modules/common/components/interactive-link"
34import { Metadata } from "next"
45
@@ -8,6 +9,7 @@ export const metadata: Metadata = {
89}
910
1011export default async function NotFound ( ) {
12+ setStaticParams ( getCurrentLocale ( ) )
1113 const t = await getI18n ( )
1214
1315 metadata . description = t ( "generic.somethingwrong" )
Original file line number Diff line number Diff line change 11import { Metadata } from "next"
22import { notFound } from "next/navigation"
33
4- import { getI18n } from "../../../../../../locales/server"
4+ import { getI18n , setStaticParams } from "../../../../../../locales/server"
55
66import AddressBook from "@modules/account/components/address-book"
77
@@ -14,7 +14,12 @@ export const metadata: Metadata = {
1414 description : "page.adresses.desc" ,
1515}
1616
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 )
1823 const t = await getI18n ( )
1924 metadata . title = t ( "page.adresses.title" )
2025 metadata . description = t ( "page.adresses.desc" )
Original file line number Diff line number Diff line change 11import { Metadata } from "next"
22import { notFound } from "next/navigation"
33
4- import { getI18n } from "../../../../../../../../locales/server"
4+ import { getI18n , setStaticParams } from "../../../../../../../../locales/server"
55
66import { retrieveOrder } from "@lib/data"
77import OrderDetailsTemplate from "@modules/order/templates/order-details-template"
88
99type Props = {
10- params : { id : string }
10+ params : { countryCode : string ; id : string }
1111}
1212
1313export async function generateMetadata ( { params } : Props ) : Promise < Metadata > {
14+ setStaticParams ( params . countryCode )
1415 const t = await getI18n ( )
1516 const order = await retrieveOrder ( params . id ) . catch ( ( ) => null )
1617
Original file line number Diff line number Diff line change 11import { Metadata } from "next"
22
3- import { getI18n } from "../../../../../../locales/server"
3+ import { getI18n , setStaticParams } from "../../../../../../locales/server"
44
55import OrderOverview from "@modules/account/components/order-overview"
66import { listCustomerOrders } from "@lib/data"
@@ -11,7 +11,12 @@ export const metadata: Metadata = {
1111 description : "page.orders.desc" ,
1212}
1313
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 )
1520 const t = await getI18n ( )
1621 metadata . title = t ( "page.orders.title" )
1722 metadata . description = t ( "page.orders.desc" )
Original file line number Diff line number Diff line change 11import { Metadata } from "next"
22
3- import { getI18n } from "../../../../../locales/server"
3+ import { getI18n , setStaticParams } from "../../../../../locales/server"
44
55import { getCustomer , listCustomerOrders } from "@lib/data"
66import Overview from "@modules/account/components/overview"
@@ -11,7 +11,12 @@ export const metadata: Metadata = {
1111 description : "page.account.desc" ,
1212}
1313
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 )
1520 const t = await getI18n ( )
1621 metadata . title = t ( "page.account.title" )
1722 metadata . description = t ( "page.account.desc" )
Original file line number Diff line number Diff line change 11import { Metadata } from "next"
22
3- import { getI18n } from "../../../../../../locales/server"
3+ import { getI18n , setStaticParams } from "../../../../../../locales/server"
44
55import ProfilePhone from "@modules/account//components/profile-phone"
66import ProfileBillingAddress from "@modules/account/components/profile-billing-address"
@@ -16,7 +16,12 @@ export const metadata: Metadata = {
1616 description : "page.profile.desc" ,
1717}
1818
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 )
2025 const t = await getI18n ( )
2126 metadata . title = t ( "page.profile.title" )
2227 metadata . description = t ( "page.profile.desc" )
Original file line number Diff line number Diff line change 11import { getCustomer } from "@lib/data"
22import AccountLayout from "@modules/account/templates/account-layout"
33
4+ import { getCurrentLocale , setStaticParams } from "../../../../locales/server"
5+
46export default async function AccountPageLayout ( {
57 dashboard,
68 login,
79} : {
810 dashboard ?: React . ReactNode
911 login ?: React . ReactNode
1012} ) {
13+ setStaticParams ( getCurrentLocale ( ) )
14+
1115 const customer = await getCustomer ( ) . catch ( ( ) => null )
1216
1317 return (
Original file line number Diff line number Diff line change 11import { Metadata } from "next"
22
3- import { getI18n } from "../../../../locales/server"
3+ import { getI18n , getCurrentLocale , setStaticParams } from "../../../../locales/server"
44
55import InteractiveLink from "@modules/common/components/interactive-link"
66
@@ -10,6 +10,7 @@ export const metadata: Metadata = {
1010}
1111
1212export default async function NotFound ( ) {
13+ setStaticParams ( getCurrentLocale ( ) )
1314 const t = await getI18n ( )
1415
1516 metadata . description = t ( "generic.somethingwrong" )
You can’t perform that action at this time.
0 commit comments