-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from novaforgood/Max/email-whitelist
Max/email whitelist
- Loading branch information
Showing
19 changed files
with
206 additions
and
54 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
hasura/migrations/mentorcenter/1720336738265_add_profile_role/down.sql
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,4 @@ | ||
-- Could not auto-generate a down migration. | ||
-- Please write an appropriate down migration for the SQL below: | ||
-- INSERT INTO profile_role (value, description) VALUES | ||
-- ('Archived', 'Profile cannot access the space, but can modify profile settings, and regain access via invite link.'); |
2 changes: 2 additions & 0 deletions
2
hasura/migrations/mentorcenter/1720336738265_add_profile_role/up.sql
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,2 @@ | ||
INSERT INTO profile_role (value, description) VALUES | ||
('Archived', 'Profile cannot access the space, but can modify profile settings, and regain access via invite link.'); |
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,62 @@ | ||
import { ReactNode, useState } from "react"; | ||
|
||
import Link from "next/link"; | ||
import { useRouter } from "next/router"; | ||
|
||
import { Profile_Role_Enum, useUserQuery } from "../generated/graphql"; | ||
import { useCurrentProfile } from "../hooks/useCurrentProfile"; | ||
import { useCurrentSpace } from "../hooks/useCurrentSpace"; | ||
|
||
import { Button, Modal, Text } from "./atomic"; | ||
|
||
const SAFE_LINKS = ["join", "create-profile"]; | ||
|
||
export function ArchivedModal() { | ||
const router = useRouter(); | ||
const { currentProfile, currentProfileHasRole } = useCurrentProfile(); | ||
const { currentSpace } = useCurrentSpace(); | ||
|
||
const [{ data: ownerUserData, fetching }, refetchUserData] = useUserQuery({ | ||
variables: { id: currentSpace?.owner_id ?? "" }, | ||
}); | ||
|
||
// http://localhost:3000/space/uchicago-buddy-up/join/6d59aa5a-7b58-4ff3-a810-23602d571e80 | ||
|
||
const isArchived = currentProfileHasRole(Profile_Role_Enum.Archived); | ||
|
||
const pathSegment = router.asPath.split("/")[3]; | ||
const showModal = !!isArchived && !SAFE_LINKS.includes(pathSegment); | ||
|
||
return ( | ||
<Modal isOpen={showModal} onClose={() => {}}> | ||
<div className="rounded-md bg-white"> | ||
<div className="rounded-md bg-white px-8 pt-16 pb-8"> | ||
<div className="flex w-96 flex-col items-center"> | ||
<Text variant="heading4">Your profile has been archived.</Text> | ||
<div className="h-8"></div> | ||
<Text> | ||
Your admin has archived your profile, meaning you can no longer | ||
access or participate in this space, <i>unless</i> you join again | ||
with a new invite link. | ||
</Text> | ||
<div className="h-4"></div> | ||
<Text> | ||
If you believe that this was a mistake, please contact the space | ||
owner at {ownerUserData?.user_by_pk?.email}. | ||
</Text> | ||
<div className="h-12"></div> | ||
<Link href="/" passHref> | ||
<Button rounded>Back to home</Button> | ||
</Link> | ||
<div className="h-16"></div> | ||
<img | ||
draggable={false} | ||
src="/assets/create-profile/many_trees.svg" | ||
alt="many trees" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</Modal> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { ReactNode } from "react"; | ||
|
||
import { Text } from "."; | ||
|
||
export function CheckBox( | ||
|
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
Oops, something went wrong.