[FE] refactor: 리뷰 작성 페이지에 useModals 훅 적용 #282
Merged
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.
🚀 어떤 기능을 구현했나요 ?
useModals
훅을 리뷰 작성 페이지에 적용했습니다. 이전 버전의 리뷰 작성 페이지에만 추가했고, 새로 바뀔 UI에는 아직 적용되지 않습니다.🔥 어떻게 해결했나요 ?
useModals
는 모달의 Key를 사용해서 상태를 동적으로 관리할 수 있어요.'confirm' | 'alert' | 'error'
과 같이 제한하는 것이 좋을지 고민했었는데, 같은 종류의 모달이 여러 개 띄워지는 경우 등을 고려했을 때 key는 사용자가 알아서 관리하는 것이 낫겠다고 판단했어요.📝 어떤 부분에 집중해서 리뷰해야 할까요?
📚 참고 자료, 할 말
코드 변경 사항에서 자세한 부분을 확인할 수 있습니다.
isOpen
,openModal
,closeModal
각각에 key를 전달해서 해당 key에 해당하는 모달 상태 및 동작 함수를 실행할 수 있어요.