From f204c4f6f7513961218dc9e93058476bf34617a6 Mon Sep 17 00:00:00 2001 From: andrewzpu <66804382+andrewzpu@users.noreply.github.com> Date: Mon, 15 Apr 2024 08:56:01 -0700 Subject: [PATCH] Feature/andrewzpu/program page (#62) * Created Program Card Component * Edited Programs Page Layout * Added Create Program Button and Minor Edits * Finished editing Programs Page * made lint fixes * added backend route to get all programs * fix deploy issue * connected programs page to backend route * fixed windowSize width error * minor text changes * fixed program card color options * Added Options button and fixed lint errors * fixed lint issues * implemented edit program in program page * uncommented 404 error lines * reset default api path to /api --------- Co-authored-by: adhi0331 Co-authored-by: Adhithya Ananthan <85322002+adhi0331@users.noreply.github.com> --- backend/src/routes/program.ts | 1 - frontend/public/programs/Options.png | Bin 0 -> 406 bytes frontend/public/programs/Students.png | Bin 0 -> 396 bytes frontend/public/programs/Vector.png | Bin 0 -> 396 bytes frontend/src/components/ProgramCard.tsx | 127 ++++++++++++++++++ frontend/src/components/ProgramFormButton.tsx | 59 +++++--- frontend/src/pages/programs.tsx | 95 ++++++++++++- frontend/src/styles/global.css | 4 + frontend/src/styles/globals.css | 6 + 9 files changed, 272 insertions(+), 20 deletions(-) create mode 100644 frontend/public/programs/Options.png create mode 100644 frontend/public/programs/Students.png create mode 100644 frontend/public/programs/Vector.png create mode 100644 frontend/src/components/ProgramCard.tsx diff --git a/backend/src/routes/program.ts b/backend/src/routes/program.ts index c1cd0b7b..05e24645 100644 --- a/backend/src/routes/program.ts +++ b/backend/src/routes/program.ts @@ -9,7 +9,6 @@ import * as ProgramValidator from "../validators/program"; const router = express.Router(); -router.post("/", ProgramValidator.createProgram, ProgramController.createProgram); router.patch("/:id", ProgramValidator.updateProgram, ProgramController.updateProgram); router.post("/create", ProgramValidator.createProgram, ProgramController.createProgram); router.get("/all", ProgramController.getAllPrograms); diff --git a/frontend/public/programs/Options.png b/frontend/public/programs/Options.png new file mode 100644 index 0000000000000000000000000000000000000000..c0ee6e47fa349747fe43c6a85a587aa2d67332c5 GIT binary patch literal 406 zcmeAS@N?(olHy`uVBq!ia0vp^jzH|e!3HE({+Q7Vq&N#aB8wRqbi6^BajEUJl|Vtp z;vjb?hIQv;UIIBR>5jfYZ5#W!|0J>k<+MFr978G?-`>3Fd)Ppv^`Wxb3yzx&eG>wW zn3PLI%re~*nh&ugHaD+zSvx^MWn0dw)&D2|negpoc;>4Y)BiQT)m&Q~wORag)m(dd zk;q#Q4A-u%pT2*-$VID$o45CBOseVr{oeY4`r<_%vnxwyZeH|Z-+agKyB~V?uAObM z;!a?%sl1cXigTN#UK_TwUr*+Ezv}bCV^us4b=Ue&-L28|rNCzAnb5!`XJul_BC`IS zzcBT?{A~ZO6Sw=$R|ZU8^!d}NnvdVZU)Ic>FKf!K4fGvD$I&ewQ7XEZe)o1A0<(%t zSMcd>VvkyqG4byVG0*NjhPp+GQBUS(P6R36(3?3CsBFo1Y0*|N>q%CCY*Y&W7LSWc qzYTRKiB%>?Jvp@HgtdJ{_aCN^dwHpC8Jns=Iz3(eT-G@yGywnzRITO! literal 0 HcmV?d00001 diff --git a/frontend/public/programs/Students.png b/frontend/public/programs/Students.png new file mode 100644 index 0000000000000000000000000000000000000000..a0613fc872e509c4cd588694d4453f43860f568c GIT binary patch literal 396 zcmV;70dxL|P) z))x3r$j}L5pDMgQ{gtJ0?xP;(@R2;%)*QMSa%o7&a&C{|wQN8ebb9W%Rn%_jubi0D zFZ)u~@gQ6A`#k%}80ecUa2V83uKP)KnmPJsgF|^>ca z))x3r$j}L5pDMgQ{gtJ0?xP;(@R2;%)*QMSa%o7&a&C{|wQN8ebb9W%Rn%_jubi0D zFZ)u~@gQ6A`#k%}80ecUa2V83uKP)KnmPJsgF|^>ca +
+
+

{type} Program

+

{title}

+
+
+
+ {" "} +
+
+
+
+

{dates}

+ {/* +
+ students +

{numStudents} Students

+
+ */} +
+ + ); +} diff --git a/frontend/src/components/ProgramFormButton.tsx b/frontend/src/components/ProgramFormButton.tsx index aaab647f..7ddd5d44 100644 --- a/frontend/src/components/ProgramFormButton.tsx +++ b/frontend/src/components/ProgramFormButton.tsx @@ -1,3 +1,4 @@ +import Image from "next/image"; import { useMemo, useState } from "react"; import { SubmitHandler, useForm } from "react-hook-form"; @@ -55,14 +56,27 @@ export default function ProgramFormButton({ return !isMobile ? ( <> - -