From 476e642f723e1d55a876c5bcafc94d7927bf2194 Mon Sep 17 00:00:00 2001 From: NorbertLoh Date: Wed, 17 Sep 2025 23:02:49 +0800 Subject: [PATCH 1/4] Add UI for topic and difficulty selection for queue up Multiselect is used for both topic and difficulty. However this commit does not have any business and validation logic. --- .../queueupmodal/queuemodal.module.css | 4 + .../components/queueupmodal/queuemodal.tsx | 77 +++++++++++++++++++ frontend/peerprep/app/pages/userpage.tsx | 74 ++++++++++++++++++ 3 files changed, 155 insertions(+) create mode 100644 frontend/peerprep/app/components/queueupmodal/queuemodal.module.css create mode 100644 frontend/peerprep/app/components/queueupmodal/queuemodal.tsx create mode 100644 frontend/peerprep/app/pages/userpage.tsx diff --git a/frontend/peerprep/app/components/queueupmodal/queuemodal.module.css b/frontend/peerprep/app/components/queueupmodal/queuemodal.module.css new file mode 100644 index 000000000..8549225a8 --- /dev/null +++ b/frontend/peerprep/app/components/queueupmodal/queuemodal.module.css @@ -0,0 +1,4 @@ +.pill { + background-color: var(--mantine-color-brand-yellow-7); + color: var(--mantine-color-black); +} \ No newline at end of file diff --git a/frontend/peerprep/app/components/queueupmodal/queuemodal.tsx b/frontend/peerprep/app/components/queueupmodal/queuemodal.tsx new file mode 100644 index 000000000..d17dfa11b --- /dev/null +++ b/frontend/peerprep/app/components/queueupmodal/queuemodal.tsx @@ -0,0 +1,77 @@ +import { useDisclosure } from "@mantine/hooks"; +import { Modal, Button, MultiSelect, Text, Grid } from "@mantine/core"; +import { useForm } from "@mantine/form"; +import classes from "./queuemodal.module.css"; + +const topics = [ + "Array", + "String", + "Dynamic Programming", + "Backtracking", + "Greedy", + "Graph", + "Tree", + "Linked List", + "Sorting", + "Searching", +]; + +const difficulties = ["Easy", "Medium", "Hard"]; + +export default function QueueModal() { + const [opened, { open, close }] = useDisclosure(false); + const form = useForm({ + initialValues: { + topic: [], + difficulty: [], + }, + }); + + return ( + <> + +
console.log(values))}> + + + + + + + + + + + +
+
+ + + ); +} diff --git a/frontend/peerprep/app/pages/userpage.tsx b/frontend/peerprep/app/pages/userpage.tsx new file mode 100644 index 000000000..1c3ee76c0 --- /dev/null +++ b/frontend/peerprep/app/pages/userpage.tsx @@ -0,0 +1,74 @@ +import { + Grid, + Button, + useMantineTheme, +} from "@mantine/core"; + +import StatsCard from "../components/statscard"; +import HistoryTable from "../components/table/table"; +import type {InterviewHistory} from "../components/table/table"; +import QueueModal from "~/components/queueupmodal/queuemodal"; + +import { useState } from "react"; + +export function meta() { + return [ + { title: "PeerPrep - Homepage" }, + { name: "description", content: "Welcome to PeerPrep!" }, + ]; +} + +export default function Userpage() { + const theme = useMantineTheme(); + + const [data, ] = useState([ + { + question: "Two Sum", + completionDate: "2024-10-01", + difficulty: "Easy", + topic: "Array", + language: "JavaScript", + }, + ]); + + return ( + + + + + + + + + + + + + + + + + + + + + + + + + ); +} From 3a7915e08214b738f72a93b9ea47777dcf451ece Mon Sep 17 00:00:00 2001 From: "NORBERT_THINK\\Funky" Date: Thu, 18 Sep 2025 15:24:30 +0800 Subject: [PATCH 2/4] Add language select option to modal --- .../app/components/queueupmodal/queuemodal.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/peerprep/app/components/queueupmodal/queuemodal.tsx b/frontend/peerprep/app/components/queueupmodal/queuemodal.tsx index d17dfa11b..2147c1070 100644 --- a/frontend/peerprep/app/components/queueupmodal/queuemodal.tsx +++ b/frontend/peerprep/app/components/queueupmodal/queuemodal.tsx @@ -1,5 +1,5 @@ import { useDisclosure } from "@mantine/hooks"; -import { Modal, Button, MultiSelect, Text, Grid } from "@mantine/core"; +import { Modal, Button, MultiSelect, Text, Grid, Select } from "@mantine/core"; import { useForm } from "@mantine/form"; import classes from "./queuemodal.module.css"; @@ -61,6 +61,15 @@ export default function QueueModal() { }} /> + +