forked from github/plane
3c2f5d12ed
* chore: add next theme and initial setup * chore: add dark mode colors to layouts * chore: user general setting page theming * chore: dashboard theming * chore: project page theming * chore: workspace setting page theming * chore: my issue page theming * chore: cmdk theming * chore: change hardcode bg and text color to theme * chore: change color name according to the design * style: fix card in the dashboard * style: fix merge conflict design issues * style: add light high contrast and dark high contrast * style: fix cmd k menu color and selection * feat: change theme from cmdk menu * chore: add multiple theme field to custom theme * chore: removed custom theming * fix: build error --------- Co-authored-by: Saheb Giri <iamsahebgiri@gmail.com>
68 lines
2.1 KiB
TypeScript
68 lines
2.1 KiB
TypeScript
import React from "react";
|
|
// next
|
|
import Link from "next/link";
|
|
import Image from "next/image";
|
|
import { useRouter } from "next/router";
|
|
// layouts
|
|
import DefaultLayout from "layouts/default-layout";
|
|
// hooks
|
|
import useUser from "hooks/use-user";
|
|
// images
|
|
import ProjectNotAuthorizedImg from "public/auth/project-not-authorized.svg";
|
|
import WorkspaceNotAuthorizedImg from "public/auth/workspace-not-authorized.svg";
|
|
|
|
type Props = {
|
|
actionButton?: React.ReactNode;
|
|
type: "project" | "workspace";
|
|
};
|
|
|
|
export const NotAuthorizedView: React.FC<Props> = ({ actionButton, type }) => {
|
|
const { user } = useUser();
|
|
const { asPath: currentPath } = useRouter();
|
|
|
|
return (
|
|
<DefaultLayout
|
|
meta={{
|
|
title: "Plane - Not Authorized",
|
|
description: "You are not authorized to view this page",
|
|
}}
|
|
>
|
|
<div className="flex h-full w-full flex-col items-center justify-center gap-y-5 text-center">
|
|
<div className="h-44 w-72">
|
|
<Image
|
|
src={type === "project" ? ProjectNotAuthorizedImg : WorkspaceNotAuthorizedImg}
|
|
height="176"
|
|
width="288"
|
|
alt="ProjectSettingImg"
|
|
/>
|
|
</div>
|
|
<h1 className="text-xl font-medium text-brand-base">
|
|
Oops! You are not authorized to view this page
|
|
</h1>
|
|
|
|
<div className="w-full text-base text-brand-secondary max-w-md ">
|
|
{user ? (
|
|
<p>
|
|
You have signed in as {user.email}. <br />
|
|
<Link href={`/signin?next=${currentPath}`}>
|
|
<a className="text-brand-base font-medium">Sign in</a>
|
|
</Link>{" "}
|
|
with different account that has access to this page.
|
|
</p>
|
|
) : (
|
|
<p>
|
|
You need to{" "}
|
|
<Link href={`/signin?next=${currentPath}`}>
|
|
<a className="text-brand-base font-medium">Sign in</a>
|
|
</Link>{" "}
|
|
with an account that has access to this page.
|
|
</p>
|
|
)}
|
|
</div>
|
|
|
|
{actionButton}
|
|
</div>
|
|
</DefaultLayout>
|
|
);
|
|
};
|