boostcamp-2020/IssueTracker-35

[component] Comment

Opened this issue · 0 comments

joh16 commented

개요

  • Issue 상세 페이지의 덧글

상속 관계

  • Included in Comment container, props: comment, dispatch
  • ProfileImage
  • Content
  • DebouncedInput
  • Reaction Dropdown, props: dispatch
  • Edit Button
  • Update comment Button
  • Cancel Button

상태

  • edit: false
  • content: ''
  • reactions: array[Reaction]

세부 동작

  • 기획서
  • Reaction Dropdown을 클릭하면 리액션 목록이 나타남
    • 본인이 이미 선택한 리액션을 클릭하면 DELETE_REACTION, 새로운 리액션을 클릭하면 ADD_REACTION으로 dispatch
  • 로그인된 사용자와 덧글 작성자가 같은 경우 Edit 버튼이 보임
  • Edit 버튼을 누르면 edittrue로 변경
  • Content는 editfalse인 경우 p 태그, true인 경우 DebouncedInput으로 보임
  • Update comment 버튼을 누르면 PATCH /comments/:id 이후 contentDebouncedInput의 내용으로, editfalse로 변경
  • Cancel 버튼을 누르면 editfalse로 변경