From 4753b85ab5ec9965c016e78dad2d011124979936 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Mon, 20 Nov 2023 16:19:05 +0000 Subject: [PATCH] Started creating the page to generate exams --- src/components/Low/Input.tsx | 20 ++- src/components/Sidebar.tsx | 15 +- src/interfaces/exam.ts | 16 +- src/pages/generation.tsx | 286 +++++++++++++++++++++++++++++++++++ 4 files changed, 327 insertions(+), 10 deletions(-) create mode 100644 src/pages/generation.tsx diff --git a/src/components/Low/Input.tsx b/src/components/Low/Input.tsx index bd1fb466..4d513835 100644 --- a/src/components/Low/Input.tsx +++ b/src/components/Low/Input.tsx @@ -3,6 +3,7 @@ import {useState} from "react"; interface Props { type: "email" | "text" | "password" | "tel" | "number"; + roundness?: "full" | "xl"; required?: boolean; label?: string; placeholder?: string; @@ -13,7 +14,18 @@ interface Props { onChange: (value: string) => void; } -export default function Input({type, label, placeholder, name, required = false, defaultValue, className, disabled = false, onChange}: Props) { +export default function Input({ + type, + label, + placeholder, + name, + required = false, + defaultValue, + className, + roundness = "full", + disabled = false, + onChange, +}: Props) { const [showPassword, setShowPassword] = useState(false); if (type === "password") { @@ -59,7 +71,11 @@ export default function Input({type, label, placeholder, name, required = false, disabled={disabled} onChange={(e) => onChange(e.target.value)} placeholder={placeholder} - className="px-8 py-6 text-sm font-normal placeholder:text-mti-gray-cool disabled:bg-mti-gray-platinum/40 disabled:text-mti-gray-dim disabled:cursor-not-allowed bg-white rounded-full border border-mti-gray-platinum focus:outline-none" + className={clsx( + "px-8 py-6 text-sm font-normal bg-white border border-mti-gray-platinum focus:outline-none", + "placeholder:text-mti-gray-cool disabled:bg-mti-gray-platinum/40 disabled:text-mti-gray-dim disabled:cursor-not-allowed", + roundness === "full" ? "rounded-full" : "rounded-xl", + )} required={required} defaultValue={defaultValue} /> diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 77c419b1..83144a56 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -1,7 +1,7 @@ import clsx from "clsx"; import {IconType} from "react-icons"; import {MdSpaceDashboard} from "react-icons/md"; -import {BsFileEarmarkText, BsClockHistory, BsPencil, BsGraphUp, BsChevronBarRight, BsChevronBarLeft, BsShieldFill} from "react-icons/bs"; +import {BsFileEarmarkText, BsClockHistory, BsPencil, BsGraphUp, BsChevronBarRight, BsChevronBarLeft, BsShieldFill, BsCloudFill} from "react-icons/bs"; import {RiLogoutBoxFill} from "react-icons/ri"; import {SlPencil} from "react-icons/sl"; import {FaAward} from "react-icons/fa"; @@ -92,6 +92,16 @@ export default function Sidebar({path, navDisabled = false, focusMode = false, u {userType !== "student" && (