Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#110 fix : 헤더 진행률 & 알람 종류 추가 #111

Merged
merged 2 commits into from
Nov 13, 2024
Merged

Conversation

sinamong0620
Copy link
Collaborator

🪄 목적

관련 이슈 : #110



💻 상세 작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요.

  • 진행률 업데이트를 수정하고 추가된 알람의 종류도 수정했어요


📸 스크린샷



스크린샷 2024-11-12 오전 1 52 01
스크린샷 2024-11-12 오전 1 52 15

👼🏻 리뷰 요구사항 (선택)

리뷰어가 특별히 봐줬으면 하는 부분이 있다면 작성해주세요.

Comment on lines +23 to +25
<S.GraphProgress blockProgress={progress.toFixed(1)}></S.GraphProgress>
</S.GraphWrapper>
<span>{blockProgress}%</span>
<span>{progress.toFixed(1)}%</span>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

파라미터로 1은 왜 전달하는지 궁금합니다!~

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 저게 소수점 밑에 1자리 수로 나오게 하려고 전달한거에요~

Comment on lines +139 to +167
//시작점 상태에서 종착지가 시작점 상태와는 다른 상태일때 그 아이템 개수 -1
if (source.droppableId === 'todo' && destination.droppableId !== 'todo')
setBlockTotal(prev => ({
...prev,
todo: blockTotal.todo - 1,
[destination.droppableId]:
blockTotal[destination.droppableId as keyof typeof blockTotal] + 1,
}));
else if (source.droppableId === 'doing' && destination.droppableId !== 'doing')
setBlockTotal(prev => ({
...prev,
doing: blockTotal.doing - 1,
[destination.droppableId]:
blockTotal[destination.droppableId as keyof typeof blockTotal] + 1,
}));
else if (source.droppableId === 'completed' && destination.droppableId !== 'completed')
setBlockTotal(prev => ({
...prev,
completed: blockTotal.completed - 1,
[destination.droppableId]:
blockTotal[destination.droppableId as keyof typeof blockTotal] + 1,
}));
else if (source.droppableId === 'delete' && destination.droppableId !== 'delete')
setBlockTotal(prev => ({
...prev,
delete: blockTotal.completed - 1,
[destination.droppableId]:
blockTotal[destination.droppableId as keyof typeof blockTotal] + 1,
}));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function updateBlockTotal(sourceId: string, destinationId: string) {
    if (sourceId !== destinationId) {
        setBlockTotal(prev => ({
            ...prev,
            [sourceId]: blockTotal[sourceId as keyof typeof blockTotal] - 1,
            [destinationId]: blockTotal[destinationId as keyof typeof blockTotal] + 1,
        }));
    }
}

// 호출 부분
updateBlockTotal(source.droppableId, destination.droppableId);

위와 같이 중복되는 부분을 함수로 분리하면 더 간결하게 작성할 수 있을 것 같아요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

조언 감사합니다!
추후에 수정할게요!

MyungJiwoo

This comment was marked as off-topic.

Copy link
Collaborator

@MyungJiwoo MyungJiwoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다~~👍🏻👍🏻

@sinamong0620 sinamong0620 merged commit a452719 into main Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants