Skip to content

Commit

Permalink
[ merge into dev ] 진행 예정 카드 토스트
Browse files Browse the repository at this point in the history
[ fix ] 진행 예정 낫투두 수정 페이지 이동
[ fix ] 예정일 땐 토스트 띄우기
  • Loading branch information
NeatKYU authored Sep 16, 2023
2 parents 3e6a3a1 + 00f6082 commit 74e0fcd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/pages/nottodo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Tabs } from '@/components/tab/Tabs';
import { Tab } from '@/components/tab/Tab';
import { BottomPopup } from '@/components/popup/BottomPopup';
import { DeleteTitlePopup } from '@/components/popup/PopupGroup';
import { Toast as toast } from '@/components/toast/Toast';
import { Toast, Toast as toast } from '@/components/toast/Toast';
import { deleteNottodo, getNottodoList, orderBy } from '@/api/nottodo';

import { ReactComponent as ArrowDown } from '@/assets/img/icn_arrow_down.svg';
Expand Down Expand Up @@ -74,9 +74,13 @@ export default function NotTodoPage() {
setIsMenuOpen(true);
};

const handleMoveDetailPage = (nottodo: nottodoProps) => {
const handleClickCard = (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') {
Toast('도전일이 되면 열어볼 수 있어요');
}
};

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={() => handleClickCard(v)}
/>
))}
{nottodoList.filter((v) => (progressState !== '' ? v.progressState === progressState : true)).length < 3 ? (
Expand Down

0 comments on commit 74e0fcd

Please sign in to comment.