Skip to content

Commit

Permalink
[ fix ] 진행 예정 낫투두 수정 페이지 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
NeatKYU committed Sep 16, 2023
1 parent 3e6a3a1 commit edfbd15
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pages/nottodo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,13 @@ export default function NotTodoPage() {
setIsMenuOpen(true);
};

const handleMoveDetailPage = (nottodo: nottodoProps) => {
const handleMoveEditPage = (nottodo: nottodoProps) => {
setCurrentNottodo(nottodo);
router(`/nottodo/edit/${nottodo.notToDoId}?state=complete`);
if (nottodo.progressState === 'COMPLETE') {
router(`/nottodo/edit/${nottodo.notToDoId}?state=complete`);
} else if (nottodo.progressState === 'BEFORE_START') {
router(`/nottodo/edit/${nottodo.notToDoId}`);
}
};

return (
Expand Down Expand Up @@ -119,7 +123,7 @@ export default function NotTodoPage() {
endDate={new Date(v.endDate)}
goal={v.goal}
openMenu={() => handleOpenMenu(v)}
onClick={v.progressState === 'COMPLETE' ? () => handleMoveDetailPage(v) : () => null}
onClick={() => handleMoveEditPage(v)}
/>
))}
{nottodoList.filter((v) => (progressState !== '' ? v.progressState === progressState : true)).length < 3 ? (
Expand Down

0 comments on commit edfbd15

Please sign in to comment.