Skip to content

Conversation

@hurima90-kim
Copy link
Contributor

구현기능

  • Myblog내에 글쓰기 버튼 생성
  • 카테고리, 타이틀, 썸네일, 웹에디터 기능 구현
  • CKEditor5 로 웹에디터 구현
  • 빈이미지 클릭하여 이미지 등록
  • 이미지 프리뷰 기능 구현
  • 저장버튼 클릭시 Firestore에 저장
  • 이미지 base64 문자열로 변경하여 주소를 이용하여 업로드

image
image

주의사항

  • 이미지 엑스박스 숨기처리 미구현
  • 에러처리 미구현

요청사항

  • 카테고리 클릭 시 두번 선택해야 상태저장되는 문제 해결 필요

@hurima90-kim hurima90-kim added the enhancement New feature or request label Oct 23, 2021
@hurima90-kim hurima90-kim self-assigned this Oct 23, 2021
@hurima90-kim hurima90-kim linked an issue Oct 23, 2021 that may be closed by this pull request
6 tasks
...postContent,
content: data,
});
console.log(postContent);
Copy link
Member

Choose a reason for hiding this comment

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

pr 날려주실 때 console.log는 삭제하고 날려주시면 좋을 것 같아요! (는 저도 주의하겠습니다.) :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵, 삭제했습니다 :)

Comment on lines 11 to 23
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]);
}
Copy link
Member

Choose a reason for hiding this comment

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

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 자체가 새로운 배열을 반환하기 때문에 아래에서 다시 분해 연산자를 써서
복사하면 같은 결과인데도 메모리 낭비가 될 것 같아요.

Copy link
Member

Choose a reason for hiding this comment

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

-> 이 부분 코드가 날라갔네요? 중복 카테고리 저장되는 기능을 아예 삭제하신 건가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dropdown 부분 코드를 전체 리팩토링하면서 삭제되었습니다.

const [postContent, setPostContent] = useState({
title: '',
content: '',
category: '',
Copy link
Member

Choose a reason for hiding this comment

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

지난번에 오프라인 코드 리뷰(구글밋)에서 말씀 드렸듯이, 객체로 상태 관리하는 것보다
지금은 따로 상태 관리하는 게 상태 관리할 때 덜 복잡할 것 같아요. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

분리작업 완료되면 다시 한번 노티 드릴께요 !

createdAt: nowDate,
writter: auth.currentUser.displayName,
thumbnail: base64 || '',
thumbnail: imgBase64,
Copy link
Member

Choose a reason for hiding this comment

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

질문) 코드에서 궁금한 부분이 지금 FileReader 객체로 base64.toString() 값을 바로 DB에 저장하는데,
이렇게 만들어진 소스가 DB에서 다시 데이터 불러와서 읽을 때도 이미지가 잘 표시되나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

이 부분은 ... 상세페이지에서 데이터 불러올때 확인해봐야할 것 같아요

@SUPINKIM
Copy link
Member

주의사항
이미지 엑스박스 숨기처리 미구현
에러처리 미구현
요청사항
카테고리 클릭 시 두번 선택해야 상태저장되는 문제 해결 필요

이 부분 오프라인 코드 리뷰(구글밋)으로 이야기 나눴던 부분 같은데,
이 부분 해결한 코드 pr 날려주시면 그 때 approve해서 한번에 머지하는 것으로 하겠습니다.

@hurima90-kim
Copy link
Contributor Author

주의사항
이미지 엑스박스 숨기처리 미구현
에러처리 미구현
요청사항
카테고리 클릭 시 두번 선택해야 상태저장되는 문제 해결 필요

이 부분 오프라인 코드 리뷰(구글밋)으로 이야기 나눴던 부분 같은데, 이 부분 해결한 코드 pr 날려주시면 그 때 approve해서 한번에 머지하는 것으로 하겠습니다.

이 부분 지난 미팅때 이야기나누고 해결하고 push해서 같이 올려져있습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 게시글 작성 페이지 구현

3 participants