Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 556 | Rev 1507 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 556 Rev 655
Línea 43... Línea 43...
43
  link_save_reaction = '',
43
  link_save_reaction = '',
44
  link_add_comment = '',
44
  link_add_comment = '',
45
  onEdit = () => {},
45
  onEdit = () => {},
46
  onDelete = () => {},
46
  onDelete = () => {},
47
  updateComments = () => {},
47
  updateComments = () => {},
48
  updateReactions = () => {},
48
  updateReactions = () => {}
49
}) => {
49
}) => {
50
  const [comments, setComments] = useState(defaultComments)
50
  const [comments, setComments] = useState(defaultComments)
51
  const [totalComments, setTotalComments] = useState(total_comments)
51
  const [totalComments, setTotalComments] = useState(total_comments)
52
  const [totalReactions, setTotalReactions] = useState(total_reactions)
52
  const [totalReactions, setTotalReactions] = useState(total_reactions)
53
  const [showComments, setShowComments] = useState(false)
53
  const [showComments, setShowComments] = useState(false)
Línea 74... Línea 74...
74
 
74
 
75
        setComments([...comments, data.item])
75
        setComments([...comments, data.item])
76
        updateComments(data.total_comments_question)
76
        updateComments(data.total_comments_question)
77
        setTotalComments(data.total_comments_answer)
77
        setTotalComments(data.total_comments_answer)
78
      })
78
      })
79
      .catch((error) => {
-
 
80
        dispatch(
-
 
81
          addNotification({
-
 
82
            style: 'danger',
79
      .catch((err) => {
83
            msg: 'Error interno. Intente más tarde.',
-
 
84
          })
-
 
85
        )
-
 
86
        throw new Error(error)
80
        dispatch(addNotification({ style: 'danger', msg: err.message }))
87
      })
81
      })
Línea 88... Línea 82...
88
  }
82
  }
89
 
83
 
Línea 111... Línea 105...
111
 
105
 
112
        setComments(newComments)
106
        setComments(newComments)
113
        updateComments(data.total_comments_question)
107
        updateComments(data.total_comments_question)
114
        setTotalComments(data.total_comments_answer)
108
        setTotalComments(data.total_comments_answer)
115
      })
109
      })
116
      .catch((error) => {
-
 
117
        dispatch(
-
 
118
          addNotification({
-
 
119
            style: 'danger',
110
      .catch((err) => {
120
            msg: 'Error interno. Intente más tarde.',
-
 
121
          })
-
 
122
        )
-
 
123
        throw new Error(error)
111
        dispatch(addNotification({ style: 'danger', msg: err.message }))
124
      })
112
      })
Línea 125... Línea 113...
125
  }
113
  }
126
 
114
 
Línea 169... Línea 157...
169
              <DeleteIcon />
157
              <DeleteIcon />
170
              {labels.delete}
158
              {labels.delete}
171
            </button>
159
            </button>
172
          )}
160
          )}
173
        </StyledContainer.Actions>
161
        </StyledContainer.Actions>
174
        <div className="px-1 pb-1">
162
        <div className='px-1 pb-1'>
175
          <StyledForm image={user_image} onSubmit={addComment} />
163
          <StyledForm image={user_image} onSubmit={addComment} />
176
          {showComments && (
164
          {showComments && (
177
            <CommentsList comments={comments} onDelete={deleteComment} />
165
            <CommentsList comments={comments} onDelete={deleteComment} />
178
          )}
166
          )}
179
        </div>
167
        </div>