diff --git a/app/[lang]/(live)/(protected)/my-pages/[...path]/page.module.css b/app/[lang]/(live)/(protected)/my-pages/[...path]/page.module.css index b5a2ba63b..704726fc9 100644 --- a/app/[lang]/(live)/(protected)/my-pages/[...path]/page.module.css +++ b/app/[lang]/(live)/(protected)/my-pages/[...path]/page.module.css @@ -1,11 +1,3 @@ -.content { - display: grid; - padding-bottom: var(--Spacing-x9); - padding-left: var(--Spacing-x0); - padding-right: var(--Spacing-x0); - position: relative; -} - .blocks { display: grid; gap: var(--Spacing-x5); @@ -14,16 +6,9 @@ } @media screen and (min-width: 1367px) { - .content { - gap: var(--Spacing-x9); - grid-template-columns: 25rem 1fr; - padding-left: var(--Spacing-x3); - padding-right: var(--Spacing-x3); - } - .blocks { gap: var(--Spacing-x7); padding-left: var(--Spacing-x0); padding-right: var(--Spacing-x0); } -} \ No newline at end of file +} diff --git a/app/[lang]/(live)/(protected)/my-pages/[...path]/page.tsx b/app/[lang]/(live)/(protected)/my-pages/[...path]/page.tsx index a6050337e..46882e1d7 100644 --- a/app/[lang]/(live)/(protected)/my-pages/[...path]/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/[...path]/page.tsx @@ -1,8 +1,7 @@ -import { _ } from "@/lib/translation" import { serverClient } from "@/lib/trpc/server" import Content from "@/components/MyPages/AccountPage/Content" -import Sidebar from "@/components/MyPages/Sidebar" +import { getIntl } from "@/i18n" import styles from "./page.module.css" @@ -12,17 +11,14 @@ export default async function MyPages({ params, }: PageArgs) { const accountPage = await serverClient().contentstack.accountPage.get() - + const { formatMessage } = await getIntl() return ( -
- -
- {accountPage.content.length ? ( - - ) : ( -

{_("No content published")}

- )} -
-
+
+ {accountPage.content.length ? ( + + ) : ( +

{formatMessage({ id: "No content published" })}

+ )} +
) } diff --git a/app/[lang]/(live)/(protected)/my-pages/layout.module.css b/app/[lang]/(live)/(protected)/my-pages/layout.module.css index d2b0bc4bd..e94ad3a39 100644 --- a/app/[lang]/(live)/(protected)/my-pages/layout.module.css +++ b/app/[lang]/(live)/(protected)/my-pages/layout.module.css @@ -8,3 +8,20 @@ grid-template-rows: auto 1fr; min-height: 100dvh; } + +.content { + display: grid; + padding-bottom: var(--Spacing-x9); + padding-left: var(--Spacing-x0); + padding-right: var(--Spacing-x0); + position: relative; +} + +@media screen and (min-width: 1367px) { + .content { + gap: var(--Spacing-x9); + grid-template-columns: 25rem 1fr; + padding-left: var(--Spacing-x3); + padding-right: var(--Spacing-x3); + } +} diff --git a/app/[lang]/(live)/(protected)/my-pages/layout.tsx b/app/[lang]/(live)/(protected)/my-pages/layout.tsx index 4ba2376f5..d19162910 100644 --- a/app/[lang]/(live)/(protected)/my-pages/layout.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/layout.tsx @@ -1,3 +1,5 @@ +import Sidebar from "@/components/MyPages/Sidebar" + import styles from "./layout.module.css" import { LangParams, LayoutArgs } from "@/types/params" @@ -5,13 +7,17 @@ import { LangParams, LayoutArgs } from "@/types/params" export default async function MyPagesLayout({ breadcrumbs, children, + params, }: React.PropsWithChildren> & { breadcrumbs: React.ReactNode }) { return (
{breadcrumbs} - {children} +
+ + {children} +
) } diff --git a/app/[lang]/(live)/(protected)/my-pages/profile/@edit/edit/page.tsx b/app/[lang]/(live)/(protected)/my-pages/profile/@edit/edit/page.tsx index 0ca34063c..9eada21c6 100644 --- a/app/[lang]/(live)/(protected)/my-pages/profile/@edit/edit/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/profile/@edit/edit/page.tsx @@ -1,6 +1,7 @@ "use client" +import { useIntl } from "react-intl" + import { profile } from "@/constants/routes/myPages" -import { _ } from "@/lib/translation" import { useProfileStore } from "@/stores/edit-profile" import Button from "@/components/TempDesignSystem/Button" @@ -9,26 +10,31 @@ import Link from "@/components/TempDesignSystem/Link" import type { LangParams, PageArgs } from "@/types/params" export default function EditProfile({ params }: PageArgs) { + const { formatMessage } = useIntl() const isPending = useProfileStore((store) => store.pending) const isValid = useProfileStore((store) => store.valid) + + const cancel = formatMessage({ id: "Cancel" }) + const save = formatMessage({ id: "Save" }) return ( <> ) diff --git a/app/[lang]/(live)/(protected)/my-pages/profile/@view/page.tsx b/app/[lang]/(live)/(protected)/my-pages/profile/@view/page.tsx index 1415e38a4..9f95596dd 100644 --- a/app/[lang]/(live)/(protected)/my-pages/profile/@view/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/profile/@view/page.tsx @@ -1,15 +1,18 @@ import { profileEdit } from "@/constants/routes/myPages" -import { _ } from "@/lib/translation" import Button from "@/components/TempDesignSystem/Button" import Link from "@/components/TempDesignSystem/Link" +import { getIntl } from "@/i18n" import type { LangParams, PageArgs } from "@/types/params" -export default function ProfileView({ params }: PageArgs) { +export default async function ProfileView({ params }: PageArgs) { + const { formatMessage } = await getIntl() return ( ) } diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.tsx b/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.tsx index e2088d287..0b2690e6c 100644 --- a/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.tsx +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.tsx @@ -12,5 +12,5 @@ export default function ContentTypeLayout({ }: React.PropsWithChildren< LayoutArgs >) { - return
{children}
+ return
{children}
} diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx b/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx index adbde5d25..93803a8d9 100644 --- a/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx @@ -14,10 +14,10 @@ export default async function ContentTypePage({ params, }: PageArgs) { switch (params.contentType) { - case "loyalty-page": - return case "content-page": return + case "loyalty-page": + return default: const type: never = params.contentType console.error(`Unsupported content type given: ${type}`) diff --git a/app/[lang]/(live)/error.tsx b/app/[lang]/(live)/error.tsx index b833c6699..10bb4875e 100644 --- a/app/[lang]/(live)/error.tsx +++ b/app/[lang]/(live)/error.tsx @@ -2,6 +2,7 @@ import { useParams, usePathname } from "next/navigation" import { useEffect } from "react" +import { useIntl } from "react-intl" import { findLang } from "@/constants/languages" import { login } from "@/constants/routes/handleAuth" @@ -16,6 +17,7 @@ export default function Error({ }: { error: Error & { digest?: string } }) { + const intl = useIntl() const params = useParams() useEffect(() => { @@ -32,8 +34,12 @@ export default function Error({ const lang = findLang(pathname) return ( -
-
{lang}: Something went wrong!
-
+
+
+ {lang}: {intl.formatMessage({ id: "Something went wrong!" })} +
+
) } diff --git a/app/[lang]/(live)/layout.tsx b/app/[lang]/(live)/layout.tsx index 54e0d41e8..976b8ccbd 100644 --- a/app/[lang]/(live)/layout.tsx +++ b/app/[lang]/(live)/layout.tsx @@ -9,6 +9,8 @@ import AdobeScript from "@/components/Current/AdobeScript" import Footer from "@/components/Current/Footer" import Header from "@/components/Current/Header" import VwoScript from "@/components/Current/VwoScript" +import { getIntl } from "@/i18n" +import ServerIntlProvider from "@/i18n/Provider" import type { Metadata } from "next" @@ -28,6 +30,7 @@ export default async function RootLayout({ languageSwitcher: React.ReactNode } >) { + const { defaultLocale, locale, messages } = await getIntl() return ( @@ -50,11 +53,16 @@ export default async function RootLayout({ - -
- {children} -