We have put together some resources to help you get started. Please find them below:
diff --git a/apps/app/components/account/email-code-form.tsx b/apps/app/components/account/email-code-form.tsx index 9fad9c969..5e4c49b1a 100644 --- a/apps/app/components/account/email-code-form.tsx +++ b/apps/app/components/account/email-code-form.tsx @@ -180,7 +180,6 @@ export const EmailCodeForm = ({ onSuccess }: any) => { ) : (
- You have signed in as {user.email}.{" "} +
+ You have signed in as {user.email}.
Sign in
{" "}
with different account that has access to this page.
+
You need to{" "} Sign in diff --git a/apps/app/components/auth-screens/project/index.ts b/apps/app/components/auth-screens/project/index.ts new file mode 100644 index 000000000..1fb77e697 --- /dev/null +++ b/apps/app/components/auth-screens/project/index.ts @@ -0,0 +1 @@ +export * from "./join-project"; diff --git a/apps/app/components/auth-screens/project/join-project.tsx b/apps/app/components/auth-screens/project/join-project.tsx new file mode 100644 index 000000000..402fff42b --- /dev/null +++ b/apps/app/components/auth-screens/project/join-project.tsx @@ -0,0 +1,68 @@ +import { useState } from "react"; + +import Image from "next/image"; +import { useRouter } from "next/router"; + +import { mutate } from "swr"; + +// services +import projectService from "services/project.service"; +// ui +import { PrimaryButton } from "components/ui"; +// icons +import { AssignmentClipboardIcon } from "components/icons"; +// images +import JoinProjectImg from "public/auth/project-not-authorized.svg"; +// fetch-keys +import { USER_PROJECT_VIEW } from "constants/fetch-keys"; + +export const JoinProject: React.FC = () => { + const [isJoiningProject, setIsJoiningProject] = useState(false); + + const router = useRouter(); + const { workspaceSlug, projectId } = router.query; + + const handleJoin = () => { + if (!workspaceSlug || !projectId) return; + + setIsJoiningProject(true); + projectService + .joinProject(workspaceSlug as string, { + project_ids: [projectId as string], + }) + .then(async () => { + await mutate(USER_PROJECT_VIEW(workspaceSlug.toString())); + setIsJoiningProject(false); + }) + .catch((err) => { + console.error(err); + setIsJoiningProject(false); + }); + }; + + return ( +
+ You are not a member of this project, but you can join this project by clicking the button + below. +
++ You{"'"}re not a member of this workspace. Please contact the workspace admin to get + an invitation or check your pending invitations. +
+