From 04ad0788e314026e0a094a7598b25d13a580887a Mon Sep 17 00:00:00 2001 From: Grzegorz Pokorski Date: Fri, 13 Jan 2023 14:27:16 +0100 Subject: [PATCH 01/23] feat(app): add ability to edit questions on questions list to admin --- .../QuestionsList/QuestionsList.tsx | 28 ++++++++++++------- .../QuestionsList/QuestionsManagment.tsx | 24 ++++++++++++++++ apps/app/src/lib/question.ts | 2 +- 3 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 apps/app/src/components/QuestionsList/QuestionsManagment.tsx diff --git a/apps/app/src/components/QuestionsList/QuestionsList.tsx b/apps/app/src/components/QuestionsList/QuestionsList.tsx index 08e5ec28..ae0431b7 100644 --- a/apps/app/src/components/QuestionsList/QuestionsList.tsx +++ b/apps/app/src/components/QuestionsList/QuestionsList.tsx @@ -1,13 +1,15 @@ "use client"; import { useGetQuestionsVotes } from "../../hooks/useQuestionVoting"; -import { Question, QuestionFilter } from "../../types"; +import { useUIContext } from "../../providers/UIProvider"; +import { AdminQuestion, Question, QuestionFilter } from "../../types"; import { QuestionItem } from "../QuestionItem/QuestionItem"; import { QuestionLevel } from "../QuestionItem/QuestionLevel"; import { QuestionVoting } from "./QuestionVoting"; +import { QuestionsManagement } from "./QuestionsManagment"; type QuestionsListProps = Readonly<{ - questions: Question[]; + questions: AdminQuestion[]; questionFilter: QuestionFilter; }>; @@ -20,8 +22,11 @@ export const QuestionsList = ({ questions, questionFilter }: QuestionsListProps) return (