-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add "approved" to schema * Add user approval to config * Add approval check to layout * Add approval button to dash * Add approval check to rsvp * Add approval check to discord verify * Make approval disabled by default * Fix typing issue
- Loading branch information
1 parent
2911823
commit 4039519
Showing
12 changed files
with
1,217 additions
and
4 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
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,30 @@ | ||
import c from "config"; | ||
import Link from "next/link"; | ||
import { Button } from "@/components/shadcn/ui/button"; | ||
|
||
export default function Page() { | ||
return ( | ||
<main className="mx-auto flex min-h-screen w-full max-w-5xl flex-col items-center justify-center"> | ||
<div className="max-w-screen fixed left-1/2 top-[calc(50%+7rem)] h-[40vh] w-[800px] -translate-x-1/2 -translate-y-1/2 scale-150 overflow-x-hidden bg-hackathon opacity-30 blur-[100px] will-change-transform"></div> | ||
<h1 className="mb-10 text-6xl font-extrabold text-hackathon dark:bg-gradient-to-t dark:from-hackathon/80 dark:to-white dark:bg-clip-text dark:text-transparent md:text-8xl"> | ||
{c.hackathonName} | ||
</h1> | ||
<div className="relative flex aspect-video w-full max-w-[500px] flex-col items-center justify-center rounded-xl bg-white p-5 backdrop-blur transition dark:bg-white/[0.08]"> | ||
<h1 className="flex items-center gap-x-2 text-2xl font-bold text-green-500"> | ||
{/* <CheckCircleIcon /> */} | ||
Thanks for registering! | ||
</h1> | ||
<p className="pb-10 pt-5 text-center"> | ||
Your account is awaiting approval. | ||
<br /> | ||
You will be notified when it is approved! | ||
</p> | ||
<Link href={"/"}> | ||
<Button>Go Home</Button> | ||
</Link> | ||
</div> | ||
</main> | ||
); | ||
} | ||
|
||
export const runtime = "edge"; |
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,44 @@ | ||
"use client"; | ||
|
||
import { Button } from "@/components/shadcn/ui/button"; | ||
import { useAction } from "next-safe-action/hook"; | ||
import { setUserApproval } from "@/actions/admin/user-actions"; | ||
import { toast } from "sonner"; | ||
|
||
interface ApproveUserButtonProps { | ||
userIDToUpdate: string; | ||
currentApproval: boolean; | ||
} | ||
|
||
export default function ApproveUserButton({ | ||
userIDToUpdate, | ||
currentApproval, | ||
}: ApproveUserButtonProps) { | ||
const { execute, status } = useAction(setUserApproval, { | ||
onSuccess: () => { | ||
toast.dismiss(); | ||
console.log("Success"); | ||
toast.success(`User ${currentApproval ? "Un-a" : "A"}pproved!`); | ||
}, | ||
onError: (e) => { | ||
toast.dismiss(); | ||
console.log("Error", e); | ||
toast.error( | ||
"An error occurred while changing user approval. Please try again.", | ||
); | ||
}, | ||
}); | ||
|
||
return ( | ||
<Button | ||
onClick={() => { | ||
toast.loading("Changing user approval..."); | ||
execute({ userIDToUpdate, approved: !currentApproval }); | ||
}} | ||
variant={"outline"} | ||
disabled={status === "executing"} | ||
> | ||
{currentApproval ? "Un-a" : "A"}pprove User | ||
</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
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 @@ | ||
ALTER TABLE "users" ADD COLUMN "approved" boolean DEFAULT false NOT NULL; |
Oops, something went wrong.