diff --git a/storefront/actions/medusa/order.ts b/storefront/actions/medusa/order.ts
index 0a0edda..e36dc2c 100644
--- a/storefront/actions/medusa/order.ts
+++ b/storefront/actions/medusa/order.ts
@@ -33,8 +33,9 @@ export async function placeOrder() {
if (cartRes?.type === "order") {
removeCartId();
- // TODO: make this us the country code
- redirect(`/order/confirmed/${cartRes.order.id}`);
+ const countryCode =
+ cartRes.order.shipping_address?.country_code?.toLowerCase();
+ redirect(`/${countryCode}/order/confirmed/${cartRes.order.id}`);
}
return cartRes.cart;
diff --git a/storefront/app/(country-code)/layout.tsx b/storefront/app/(country-code)/layout.tsx
deleted file mode 100644
index 342c453..0000000
--- a/storefront/app/(country-code)/layout.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import type {PropsWithChildren} from "react";
-
-import {ExitPreview} from "@/components/exit-preview";
-import {TailwindIndicator} from "@/components/tailwind-indicator";
-import cache from "next/cache";
-import {draftMode} from "next/headers";
-import VisualEditing from "next-sanity/visual-editing/client-component";
-
-export default function Layout({children}: PropsWithChildren) {
- const shouldEnableDraftModeToggle =
- process.env.NODE_ENV === "development" && draftMode().isEnabled;
- return (
-
- {children}
- {draftMode().isEnabled && (
- {
- "use server";
- if (!draftMode().isEnabled) {
- console.debug(
- "Skipped manual refresh because draft mode is not enabled",
- );
- return;
- }
- if (payload.source === "mutation") {
- if (payload.document.slug?.current) {
- const tag = `${payload.document._type}:${payload.document.slug.current}`;
- console.log("Revalidate slug", tag);
- await cache.revalidateTag(tag);
- }
- console.log("Revalidate tag", payload.document._type);
- return cache.revalidateTag(payload.document._type);
- }
- await cache.revalidatePath("/", "layout");
- }}
- />
- )}
-
- {shouldEnableDraftModeToggle && (
-
- )}
-
- );
-}
diff --git a/storefront/app/(country-code)/(checkout)/checkout/_parts/cart-details/index.tsx b/storefront/app/[countryCode]/(checkout)/checkout/_parts/cart-details/index.tsx
similarity index 100%
rename from storefront/app/(country-code)/(checkout)/checkout/_parts/cart-details/index.tsx
rename to storefront/app/[countryCode]/(checkout)/checkout/_parts/cart-details/index.tsx
diff --git a/storefront/app/(country-code)/(checkout)/checkout/_parts/cart-details/line-item.tsx b/storefront/app/[countryCode]/(checkout)/checkout/_parts/cart-details/line-item.tsx
similarity index 100%
rename from storefront/app/(country-code)/(checkout)/checkout/_parts/cart-details/line-item.tsx
rename to storefront/app/[countryCode]/(checkout)/checkout/_parts/cart-details/line-item.tsx
diff --git a/storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/address-form/index.tsx b/storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/address-form/index.tsx
similarity index 100%
rename from storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/address-form/index.tsx
rename to storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/address-form/index.tsx
diff --git a/storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/delivery/index.tsx b/storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/delivery/index.tsx
similarity index 100%
rename from storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/delivery/index.tsx
rename to storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/delivery/index.tsx
diff --git a/storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/index.tsx b/storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/index.tsx
similarity index 100%
rename from storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/index.tsx
rename to storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/index.tsx
diff --git a/storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/payment/button/index.tsx b/storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/payment/button/index.tsx
similarity index 100%
rename from storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/payment/button/index.tsx
rename to storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/payment/button/index.tsx
diff --git a/storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/payment/button/manual.tsx b/storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/payment/button/manual.tsx
similarity index 100%
rename from storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/payment/button/manual.tsx
rename to storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/payment/button/manual.tsx
diff --git a/storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/payment/button/stripe.tsx b/storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/payment/button/stripe.tsx
similarity index 100%
rename from storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/payment/button/stripe.tsx
rename to storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/payment/button/stripe.tsx
diff --git a/storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/payment/index.tsx b/storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/payment/index.tsx
similarity index 100%
rename from storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/payment/index.tsx
rename to storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/payment/index.tsx
diff --git a/storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/payment/utils.ts b/storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/payment/utils.ts
similarity index 100%
rename from storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/payment/utils.ts
rename to storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/payment/utils.ts
diff --git a/storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/payment/wrapper/index.tsx b/storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/payment/wrapper/index.tsx
similarity index 100%
rename from storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/payment/wrapper/index.tsx
rename to storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/payment/wrapper/index.tsx
diff --git a/storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/payment/wrapper/stripe-wrapper.tsx b/storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/payment/wrapper/stripe-wrapper.tsx
similarity index 100%
rename from storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/payment/wrapper/stripe-wrapper.tsx
rename to storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/payment/wrapper/stripe-wrapper.tsx
diff --git a/storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/review.tsx b/storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/review.tsx
similarity index 100%
rename from storefront/app/(country-code)/(checkout)/checkout/_parts/checkout-form/review.tsx
rename to storefront/app/[countryCode]/(checkout)/checkout/_parts/checkout-form/review.tsx
diff --git a/storefront/app/(country-code)/(checkout)/checkout/page.tsx b/storefront/app/[countryCode]/(checkout)/checkout/page.tsx
similarity index 100%
rename from storefront/app/(country-code)/(checkout)/checkout/page.tsx
rename to storefront/app/[countryCode]/(checkout)/checkout/page.tsx
diff --git a/storefront/app/(country-code)/(website)/[...path]/_part/table-of-content.tsx b/storefront/app/[countryCode]/(website)/[...path]/_part/table-of-content.tsx
similarity index 90%
rename from storefront/app/(country-code)/(website)/[...path]/_part/table-of-content.tsx
rename to storefront/app/[countryCode]/(website)/[...path]/_part/table-of-content.tsx
index e7b6d4f..4335d49 100644
--- a/storefront/app/(country-code)/(website)/[...path]/_part/table-of-content.tsx
+++ b/storefront/app/[countryCode]/(website)/[...path]/_part/table-of-content.tsx
@@ -1,12 +1,13 @@
import type {TEXT_PAGE_QUERYResult} from "@/types/sanity.generated";
import type {BlocksBody} from "@/utils/content/toc";
+import LocalizedLink from "@/components/shared/localized-link";
import TocSelect from "@/components/shared/toc-select";
import Body from "@/components/shared/typography/body";
import getBlocksToc from "@/utils/content/toc";
import {getPtComponentId} from "@/utils/ids";
import {toPlainText} from "@portabletext/react";
-import Link from "next/link";
+import React from "react";
export default function TableOfContents({
body,
@@ -24,7 +25,7 @@ export default function TableOfContents({
index,
) =>
!item.isSub && (
-
{toPlainText(item.block)}