-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chore/event-type-app-router
- Loading branch information
Showing
27 changed files
with
237 additions
and
187 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
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,21 @@ | ||
"use client"; | ||
|
||
import { useLocale } from "@calcom/lib/hooks/useLocale"; | ||
import { Button, showToast } from "@calcom/ui"; | ||
|
||
export default function CopyButton({ error }: { error: string }) { | ||
const { t } = useLocale(); | ||
|
||
return ( | ||
<Button | ||
color="secondary" | ||
className="mt-2 border-0 font-sans font-normal hover:bg-gray-300" | ||
StartIcon="copy" | ||
onClick={() => { | ||
navigator.clipboard.writeText(error); | ||
showToast("Link copied!", "success"); | ||
}}> | ||
{t("copy")} | ||
</Button> | ||
); | ||
} |
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,47 @@ | ||
import { _generateMetadata, getTranslate } from "app/_utils"; | ||
import { WithLayout } from "app/layoutHOC"; | ||
|
||
import { APP_NAME } from "@calcom/lib/constants"; | ||
import { Button } from "@calcom/ui"; | ||
|
||
import CopyButton from "./copy-button"; | ||
|
||
export const generateMetadata = () => | ||
_generateMetadata( | ||
(t) => `${t("something_unexpected_occurred")} | ${APP_NAME}`, | ||
() => "" | ||
); | ||
|
||
async function Error500({ searchParams }: { searchParams: { error?: string } }) { | ||
const t = await getTranslate(); | ||
|
||
return ( | ||
<div className="bg-subtle flex h-screen"> | ||
<div className="rtl: bg-default m-auto rounded-md p-10 text-right ltr:text-left"> | ||
<h1 className="font-cal text-emphasis text-6xl">500</h1> | ||
<h2 className="text-emphasis mt-6 text-2xl font-medium">{t("500_error_message")}</h2> | ||
<p className="text-default mb-6 mt-4 max-w-2xl text-sm">{t("something_went_wrong_on_our_end")}</p> | ||
{searchParams?.error && ( | ||
<div className="mb-8 flex flex-col"> | ||
<p className="text-default mb-4 max-w-2xl text-sm"> | ||
{t("please_provide_following_text_to_suppport")}: | ||
</p> | ||
<pre className="bg-emphasis text-emphasis w-full max-w-2xl whitespace-normal break-words rounded-md p-4"> | ||
{searchParams.error} | ||
<br /> | ||
<CopyButton error={searchParams.error} /> | ||
</pre> | ||
</div> | ||
)} | ||
<Button href="mailto:[email protected]">{t("contact_support")}</Button> | ||
<Button color="secondary" href="javascript:history.back()" className="ml-2"> | ||
{t("go_back")} | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default WithLayout({ | ||
ServerPage: Error500, | ||
}); |
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,25 @@ | ||
"use client"; | ||
|
||
import { Icon } from "@calcom/ui"; | ||
import type { IconName } from "@calcom/ui"; | ||
|
||
export const IconGrid = (props: { | ||
title: string; | ||
icons: IconName[]; | ||
rootClassName?: string; | ||
iconClassName?: string; | ||
}) => ( | ||
<div className={props.rootClassName}> | ||
<h2 className="font-cal mt-6 text-lg font-medium">{props.title}</h2> | ||
<div className="grid grid-cols-2 lg:grid-cols-6"> | ||
{props.icons.map((icon) => { | ||
return ( | ||
<div key={icon} className="flex items-center gap-1"> | ||
<Icon name={icon} className={props.iconClassName} /> | ||
<div>{icon}</div> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
</div> | ||
); |
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,46 @@ | ||
import { _generateMetadata, getTranslate } from "app/_utils"; | ||
import { Inter } from "next/font/google"; | ||
import localFont from "next/font/local"; | ||
|
||
import { type IconName, IconSprites } from "@calcom/ui"; | ||
|
||
import { lucideIconList } from "../../../../packages/ui/components/icon/icon-list.mjs"; | ||
import { IconGrid } from "./IconGrid"; | ||
|
||
const interFont = Inter({ subsets: ["latin"], variable: "--font-inter", preload: true, display: "swap" }); | ||
const calFont = localFont({ | ||
src: "../../fonts/CalSans-SemiBold.woff2", | ||
variable: "--font-cal", | ||
preload: true, | ||
display: "swap", | ||
weight: "600", | ||
}); | ||
export const generateMetadata = async () => { | ||
return await _generateMetadata( | ||
(t) => t("icon_showcase"), | ||
() => "" | ||
); | ||
}; | ||
export default async function IconsPage() { | ||
const icons = Array.from(lucideIconList).sort() as IconName[]; | ||
const t = await getTranslate(); | ||
|
||
return ( | ||
<div className={`${interFont.variable} ${calFont.variable}`}> | ||
<div className="bg-subtle flex h-screen"> | ||
<IconSprites /> | ||
<div className="bg-default m-auto min-w-full rounded-md p-10 text-right ltr:text-left"> | ||
<h1 className="text-emphasis font-cal text-2xl font-medium">{t("icons_showcase")}</h1> | ||
<IconGrid title="Regular Icons" icons={icons} /> | ||
<IconGrid | ||
title="Filled Icons" | ||
icons={icons} | ||
rootClassName="bg-darkgray-100 text-gray-50" | ||
iconClassName="fill-blue-500" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
export const dynamic = "force-static"; |
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
Oops, something went wrong.