forked from calcom/cal.com
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7b1e4d
commit f72d7e7
Showing
17 changed files
with
124 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import NotFoundPage from "@pages/404"; | ||
import { cookies, headers } from "next/headers"; | ||
|
||
import { getLocale } from "@calcom/features/auth/lib/getLocale"; | ||
import { serverSideTranslations } from "@calcom/web/server/lib/serverSideTranslations"; | ||
|
||
import PageWrapper from "@components/PageWrapperAppDir"; | ||
|
||
const getProps = async (h: ReturnType<typeof headers>, c: ReturnType<typeof cookies>) => { | ||
// @ts-expect-error we cannot access ctx.req in app dir, however headers and cookies are only properties needed to extract the locale | ||
const locale = await getLocale({ headers: h, cookies: c }); | ||
|
||
const i18n = (await serverSideTranslations(locale)) || "en"; | ||
|
||
return { | ||
i18n, | ||
}; | ||
}; | ||
|
||
const NotFound = async () => { | ||
const h = headers(); | ||
const c = cookies(); | ||
|
||
const nonce = h.get("x-nonce") ?? undefined; | ||
|
||
const { i18n } = await getProps(h, c); | ||
|
||
return ( | ||
// @ts-expect-error withTrpc expects AppProps | ||
<PageWrapper requiresLicense={false} pageProps={{ i18n }} nonce={nonce} themeBasis={null} i18n={i18n}> | ||
<NotFoundPage /> | ||
</PageWrapper> | ||
); | ||
}; | ||
|
||
export default NotFound; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { headers } from "next/headers"; | ||
import { type ReactElement } from "react"; | ||
|
||
import { getLayout } from "@calcom/features/MainLayout"; | ||
|
||
import PageWrapper from "@components/PageWrapperAppDir"; | ||
|
||
type EventTypesLayoutProps = { | ||
children: ReactElement; | ||
}; | ||
|
||
export default function EventTypesLayout({ children }: EventTypesLayoutProps) { | ||
const h = headers(); | ||
const nonce = h.get("x-nonce") ?? undefined; | ||
|
||
return ( | ||
// @ts-expect-error withTrpc expects AppProps | ||
<PageWrapper | ||
getLayout={getLayout} | ||
requiresLicense={false} | ||
pageProps={children?.props} | ||
nonce={nonce} | ||
themeBasis={null}> | ||
{children} | ||
</PageWrapper> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import EventTypes from "@pages/event-types"; | ||
import type { Metadata } from "next"; | ||
|
||
import { IS_CALCOM, WEBAPP_URL } from "@calcom/lib/constants"; | ||
|
||
export const metadata: Metadata = { | ||
viewport: "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0", | ||
metadataBase: new URL(IS_CALCOM ? "https://cal.com" : WEBAPP_URL), | ||
alternates: { | ||
canonical: "/event-types", | ||
}, | ||
twitter: { | ||
card: "summary_large_image", | ||
title: "@calcom", | ||
}, | ||
}; | ||
|
||
export default EventTypes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { serverSideTranslations as _serverSideTranslations } from "next-i18next/serverSideTranslations"; | ||
|
||
//@ts-expect-error no type definitions | ||
import config from "@calcom/web/next-i18next.config"; | ||
|
||
export const serverSideTranslations: typeof _serverSideTranslations = async (locale, namespaces) => { | ||
return _serverSideTranslations(locale, namespaces, config); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
"use client"; | ||
|
||
import type { ComponentProps } from "react"; | ||
import React from "react"; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters