-
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.
- Loading branch information
Showing
3 changed files
with
98 additions
and
0 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,30 @@ | ||
import { _generateMetadata, getTranslate } from "app/_utils"; | ||
import { WithLayout } from "app/layoutHOC"; | ||
|
||
import { APP_NAME, WEBAPP_URL } from "@calcom/lib/constants"; | ||
import { Button } from "@calcom/ui"; | ||
|
||
export const generateMetadata = () => | ||
_generateMetadata( | ||
(t) => `${t("access_denied")} | ${APP_NAME}`, | ||
() => "" | ||
); | ||
|
||
async function Error403() { | ||
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">403</h1> | ||
<h2 className="text-emphasis mt-6 text-2xl font-medium">{t("dont_have_access_this_page")}</h2> | ||
<p className="text-default mb-6 mt-4 max-w-2xl text-sm"> | ||
{t("you_need_admin_or_owner_privileges_to_access")} | ||
</p> | ||
<Button href={WEBAPP_URL}>{t("go_back_home")}</Button> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default WithLayout({ ServerPage: Error403 }); |
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, | ||
}); |