-
Notifications
You must be signed in to change notification settings - Fork 3
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 #55 from tiarasjec/rbac
feat: RBAC
- Loading branch information
Showing
19 changed files
with
1,072 additions
and
53 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,21 @@ | ||
import Glow from "@/components/shared/glow"; | ||
import { StarsCanvas } from "@/components/ui/Stars"; | ||
import Footer from "@/components/widgets/Footer"; | ||
import { Header } from "@/components/widgets/Header"; | ||
import React from "react"; | ||
|
||
function ContentLayout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<> | ||
<StarsCanvas /> | ||
<Glow /> | ||
<div className="flex min-h-screen w-full flex-col"> | ||
<Header /> | ||
{children} | ||
</div> | ||
<Footer /> | ||
</> | ||
); | ||
} | ||
|
||
export default ContentLayout; |
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,18 @@ | ||
import React from "react"; | ||
import { auth, signIn } from "@/auth"; | ||
import { Register } from "./_components/Register"; | ||
|
||
async function RegisterPage() { | ||
const session = await auth(); | ||
if (!session) { | ||
<form | ||
action={async () => { | ||
"use server"; | ||
await signIn("google"); | ||
}} | ||
/>; | ||
} | ||
return <Register name={session?.user.name!} email={session?.user.email!} />; | ||
} | ||
|
||
export default RegisterPage; |
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,96 @@ | ||
"use client"; | ||
import { ColumnDef } from "@tanstack/react-table"; | ||
import { Payment } from "@prisma/client"; | ||
import { ArrowUpDown } from "lucide-react"; | ||
import { Button } from "@/components/ui/button"; | ||
|
||
export const columns: ColumnDef<Payment>[] = [ | ||
{ | ||
header: ({ column }) => { | ||
return ( | ||
<Button | ||
variant="ghost" | ||
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")} | ||
> | ||
Name | ||
<ArrowUpDown className="ml-2 h-4 w-4" /> | ||
</Button> | ||
); | ||
}, | ||
accessorKey: "user.name", | ||
}, | ||
{ | ||
header: ({ column }) => { | ||
return ( | ||
<Button | ||
variant="ghost" | ||
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")} | ||
> | ||
<ArrowUpDown className="ml-2 h-4 w-4" /> | ||
</Button> | ||
); | ||
}, | ||
accessorKey: "user.email", | ||
}, | ||
{ | ||
header: ({ column }) => { | ||
return ( | ||
<Button | ||
variant="ghost" | ||
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")} | ||
> | ||
Events | ||
<ArrowUpDown className="ml-2 h-4 w-4" /> | ||
</Button> | ||
); | ||
}, | ||
accessorKey: "user.events", | ||
cell: ({ row }) => { | ||
// @ts-ignore | ||
return row.original.user.events.map((event, i) => <div key={i}>{event}</div>); | ||
}, | ||
}, | ||
{ | ||
header: ({ column }) => { | ||
return ( | ||
<Button | ||
variant="ghost" | ||
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")} | ||
> | ||
College | ||
<ArrowUpDown className="ml-2 h-4 w-4" /> | ||
</Button> | ||
); | ||
}, | ||
accessorKey: "user.college", | ||
}, | ||
{ | ||
header: ({ column }) => { | ||
return ( | ||
<Button | ||
variant="ghost" | ||
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")} | ||
> | ||
Status | ||
<ArrowUpDown className="ml-2 h-4 w-4" /> | ||
</Button> | ||
); | ||
}, | ||
accessorKey: "status", | ||
}, | ||
{ | ||
header: ({ column }) => { | ||
return ( | ||
<Button | ||
variant="ghost" | ||
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")} | ||
> | ||
Order ID | ||
<ArrowUpDown className="ml-2 h-4 w-4" /> | ||
</Button> | ||
); | ||
}, | ||
accessorKey: "orderCreationId", | ||
}, | ||
]; |
Oops, something went wrong.