Merged in feat/sw-3197-add-url-to-path (pull request #2577)
feat(SW-3197): Add required middleware and url to path in partner-sas * Add url to path and required middleware Approved-by: Matilda Landström
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
import "@scandic-hotels/design-system/style.css"
|
||||
import "@scandic-hotels/design-system/fonts.css"
|
||||
import "@/public/_static/css/design-system-new-deprecated.css"
|
||||
import "./globals.css"
|
||||
|
||||
import { Lang } from "@scandic-hotels/common/constants/language"
|
||||
import { TrpcProvider } from "@scandic-hotels/trpc/Provider"
|
||||
|
||||
import { getMessages } from "../i18n"
|
||||
import ClientIntlProvider from "../i18n/Provider"
|
||||
import { setLang } from "../i18n/serverContext"
|
||||
import { getMessages } from "@/i18n"
|
||||
import ClientIntlProvider from "@/i18n/Provider"
|
||||
import { setLang } from "@/i18n/serverContext"
|
||||
|
||||
import type { Metadata } from "next"
|
||||
|
||||
@@ -27,8 +26,7 @@ type RootLayoutProps = {
|
||||
}
|
||||
|
||||
export default async function RootLayout(props: RootLayoutProps) {
|
||||
// const params = await props.params
|
||||
const params = { lang: Lang.sv }
|
||||
const params = await props.params
|
||||
|
||||
const { children } = props
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export default function NotFoundPage() {
|
||||
// eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
||||
return <div>Not found, forgot lang in url?</div>
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
.layout {
|
||||
font-family: var(--typography-Body-Regular-fontFamily);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import styles from "./page.module.css"
|
||||
|
||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||
|
||||
export default async function MiddlewareError(props: {
|
||||
params: Promise<{ lang: Lang; status: string }>
|
||||
}) {
|
||||
const params = await props.params
|
||||
|
||||
return (
|
||||
// eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
||||
<div className={styles.layout}>
|
||||
Middleware error {params.lang} {params.status}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
4
apps/partner-sas/app/[lang]/not-found.tsx
Normal file
4
apps/partner-sas/app/[lang]/not-found.tsx
Normal file
@@ -0,0 +1,4 @@
|
||||
export default function NotFoundPage() {
|
||||
// eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
||||
return <div>Not Found, missing lang in url?</div>
|
||||
}
|
||||
@@ -4,7 +4,8 @@ import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
|
||||
import { serverClient } from "@/lib/trpc"
|
||||
|
||||
import { getIntl } from "../i18n"
|
||||
import { getIntl } from "@/i18n"
|
||||
|
||||
import { ClientComponent } from "./ClientComponent"
|
||||
|
||||
import styles from "./page.module.css"
|
||||
@@ -1,2 +0,0 @@
|
||||
body {
|
||||
}
|
||||
Reference in New Issue
Block a user