Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 718 Rev 722
Línea 45... Línea 45...
45
    feed_delete_url,
45
    feed_delete_url,
46
    comments,
46
    comments,
47
    comment_add_url,
47
    comment_add_url,
48
  } = props.feed;
48
  } = props.feed;
Línea -... Línea 49...
-
 
49
 
-
 
50
  const [totalComments, setTotalComments] = useState(owner_comments || 0);
49
 
51
 
50
  // Destructuring redux
52
  // Destructuring redux
51
  const { feedType } = props;
53
  const { feedType } = props;
Línea 52... Línea 54...
52
  const { deleteFeed, addNotification, openShareModal } = props;
54
  const { deleteFeed, addNotification, openShareModal } = props;
Línea 114... Línea 116...
114
    axios.post(comment_add_url, currentFormData).then((res) => {
116
    axios.post(comment_add_url, currentFormData).then((res) => {
115
      const resData = res.data;
117
      const resData = res.data;
116
      const { data, success, total_comments } = resData;
118
      const { data, success, total_comments } = resData;
117
      if (success) {
119
      if (success) {
118
        const newComment = data;
120
        const newComment = data;
-
 
121
        setTotalComments(total_comments);
119
        setCommentsState([...commentsState, newComment]);
122
        setCommentsState([...commentsState, newComment]);
120
        e.target.reset();
123
        e.target.reset();
121
      } else {
124
      } else {
122
        addNotification({
125
        addNotification({
123
          style: "danger",
126
          style: "danger",
Línea 399... Línea 402...
399
              <a
402
              <a
400
                href="#"
403
                href="#"
401
                id={`btn-comments-${feed_unique}`}
404
                id={`btn-comments-${feed_unique}`}
402
                className="btn-indicator"
405
                className="btn-indicator"
403
              >
406
              >
404
                <i className="fas fa-comments"></i> {owner_comments}
407
                <i className="fas fa-comments"></i> {totalComments}
405
              </a>
408
              </a>
406
            </li>
409
            </li>
407
            <li>
410
            <li>
408
              <a
411
              <a
409
                href="#"
412
                href="#"