diff --git a/README.md b/README.md index 77fd1fc..ffb57ee 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Tech Tracker Logo +Tech Tracker Logo # Tech Tracker Website diff --git a/public/images/default_user_pfp.png b/public/images/default_user_pfp.png new file mode 100644 index 0000000..2c479c5 Binary files /dev/null and b/public/images/default_user_pfp.png differ diff --git a/src/app/page.tsx b/src/app/page.tsx index 4e16e61..b80b434 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -10,7 +10,7 @@ export default async function HomePage() { } else { return (
+ from-[#111111] to-[#212325]">
diff --git a/src/components/auth/Sign_Out.tsx b/src/components/auth/Sign_Out.tsx index 1103747..672cbb9 100644 --- a/src/components/auth/Sign_Out.tsx +++ b/src/components/auth/Sign_Out.tsx @@ -1,13 +1,25 @@ +import Image from "next/image"; +import { auth } from "~/auth" import { signOut } from "~/auth" -export default function Sign_Out() { - return ( -
{ - "use server" - await signOut() - }}> - -
- ) -} +export default async function Sign_Out() { + const session = await auth(); + if (!session) { + return (
); + } else { + // Add User profile picture next to Sign Out button + const pfp = session?.user?.image ? session.user.image : "/images/default_user_pfp.png"; + return ( +
{ + "use server" + await signOut() + }}> + + +
+ ); + } +}; diff --git a/src/components/ui/TT_Header.tsx b/src/components/ui/TT_Header.tsx index b75ad81..89484c7 100644 --- a/src/components/ui/TT_Header.tsx +++ b/src/components/ui/TT_Header.tsx @@ -5,9 +5,9 @@ export default function TT_Header() {
Tech Tracker Logo -

+

Tech Tracker

diff --git a/src/components/ui/Table.tsx b/src/components/ui/Table.tsx index db35241..2393655 100644 --- a/src/components/ui/Table.tsx +++ b/src/components/ui/Table.tsx @@ -12,6 +12,7 @@ interface Employee { export default function Table({ employees }: { employees: Employee[] }) { const [selectedIds, setSelectedIds] = useState([]); + const [selectAll, setSelectAll] = useState(false); const [status, setStatus] = useState(''); const [employeeData, setEmployeeData] = useState(employees); @@ -61,6 +62,24 @@ export default function Table({ employees }: { employees: Employee[] }) { ); }; + const handleSelectAllChange = () => { + setSelectAll(!selectAll); + if (!selectAll) { + const allIds = employees.map((employee) => employee.id); + setSelectedIds(allIds); + } else { + setSelectedIds([]); + } + }; + + useEffect(() => { + if (selectedIds.length === employeeData.length && employeeData.length > 0) { + setSelectAll(true); + } else { + setSelectAll(false); + } + }, [selectedIds, employeeData]); + const handleStatusChange = (e: React.ChangeEvent) => { setStatus(e.target.value); }; @@ -102,10 +121,17 @@ export default function Table({ employees }: { employees: Employee[] }) { return (
- - +
+ - @@ -113,7 +139,8 @@ export default function Table({ employees }: { employees: Employee[] }) { {employeeData.map((employee) => ( - + - - - + + + ))} @@ -133,7 +160,7 @@ export default function Table({ employees }: { employees: Employee[] }) {
+ + + Name Status Updated At
handleCheckboxChange(employee.id)} /> {employee.name}{employee.status}{formatTime(employee.updatedAt)}{employee.name}{employee.status}{formatTime(employee.updatedAt)}