Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
1d30e43
Fix sponsor image to fit within container; partial circle shape imple…
fisayoadabs Jan 16, 2025
cf49901
Hmt 99/login redirect (#169)
anthonyych4n Jan 16, 2025
889c7c7
Merge branch 'main' of https://github.com/Code-the-Change-YYC/hackath…
fisayoadabs Feb 5, 2025
169808d
Using base64 and browser compression profile Image is stored in database
fisayoadabs Feb 10, 2025
1875a03
Forgot to update the initialData with profilePicture
fisayoadabs Feb 10, 2025
f336426
I do not have access to s3 but this should work if you try it burton
fisayoadabs Feb 24, 2025
52ab860
Merge branch 'main' of https://github.com/Code-the-Change-YYC/hackath…
fisayoadabs Mar 29, 2025
f1e3254
Added some more config and permissions but it seems as though I still…
fisayoadabs Mar 31, 2025
52457a0
feat: Got the upload to work by using public and linking the identity…
fisayoadabs May 20, 2025
31aaf34
Merge branch 'main' of https://github.com/Code-the-Change-YYC/hackath…
fisayoadabs May 20, 2025
707bf2a
fix: replace useEffect with useQuery and require image to be png(this…
fisayoadabs Jun 5, 2025
1b28df3
fix: changed styling and removed unused code
fisayoadabs Jun 10, 2025
61e7176
Merge branch 'main' of https://github.com/Code-the-Change-YYC/hackath…
fisayoadabs Jun 10, 2025
e43d73e
Merge branch 'main' into HMT-112-profile-picture-storage
fisayoadabs Jun 10, 2025
135a3c2
reinstalled node modules which updated packages
fisayoadabs Jul 2, 2025
c00f76d
downgraded react and next
fisayoadabs Jul 3, 2025
5168423
feat: updated next and react to latest version
fisayoadabs Jul 9, 2025
1dcf8e4
Merge branch 'main' of https://github.com/Code-the-Change-YYC/hackath…
fisayoadabs Aug 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions amplify/auth/PostConfirmation/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const handler: PostConfirmationTriggerHandler = async (event) => {
const cognitoGroupResponse = await cognitoClient.send(command);

const DDBResponse = await dataClient.models.User.create({
profilePicture: "",
firstName: "",
lastName: "",
role: "Participant",
Expand Down
63 changes: 1 addition & 62 deletions amplify/auth/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,68 +27,7 @@ export const auth = defineAuth({
verificationEmailStyle: "CODE",
verificationEmailSubject: "Welcome Hack the Change!",
verificationEmailBody: (createCode) =>
`<html>
<head>
<meta charset="UTF-8" />
<title>Hack the Change Account Confirmation</title>
<style>
body, html {
margin: 0;
padding: 0;
height: 100%;
font-family: Arial, sans-serif;
}
.email-container {
max-width: 600px;
margin: 0 auto;
/* Need the published Location of the ctc Hero image to paste here according to google */
background-size: cover;
background-position: center;
padding: 40px 20px;
box-sizing: border-box;
min-height: 400px;
}
.content-box {
background-color: rgba(255, 255, 255, 0.9);
border-radius: 8px;
padding: 30px;
margin: 20px 0;
text-align: center;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
h1 {
color: #4a4a4a;
margin-bottom: 20px;
}
.verification-code {
font-size: 32px;
font-weight: bold;
color: #ff5a5f;
letter-spacing: 2px;
padding: 10px;
margin: 15px 0;
}
.footer {
font-size: 12px;
color: #666;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="email-container">
<div class="content-box">
<h1>Hack the Change Account Confirmation</h1>
<p>Thank you for creating your Hack the Change account. Please use the code below to complete your registration:</p>
<div class="verification-code">${createCode()}</div>
<p>If you didn't request this code, you can safely ignore this email.</p>
</div>
<div class="footer">
&copy; 2025 Code the Change. <img src="https://www.codethechangeyyc.ca/_next/image?url=/logo.png&w=96&q=75" alt="Code the Change Logo" style="height: 12px; vertical-align: middle; margin: 0 4px;"> All rights reserved.
</div>
</div>
</body>
</html>`,
`<h1>Use this code to confirm your Hack the Change Account: ${createCode()}</h1>`,
},

externalProviders: {
Expand Down
3 changes: 3 additions & 0 deletions amplify/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
import { auth } from "@/amplify/auth/resource";
import { data } from "@/amplify/data/resource";
import { defineBackend } from "@aws-amplify/backend";

Check failure on line 5 in amplify/backend.ts

View workflow job for this annotation

GitHub Actions / Run ESLint Scanning

Delete `⏎`
import { storage } from "./storage/resource";

const backend = defineBackend({
auth,
data,
storage,
});

// Cognito Email Overrides
Expand Down
1 change: 1 addition & 0 deletions amplify/data/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const schema = a
User: a
.model({
id: a.id().required(),
profilePicture: a.string(),
firstName: a.string(),
lastName: a.string(),
role: a
Expand Down
13 changes: 13 additions & 0 deletions amplify/storage/resource.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineStorage } from "@aws-amplify/backend";

export const storage = defineStorage({
name: "profileImageStorage",
access: (allow) => ({
"public/*": [
allow.authenticated.to(["read", "write", "delete"]),
allow.groups(["Participant"]).to(["read", "write"]),
allow.groups(["Judge"]).to(["read", "write", "delete"]),
allow.groups(["Admin"]).to(["read", "write", "delete"]),
],
}),
});
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
domains: ["images.ctfassets.net", "s3.ca-central-1.amazonaws.com"],
remotePatterns: [
{
protocol: "https",
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@aldabil/react-scheduler": "^2.9.5",
"@aws-amplify/adapter-nextjs": "^1.0.18",
"@aws-amplify/ui-react": "^6.1.5",
"@aws-amplify/ui-react-storage": "^3.9.1",
"@emotion/react": "11.13.3",
"@emotion/styled": "11.13.0",
"@mui/icons-material": "^5.15.10",
Expand All @@ -36,9 +37,9 @@
"date-fns": "^4.1.0",
"js-sha3": "^0.9.3",
"luxon": "^3.4.4",
"next": "^14.2.12",
"react": "^18",
"react-dom": "^18",
"next": "^15.3.5",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-hook-form": "^7.51.5",
"react-icons": "^5.0.1",
"react-loading-skeleton": "^3.4.0",
Expand Down
Binary file not shown.
5 changes: 0 additions & 5 deletions public/svgs/judgingRubric/rubric_left.svg

This file was deleted.

5 changes: 0 additions & 5 deletions public/svgs/judgingRubric/rubric_right.svg

This file was deleted.

43 changes: 43 additions & 0 deletions src/_middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// // middleware.ts
// import { fetchAuthSession } from "aws-amplify/auth/server";
// import { NextResponse } from "next/server";
// import type { NextRequest } from "next/server";

// import { runWithAmplifyServerContext } from "@/utils/amplify-utils";

// export async function middleware(request: NextRequest) {
// const response = NextResponse.next();

// const authenticated = await runWithAmplifyServerContext({
// nextServerContext: { request, response },
// operation: async (contextSpec) => {
// try {
// const session = await fetchAuthSession(contextSpec, {});
// return session.tokens !== undefined;
// } catch (error) {
// console.log(error);
// return false;
// }
// },
// });

// if (authenticated) {
// return response;
// }

// return NextResponse.redirect(new URL("/login", request.url));
// }

// export const config = {
// matcher: [
// /*
// * Match all request paths except for the ones starting with:
// * - api (API routes)
// * - _next/static (static files)
// * - _next/image (image optimization files)
// * - favicon.ico (favicon file)
// * - login
// */
// "/((?!api|_next/static|_next/image|favicon.ico|static|login|$).*)",
// ],
// };
48 changes: 23 additions & 25 deletions src/app/admin/components/UsersTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,31 @@ export default function UsersTable({ users }: { users: User[] }) {
typeName: "User",
});
return (
<div className="users group flex flex-1 flex-col justify-between overflow-hidden rounded-3xl bg-white p-2 text-xl outline outline-awesomer-purple">
<div className="overflow-x-auto">
<div className="w-full">
<TableSearch
tableDataLength={table.getRowCount()}
handleSearchChange={useCallback(
(value: string) => setGlobalFilter(value),
[],
)}
<div className="users group flex flex-1 flex-col justify-between overflow-x-auto rounded-3xl bg-white p-2 text-xl outline outline-awesomer-purple">
<div className="w-full">
<TableSearch
tableDataLength={table.getRowCount()}
handleSearchChange={useCallback(
(value: string) => setGlobalFilter(value),
[],
)}
/>
<table className="w-full border-separate border-spacing-x-0.5 p-2">
<TanstackTableHead
table={useMemo(() => table.getHeaderGroups(), [table])}
/>
<table className="w-full border-separate border-spacing-x-0.5 p-2">
<TanstackTableHead
table={useMemo(() => table.getHeaderGroups(), [table])}
/>
<TanstackTableBody table={table} />
<tfoot>
<tr>
<th
colSpan={table.getAllColumns().length}
className="rounded-b-xl bg-awesome-purple p-4 text-white"
/>
</tr>
</tfoot>
</table>
</div>
<TableFooter table={table} />
<TanstackTableBody table={table} />
<tfoot>
<tr>
<th
colSpan={table.getAllColumns().length}
className="rounded-b-xl bg-awesome-purple p-4 text-white"
/>
</tr>
</tfoot>
</table>
</div>
<TableFooter table={table} />
</div>
);
}
2 changes: 1 addition & 1 deletion src/app/admin/teams/components/TanstackTableFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Table } from "@tanstack/react-table";

export default function TanstackTableFooter<T>({ table }: { table: Table<T> }) {
return (
<div className="text-md mb-2 flex items-center justify-between px-3 text-awesomer-purple group-[.teams]:gap-2.5 group-[.users]:gap-7 group-[.users]:whitespace-nowrap group-[.teams]:md:gap-4 group-[.users]:md:gap-11">
<div className="text-md flex items-center justify-between px-3 text-awesomer-purple group-[.teams]:gap-2.5 group-[.users]:gap-7 group-[.users]:whitespace-nowrap group-[.teams]:md:gap-4 group-[.users]:md:gap-11">
<div className="text-black">
Showing {table.getRowModel().rows.length.toLocaleString()} of{" "}
{table.getRowCount().toLocaleString()} Rows
Expand Down
48 changes: 23 additions & 25 deletions src/app/admin/teams/components/TeamsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,31 @@ export default function TeamsTable({ teams }: { teams: Team[] }) {
typeName: "Team",
});
return (
<div className="teams group flex flex-1 flex-col justify-between overflow-hidden rounded-3xl bg-white p-2 text-xl outline outline-awesomer-purple">
<div className="overflow-x-auto">
<div className="w-full">
<TableSearch
tableDataLength={table.getRowCount()}
handleSearchChange={useCallback(
(value: string) => setGlobalFilter(value),
[],
)}
<div className="teams group flex flex-1 flex-col justify-between overflow-x-auto rounded-3xl bg-white p-2 text-xl outline outline-awesomer-purple">
<div className="w-full">
<TableSearch
tableDataLength={table.getRowCount()}
handleSearchChange={useCallback(
(value: string) => setGlobalFilter(value),
[],
)}
/>
<table className="ml-1.5 w-full border-separate border-spacing-x-0.5 p-2 md:ml-0">
<TeamsTableHead
table={useMemo(() => table.getHeaderGroups(), [table])}
/>
<table className="ml-1.5 w-full border-separate border-spacing-x-0.5 p-2 md:ml-0">
<TeamsTableHead
table={useMemo(() => table.getHeaderGroups(), [table])}
/>
<TeamTableBody table={table} />
<tfoot>
<tr>
<th
colSpan={table.getAllColumns().length}
className="rounded-b-xl bg-awesome-purple p-4 text-white"
/>
</tr>
</tfoot>
</table>
</div>
<TableFooter table={table} />
<TeamTableBody table={table} />
<tfoot>
<tr>
<th
colSpan={table.getAllColumns().length}
className="rounded-b-xl bg-awesome-purple p-4 text-white"
/>
</tr>
</tfoot>
</table>
</div>
<TableFooter table={table} />
</div>
);
}
5 changes: 0 additions & 5 deletions src/app/hackathon-end/page.tsx

This file was deleted.

Loading
Loading