Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1082 Rev 1084
Línea 91... Línea 91...
91
 
91
 
92
  const handleShowConfirmModal = () => {
92
  const handleShowConfirmModal = () => {
93
    setShowConfirmModal(!showConfirmModal);
93
    setShowConfirmModal(!showConfirmModal);
Línea 94... Línea -...
94
  };
-
 
95
 
-
 
96
  const handleModalAccept = () => {
-
 
97
    deleteFeedHandler();
-
 
98
  };
94
  };
99
 
95
 
100
  const likeHandler = (likeUrl) => {
96
  const likeHandler = (likeUrl) => {
101
    axios.post(likeUrl)
97
    axios.post(likeUrl)
102
      .then((res) => {
98
      .then((res) => {
Línea 123... Línea 119...
123
      const resData = res.data;
119
      const resData = res.data;
124
      const { data, success, total_comments } = resData;
120
      const { data, success, total_comments } = resData;
125
      if (success) {
121
      if (success) {
126
        const newComment = data;
122
        const newComment = data;
127
        setTotalComments(total_comments);
123
        setTotalComments(total_comments);
128
        setCommentsState([...commentsState, newComment]);
124
        setCommentsState([newComment, ...commentsState]);
129
        e.target.reset();
125
        e.target.reset();
130
      } else {
126
      } else {
131
        dispatch(addNotification({
127
        dispatch(addNotification({
132
          style: "danger",
128
          style: "danger",
133
          msg: data,
129
          msg: data,
Línea 159... Línea 155...
159
          msg: error.message,
155
          msg: error.message,
160
        }));
156
        }));
161
      });
157
      });
162
  };
158
  };
Línea 163... Línea 159...
163
 
159
 
164
  const btnShareHandler = (event) => {
-
 
165
    event.preventDefault();
160
  const btnShareHandler = () => {
166
    dispatch(openShareModal(feed_share_url, shareModalTypes.SHARE, feedTypes.DASHBOARD, feed_unique))
161
    dispatch(openShareModal(feed_share_url, shareModalTypes.SHARE, feedTypes.DASHBOARD, feed_unique))
Línea 167... Línea 162...
167
  };
162
  };
168
 
163
 
Línea 273... Línea 268...
273
    );
268
    );
274
  }
269
  }
275
  const OwnerDescription = () => <div className="show-read-more">
270
  const OwnerDescription = () => <div className="show-read-more">
276
    {htmlParsedText(owner_description)}
271
    {htmlParsedText(owner_description)}
277
  </div>
272
  </div>
-
 
273
  const TopBar = () => (
278
  const TopBar = () => <div className="post_topbar">
274
    <div className="post_topbar">
279
    <div className="usy-dt">
275
      <div className="usy-dt">
280
      <a href={owner_url}>
276
        <a href={owner_url}>
281
        <img
-
 
282
          src={owner_image}
277
          <img src={owner_image} alt="" style={{
283
          alt=""
-
 
284
          style={{
-
 
285
            width: "50px",
278
            width: "50px",
286
            height: "auto",
279
            height: "auto",
287
          }}
280
          }}
288
        />
281
          />
289
      </a>
-
 
290
      <div className="usy-name">
-
 
291
        <a href={owner_url}>
-
 
292
          <h3>{owner_name}</h3>
-
 
293
        </a>
282
        </a>
-
 
283
        <div className="usy-name">
-
 
284
          <a href={owner_url}>
-
 
285
            <h3>{owner_name}</h3>
-
 
286
          </a>
294
        <span>
287
          <span>
295
          <img src="/images/clock.png" alt="" />
288
            <img src="/images/clock.png" alt="" />
296
          {owner_time_elapse}
289
            {owner_time_elapse}
-
 
290
            {
297
          {feed_delete_url ? (
291
              feed_delete_url
298
            <a
292
              &&
-
 
293
              <button
299
              href="#"
294
                href="#"
300
              className="btn-feed-trash"
295
                className="btn-feed-trash"
301
              data-link={feed_delete_url}
296
                data-link={feed_delete_url}
302
              data-feed-unique={feed_unique}
297
                data-feed-unique={feed_unique}
303
              onClick={(e) => {
-
 
304
                e.preventDefault();
-
 
305
                handleShowConfirmModal();
298
                onClick={handleShowConfirmModal}
306
              }}
299
              >
307
            >
-
 
308
              <i className="fa fa-trash"></i>
300
                <i className="fa fa-trash"></i>
309
            </a>
301
              </button>
310
          ) : null}
302
            }
311
        </span>
303
          </span>
-
 
304
        </div>
312
      </div>
305
      </div>
313
    </div>
306
    </div >
314
  </div>
307
  )
Línea 315... Línea 308...
315
 
308
 
316
  const Content = ({ showDescription }) => (
309
  const Content = ({ showDescription }) => (
317
    <div className="job_descp">
310
    <div className="job_descp">
318
      {
311
      {
Línea 368... Línea 361...
368
            <TopBar />
361
            <TopBar />
369
            <OwnerDescription />
362
            <OwnerDescription />
370
          </div>
363
          </div>
371
        </div>
364
        </div>
372
      </Modal>
365
      </Modal>
-
 
366
 
373
      <div className={styles.postContainer} onClick={handleShow}>
367
      <div className={styles.postContainer}>
374
        <TopBar
368
        <TopBar
375
          showDescription
369
          showDescription
376
        />
370
        />
377
        <div
371
        <div
378
          onClick={() => (owner_file_image || owner_file_video || owner_file_document) ? handleShow() : null}
372
          onClick={() => (owner_file_image || owner_file_video || owner_file_document) ? handleShow() : null}
Línea 411... Línea 405...
411
              <button
405
              <button
412
                type="button"
406
                type="button"
413
                id={`btn-share-${feed_unique}`}
407
                id={`btn-share-${feed_unique}`}
414
                className="btn-indicator"
408
                className="btn-indicator"
415
              >
409
              >
416
                <i className="fas fa-share"></i> {sharedState}
410
                <i className="fas fa-share"></i>
-
 
411
                {sharedState}
417
              </button>
412
              </button>
418
            </li>
413
            </li>
419
          </ul>
414
          </ul>
420
          <button
415
          <button
421
            type="button"
416
            type="button"
422
            data-feed-unique={feed_unique}
417
            data-feed-unique={feed_unique}
423
            className="btn-feed-share"
418
            className="btn-feed-share"
424
            onClick={(e) => {
-
 
425
              btnShareHandler(e);
419
            onClick={btnShareHandler}
426
            }}
-
 
427
          >
420
          >
428
            <i className="fas fa-share"></i>Compartir
421
            <i className="fas fa-share"></i>Compartir
429
          </button>
422
          </button>
430
        </div>
423
        </div>
431
        {commentsRender}
424
        {commentsRender}
Línea 450... Línea 443...
450
                  },
443
                  },
451
                })}
444
                })}
452
              />
445
              />
453
              <button type="submit" className={styles.submitButton}>
446
              <button type="submit" className={styles.submitButton}>
454
                Enviar
447
                Enviar
455
              </button>{" "}
448
              </button>
456
              {/* Falta multilenguaje */}
449
              {/* Falta multilenguaje */}
457
            </div>
450
            </div>
458
          </form>
451
          </form>
-
 
452
          {
459
          {errors.comment && (
453
            errors.comment
-
 
454
            &&
460
            <FormErrorFeedback>{errors.comment.message}</FormErrorFeedback>
455
            <FormErrorFeedback>{errors.comment.message}</FormErrorFeedback>
461
          )}
456
          }
462
        </div>
457
        </div>
463
      </div>
458
      </div>
-
 
459
 
464
      <ConfirmModal
460
      <ConfirmModal
465
        show={showConfirmModal}
461
        show={showConfirmModal}
466
        onClose={() => {
-
 
467
          setShowConfirmModal(false);
462
        onClose={() => setShowConfirmModal(false)}
468
        }}
-
 
469
        onAccept={handleModalAccept}
463
        onAccept={deleteFeedHandler}
470
        acceptLabel="Aceptar"
464
        acceptLabel="Aceptar"
471
      />
465
      />
472
    </React.Fragment>
466
    </React.Fragment>
473
  );
467
  );
474
};
468
};