From dad84d072006b3970d3e89f9b33457f9f2c2ff08 Mon Sep 17 00:00:00 2001 From: wlren Date: Mon, 24 Oct 2022 22:45:21 +0800 Subject: [PATCH] [questions][ui] pop up dialog on list page --- apps/portal/src/pages/questions/lists.tsx | 36 +++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/apps/portal/src/pages/questions/lists.tsx b/apps/portal/src/pages/questions/lists.tsx index 168ada99..764474ea 100644 --- a/apps/portal/src/pages/questions/lists.tsx +++ b/apps/portal/src/pages/questions/lists.tsx @@ -8,6 +8,8 @@ import { } from '@heroicons/react/24/outline'; import QuestionListCard from '~/components/questions/card/question/QuestionListCard'; +import CreateListDialog from '~/components/questions/CreatListDialog'; +import DeleteListDialog from '~/components/questions/DeleteListDialog'; import { Button } from '~/../../../packages/ui/dist'; import { APP_TITLE } from '~/utils/questions/constants'; @@ -44,6 +46,25 @@ export default function ListPage() { const [selectedList, setSelectedList] = useState( (lists ?? []).length > 0 ? lists[0].id : '', ); + const [showDeleteListDialog, setShowDeleteListDialog] = useState(false); + const [showCreateListDialog, setShowCreateListDialog] = useState(false); + + const handleDeleteList = () => { + setShowDeleteListDialog(false); + }; + + const handleDeleteListCancel = () => { + setShowDeleteListDialog(false); + }; + + const handleCreateList = () => { + setShowCreateListDialog(false); + }; + + const handleCreateListCancel = () => { + setShowCreateListDialog(false); + }; + const listOptions = ( <>