Conversation
src/pages/post/WritePost.js
Outdated
| ...postContent, | ||
| content: data, | ||
| }); | ||
| console.log(postContent); |
There was a problem hiding this comment.
pr 날려주실 때 console.log는 삭제하고 날려주시면 좋을 것 같아요! (는 저도 주의하겠습니다.) :)
src/components/dropdown/Dropdown.js
Outdated
| if (!selection.some((current) => current.id === item.id)) { | ||
| if (!multiSelect) { | ||
| setSelection([item]); | ||
| } else if (multiSelect) { | ||
| setSelection([...selection, item]); | ||
| } | ||
| } else { | ||
| let selectionAfterRemoval = selection; | ||
| selectionAfterRemoval = selectionAfterRemoval.filter( | ||
| (current) => current.id !== item.id, | ||
| ); | ||
| setSelection([...selectionAfterRemoval]); | ||
| } |
There was a problem hiding this comment.
const find = selection.find((current) => current.id === item.id);
if (find) {
setSelection(selectionAfterRemoval.filter((current) => current.id !== item.id));
return;
}
multiSelect ? setSelection([...selection, item]) : setSelection([item]);이렇게 변경했을 때 로직이 더 이해 잘 되는 것 같아요.
그리고 19번째 줄의 filter api 자체가 새로운 배열을 반환하기 때문에 아래에서 다시 분해 연산자를 써서
복사하면 같은 결과인데도 메모리 낭비가 될 것 같아요.
There was a problem hiding this comment.
-> 이 부분 코드가 날라갔네요? 중복 카테고리 저장되는 기능을 아예 삭제하신 건가요?
There was a problem hiding this comment.
Dropdown 부분 코드를 전체 리팩토링하면서 삭제되었습니다.
| const [postContent, setPostContent] = useState({ | ||
| title: '', | ||
| content: '', | ||
| category: '', |
There was a problem hiding this comment.
지난번에 오프라인 코드 리뷰(구글밋)에서 말씀 드렸듯이, 객체로 상태 관리하는 것보다
지금은 따로 상태 관리하는 게 상태 관리할 때 덜 복잡할 것 같아요. :)
There was a problem hiding this comment.
분리작업 완료되면 다시 한번 노티 드릴께요 !
| createdAt: nowDate, | ||
| writter: auth.currentUser.displayName, | ||
| thumbnail: base64 || '', | ||
| thumbnail: imgBase64, |
There was a problem hiding this comment.
질문) 코드에서 궁금한 부분이 지금 FileReader 객체로 base64.toString() 값을 바로 DB에 저장하는데,
이렇게 만들어진 소스가 DB에서 다시 데이터 불러와서 읽을 때도 이미지가 잘 표시되나요?
There was a problem hiding this comment.
이 부분은 ... 상세페이지에서 데이터 불러올때 확인해봐야할 것 같아요
이 부분 오프라인 코드 리뷰(구글밋)으로 이야기 나눴던 부분 같은데, |
이 부분 지난 미팅때 이야기나누고 해결하고 push해서 같이 올려져있습니다. |
구현기능
주의사항
요청사항