diff --git a/public/images/empty_my_history.png b/public/images/empty_my_history.png new file mode 100644 index 00000000..933300f0 Binary files /dev/null and b/public/images/empty_my_history.png differ diff --git a/src/app/[groupId]/tasklist/_components/task-list-container.tsx b/src/app/[groupId]/tasklist/_components/task-list-container.tsx index b165f204..8924d517 100644 --- a/src/app/[groupId]/tasklist/_components/task-list-container.tsx +++ b/src/app/[groupId]/tasklist/_components/task-list-container.tsx @@ -117,7 +117,6 @@ const TaskListContainer = ({ { "w-full" )} > - - - + {taskListId ? ( + <> + + + + + ) : ( +
+

+ 할 일 목록을 선택해주세요. +

+
+ )} diff --git a/src/app/[groupId]/tasklist/page.tsx b/src/app/[groupId]/tasklist/page.tsx index 830780ef..61a67257 100644 --- a/src/app/[groupId]/tasklist/page.tsx +++ b/src/app/[groupId]/tasklist/page.tsx @@ -56,7 +56,7 @@ export const generateMetadata = async ({ const response = await fetchTaskList(Number(groupId), Number(list), token); return { - title: `${response.name ? response.name : "페이지를 찾을 수 없습니다."} - 할 일 목록`, + title: `${response.name ? response.name : "할 일 목록 선택"} - 할 일 목록`, description: `${response.name ? `${response.name}의 할 일을 확인할 수 있습니다.` : "페이지를 찾을 수 없습니다."}`, openGraph: { title: `${response.name ? response.name : "페이지를 찾을 수 없습니다."} - 할 일 목록 | Coworkers`, diff --git a/src/app/myhistory/_components/history-list.tsx b/src/app/myhistory/_components/history-list.tsx index 44846971..9ee172df 100644 --- a/src/app/myhistory/_components/history-list.tsx +++ b/src/app/myhistory/_components/history-list.tsx @@ -1,12 +1,32 @@ import List from "@/components/list/list"; import { MonthlyTaskList } from "@/types/task"; import { formatDateWithDay } from "@/utils/date-util"; +import Image from "next/image"; const HistoryList = ({ monthlyTaskList, }: { monthlyTaskList: MonthlyTaskList[]; }) => { + if (!monthlyTaskList.length) { + return ( +
+ empty_my_history +

+ 아직 완료된 할 일이 없습니다. +

+
+ ); + } + return (
    {[...monthlyTaskList].reverse().map((taskList) => { diff --git a/src/components/task-card/task-card.stories.tsx b/src/components/task-card/task-card.stories.tsx index 7a5476a9..5b70f453 100644 --- a/src/components/task-card/task-card.stories.tsx +++ b/src/components/task-card/task-card.stories.tsx @@ -39,7 +39,6 @@ export const Default: Story = { args: { groupId: 3290, taskListId: 4711, - pageListId: 4711, taskTitle: "법인 설립", total: 5, completed: 2, @@ -50,7 +49,6 @@ export const HasTaskList: Story = { args: { groupId: 3290, taskListId: 4711, - pageListId: 4711, taskTitle: "법인 설립", total: 5, completed: 2, diff --git a/src/components/task-card/task-card.tsx b/src/components/task-card/task-card.tsx index d433994b..7c2fb254 100644 --- a/src/components/task-card/task-card.tsx +++ b/src/components/task-card/task-card.tsx @@ -12,11 +12,11 @@ import Checkbox, { CheckboxProps } from "../checkbox/checkbox"; import Dropdown from "../dropdown-components/dropdown"; import Icon from "../icon/Icon"; import DeleteModalUI from "../modal-ui/delete-modal-ui"; +import { useRouter } from "next/navigation"; interface TaskCardProps extends BadgeProps { groupId: number; taskListId: number; - pageListId: number; taskTitle: string; taskList?: CheckboxProps[]; handleClickCheckbox?: MouseEventHandler; @@ -25,13 +25,13 @@ interface TaskCardProps extends BadgeProps { const TaskCard = ({ groupId, taskListId, - pageListId, taskTitle, taskList, total, completed, handleClickCheckbox, }: TaskCardProps) => { + const router = useRouter(); const { Modal: DeleteModal, openPrompt: openDeleteModal, @@ -47,6 +47,7 @@ const TaskCard = ({ const handleDelete = () => { deleteTaskList({ groupId, taskListId }); closeDeleteModal(); + router.replace(`/${groupId}/tasklist`); }; const { mutate: patchTaskList, isPending: patchPending } =