diff --git a/compass/app/admin/layout.tsx b/compass/app/admin/layout.tsx
new file mode 100644
index 0000000..bb7fddd
--- /dev/null
+++ b/compass/app/admin/layout.tsx
@@ -0,0 +1,37 @@
+"use client"
+
+import Sidebar from '@/components/resource/Sidebar';
+import React, { useState } from 'react';
+import { ChevronDoubleRightIcon } from '@heroicons/react/24/outline';
+
+export default function RootLayout({
+
+ children,
+}: {
+ children: React.ReactNode
+}) {
+ const [isSidebarOpen, setIsSidebarOpen] = useState(false);
+
+ return (
+
+ {/* button to open sidebar */}
+
+ {/* sidebar */}
+
+
+
+ {/* page ui */}
+
+ {children}
+
+
+ )
+}
\ No newline at end of file
diff --git a/compass/app/admin/page.tsx b/compass/app/admin/page.tsx
index 9307b93..8e4d918 100644
--- a/compass/app/admin/page.tsx
+++ b/compass/app/admin/page.tsx
@@ -1,90 +1,21 @@
"use client";
-// import Table from "@/components/Table";
-import {
- ColumnDef,
- createColumnHelper,
- flexRender,
- getCoreRowModel,
- useReactTable,
-} from "@tanstack/react-table";
-import { useState } from "react";
-import usersImport from "./users.json";
-
-const usersExample = usersImport as unknown as User[];
-
-type User = {
- id: number;
- created_at: any;
- username: string;
- role: "ADMIN" | "EMPLOYEE" | "VOLUNTEER";
- email: string;
- program: "DOMESTIC" | "ECONOMIC" | "COMMUNITY";
- experience: number;
- group?: string;
-};
import { PageLayout } from "@/components/admin/PageLayout";
+import { Table } from "@/components/admin/Table/Index";
+
+import { UsersIcon } from "@heroicons/react/24/solid";
+
+
+
-import { BookmarkIcon } from "@heroicons/react/24/solid";
export default function Page() {
- const columnHelper = createColumnHelper();
-
- const columns = [
- columnHelper.accessor("username", {
- cell: (info) => info.getValue(),
- }),
- columnHelper.accessor("role", {
- cell: (info) => info.renderValue(),
- }),
- columnHelper.accessor("email", {
- cell: (info) => info.renderValue(),
- }),
- columnHelper.accessor("program", {
- cell: (info) => info.renderValue(),
- }),
- ];
-
- const [data, setData] = useState([...usersExample]);
-
- const table = useReactTable({
- columns,
- data,
- getCoreRowModel: getCoreRowModel(),
- });
+
return (
{/* icon + title */}
-
}>
-
-
- {table.getHeaderGroups().map((headerGroup) => (
-
- {headerGroup.headers.map((header) => (
-
- {header.isPlaceholder
- ? null
- : flexRender(
- header.column.columnDef.header,
- header.getContext()
- )}
- |
- ))}
-
- ))}
-
-
- {table.getRowModel().rows.map((row) => (
-
- {row.getVisibleCells().map((cell) => (
-
- {flexRender(cell.column.columnDef.cell, cell.getContext())}
- |
- ))}
-
- ))}
-
-
+
}>
+
);
diff --git a/compass/app/page.tsx b/compass/app/page.tsx
deleted file mode 100644
index dba820a..0000000
--- a/compass/app/page.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-// pages/index.tsx
-"use client";
-
-import Button from '@/components/Button';
-import Input from '@/components/Input'
-import InlineLink from '@/components/InlineLink';
-import Paper from '@/components/auth/Paper';
-// import { Metadata } from 'next'
-import Image from 'next/image';
-import {ChangeEvent, useState} from "react";
-
-// export const metadata: Metadata = {
-// title: 'Login',
-// }
-
-export default function Page() {
- const [email, setEmail] = useState("");
- const [password, setPassword] = useState("");
- const [error, setError] = useState("");
-
- const handleEmailChange = (event: React.ChangeEvent) => {
- setEmail(event.currentTarget.value);
- console.log("email " + email);
- }
-
- const handlePasswordChange = (event: React.ChangeEvent) => {
- setPassword(event.currentTarget.value);
- console.log("password " + password)
- }
-
- const handleClick = (event: React.MouseEvent) => {
- event.preventDefault();
- // Priority: Incorrect combo > Missing email > Missing password
-
- if (password.trim().length === 0) {
- setError("Please enter your password.")
- }
- // This shouldn't happen, already provides validation, but just in case.
- if (email.trim().length === 0) {
- setError("Please enter your email.")
- }
- // Placeholder for incorrect email + password combo.
- if (email === "incorrect@gmail.com" && password) {
- setError("Incorrect password.")
- }
- }
-
-
-
- return (
- <>
-
-
-
- © 2024 Compass Center
-
-
- >
- );
-};
\ No newline at end of file
diff --git a/compass/app/pages/page/page.tsx b/compass/app/pages/page/page.tsx
deleted file mode 100644
index dce1122..0000000
--- a/compass/app/pages/page/page.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-// pages/index.tsx
-"use client";
-
-
-import Drawer from '@/components/page/Drawer';
-// import { Metadata } from 'next'
-import {ChangeEvent, useState} from "react";
-
-// export const metadata: Metadata = {
-// title: 'Login',
-// }
-
-export default function Page() {
- const [pageContent, setPageContent] = useState("")
-
- const handleDrawerContentChange = (newContent) => {
- setPageContent(newContent);
- };
-
- return (
- <>
- Resources
- {pageContent}
- >
- );
-};
\ No newline at end of file
diff --git a/compass/components/admin/PageLayout.tsx b/compass/components/admin/PageLayout.tsx
index 80a96f5..c655296 100644
--- a/compass/components/admin/PageLayout.tsx
+++ b/compass/components/admin/PageLayout.tsx
@@ -15,7 +15,7 @@ export const PageLayout: React.FC = ({ icon, title, children })
{/* data */}
-
diff --git a/compass/components/admin/Table/Index.tsx b/compass/components/admin/Table/Index.tsx
new file mode 100644
index 0000000..5a12c1b
--- /dev/null
+++ b/compass/components/admin/Table/Index.tsx
@@ -0,0 +1,91 @@
+// for showcasing to compass
+
+import usersImport from "./users.json";
+import {
+ ColumnDef,
+ createColumnHelper,
+ flexRender,
+ getCoreRowModel,
+ useReactTable,
+} from "@tanstack/react-table";
+import { useState } from "react";
+import { RowAction } from "./RowAction";
+import { TableAction } from "./TableAction";
+
+const usersExample = usersImport as unknown as User[];
+
+type User = {
+ id: number;
+ created_at: any;
+ username: string;
+ role: "ADMIN" | "EMPLOYEE" | "VOLUNTEER";
+ email: string;
+ program: "DOMESTIC" | "ECONOMIC" | "COMMUNITY";
+ experience: number;
+ group?: string;
+};
+
+
+export const Table = () => {
+ const columnHelper = createColumnHelper();
+
+ const columns = [
+ columnHelper.accessor("username", {
+ cell: (info) => ,
+ }),
+ columnHelper.accessor("role", {
+ cell: (info) => info.renderValue(),
+ }),
+ columnHelper.accessor("email", {
+ cell: (info) => info.renderValue(),
+ }),
+ columnHelper.accessor("program", {
+ cell: (info) => info.renderValue(),
+ }),
+ ];
+
+ const [data, setData] = useState([...usersExample]);
+
+ const table = useReactTable({
+ columns,
+ data,
+ getCoreRowModel: getCoreRowModel(),
+ });
+
+ return(
+
+
+
+
+ {table.getHeaderGroups().map((headerGroup) => (
+
+ {headerGroup.headers.map((header) => (
+
+ {header.isPlaceholder
+ ? null
+ : flexRender(
+ header.column.columnDef.header,
+ header.getContext()
+ )}
+ |
+ ))}
+
+ ))}
+
+
+ {table.getRowModel().rows.map((row) => (
+
+ {row.getVisibleCells().map((cell) => (
+
+ {flexRender(cell.column.columnDef.cell, cell.getContext())}
+ |
+ ))}
+
+ ))}
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/compass/components/admin/Table/RowAction.tsx b/compass/components/admin/Table/RowAction.tsx
new file mode 100644
index 0000000..37b0215
--- /dev/null
+++ b/compass/components/admin/Table/RowAction.tsx
@@ -0,0 +1,21 @@
+import Drawer from "@/components/page/Drawer";
+import {ChangeEvent, useState} from "react";
+
+export const RowAction = ({ title }) => {
+ const [pageContent, setPageContent] = useState("")
+
+ const handleDrawerContentChange = (newContent) => {
+ setPageContent(newContent);
+ };
+
+
+
+ return (
+
+ {title}
+
+ {pageContent}
+
+
+ );
+};
diff --git a/compass/components/admin/Table/TableAction.tsx b/compass/components/admin/Table/TableAction.tsx
new file mode 100644
index 0000000..be4a309
--- /dev/null
+++ b/compass/components/admin/Table/TableAction.tsx
@@ -0,0 +1,12 @@
+import { MagnifyingGlassIcon } from "@heroicons/react/24/solid";
+
+export const TableAction = () => {
+ return (
+
+ Filter
+ Sort
+
+
+ );
+ };
+
\ No newline at end of file
diff --git a/compass/app/admin/users.json b/compass/components/admin/Table/users.json
similarity index 100%
rename from compass/app/admin/users.json
rename to compass/components/admin/Table/users.json
diff --git a/compass/components/page/Drawer.tsx b/compass/components/page/Drawer.tsx
index 217fbd2..d80cd9f 100644
--- a/compass/components/page/Drawer.tsx
+++ b/compass/components/page/Drawer.tsx
@@ -44,7 +44,7 @@ const Drawer: FunctionComponent = ({ title, children, onSave, edita
return (
-
+