From ca4fa4ec6adab8fdc15dd3b9bd3f9aabda5c64af Mon Sep 17 00:00:00 2001 From: Kenneth Cassel Date: Thu, 4 Nov 2021 16:31:30 -0500 Subject: [PATCH 01/15] fix: wip adding solutions/reset code to quizzes --- components/CreateQuizForm.tsx | 237 ++++++++++++++++------------------ components/PreviewQuiz.tsx | 174 +++++++++++++++++++++++++ package.json | 2 + pages/q/[id].tsx | 35 ++++- pages/quizzes/create.tsx | 2 +- types.ts | 1 + yarn.lock | 10 ++ 7 files changed, 331 insertions(+), 130 deletions(-) create mode 100644 components/PreviewQuiz.tsx diff --git a/components/CreateQuizForm.tsx b/components/CreateQuizForm.tsx index b9fa2cb..bbf7f3b 100644 --- a/components/CreateQuizForm.tsx +++ b/components/CreateQuizForm.tsx @@ -1,11 +1,10 @@ import { Session } from "@supabase/supabase-js"; import React, { FormEvent, useState } from "react"; -import { SaveQuiz } from "../types"; -import { supabase } from "../utils/supabaseClient"; +import classNames from "clsx"; +import { Profile, SaveQuiz } from "../types"; import Editor from "@monaco-editor/react"; -import Hashids from "hashids"; -const hashids = new Hashids(); +import PreviewQuiz from "./PreviewQuiz"; type FormInputProps = { name: string; @@ -15,154 +14,140 @@ type FormInputProps = { }; const FormInput = (props: FormInputProps) => ( -
-