[dashboard] dashboard modal에 dropdown, button 컴포넌트 적용, 전반적인 리팩토링#33
Merged
[dashboard] dashboard modal에 dropdown, button 컴포넌트 적용, 전반적인 리팩토링#33
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#️⃣ Related Issue
#25
📝 Problem
✅ Solving
src/components/dashboard/modalmodal-base를modal-button으로 명칭 변경modal-base를 새로 만들어서 기본적인 modal 함수와 UI를 포함 ->modal-button과 button이 필요없는 modal에 적용modla-button에 적용useCallbackWhenClickItem추가 및 UI 수정)기능 구현에 앞서서 리팩토링이 필요하다고 생각했었는데요.
코드가 굉장히 정리가 되었습니다 🥺
나중에 시간이 나면 React Portal을 써서 modal을 관리하는 코드로 개선 해볼 여지도 있을 것 같네요.
📚 Attachment
modal-base UI 코드
modal-button UI 코드
modal-base가 modal-button을 감싸고 modal-button이 또 다른 컴포넌트를 감싸는 구조입니다.

Dropdown 적용
edit-task-form.tsx코드가 별로 안줄어든 것처럼 보이지만 😅 기존 코드가 dropdown에 필요한 state와 함수, ref가 여러번 반복되서 정의되었기 때문에, 많이 개선된 모습입니다 ㅎ
해당 파일에 onClick 이벤트로
setIsStatusDropdownOpen(!isStatusDropdownOpen)같은 코드는 사실 dropdown 상태를 내부에서 관리하기 때문에 삭제해야하는 코드지만, 해당 상태에 따라서 화살표가 회전하는 UI가 있어서 아직 깔끔하게 없애지는 못했네요😅Pn Rule
Note