Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 2814 | Rev 2816 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 www 1
import React from "react";
2
import { connect } from "react-redux";
3
import { openShareModal } from "../../../redux/share-modal/shareModal.actions";
4
import { shareModalTypes } from "../../../redux/share-modal/shareModal.types";
2199 stevensc 5
import { BsCameraVideoFill, BsCardImage, BsFillFileEarmarkTextFill } from 'react-icons/bs'
1 www 6
 
7
import styles from "./shareFeed.module.scss";
8
 
9
const ShareFeed = (props) => {
10
  // Reduce destructuring
11
  const { openShareModal, feedType, postUrl } = props;
12
 
2371 stevensc 13
  const onClickHandler = (e, postType) => {
14
    e.preventDefault()
1 www 15
    openShareModal(postUrl, postType, feedType);
16
  };
2196 stevensc 17
 
1 www 18
  return (
2813 stevensc 19
    <div id="publica-feed" className={styles.shareFeed}>
20
      <form id="form-main" name="form-main" className="w-100">
2815 stevensc 21
        <textarea
22
          id="description-main"
23
          name="description-main"
24
          placeholder="Publica contenido para intercambiar con tus contactos"
25
          className="form-control"
26
          readOnly
27
          rows="2"
28
          onClick={(e) => onClickHandler(e, shareModalTypes.POST)}
29
          style={{ resize: "none" }}
30
        />
31
        <div className={styles.shareRowContainer}>
32
          <div className={styles.shareIconContainer}>
33
            <button
34
              className="btn btn-trans p-0"
35
              onClick={(e) => onClickHandler(e, shareModalTypes.VIDEO)}
36
            >
37
              <BsCameraVideoFill className={styles.shareIcon} />
38
            </button>
2813 stevensc 39
          </div>
2815 stevensc 40
          <div className={styles.shareIconContainer}>
41
            <button
42
              className="btn btn-trans p-0"
43
              onClick={(e) => onClickHandler(e, shareModalTypes.IMAGE)}
44
            >
45
              <BsCardImage className={styles.shareIcon} />
46
            </button>
47
          </div>
48
          <div className={styles.shareIconContainer}>
49
            <button
50
              className="btn btn-trans p-0"
51
              onClick={(e) => onClickHandler(e, shareModalTypes.FILE)}
52
            >
53
              <BsFillFileEarmarkTextFill className={styles.shareIcon} />
54
            </button>
55
          </div>
56
          <div className={`${styles.shareIconContainer} active`}>
57
            <button
58
              className="btn btn-trans p-0"
59
              onClick={(e) => onClickHandler(e, shareModalTypes.POST)}
60
            >
61
              <BsFillFileEarmarkTextFill className={styles.shareIcon} />
62
            </button>
63
          </div>
1 www 64
        </div>
2813 stevensc 65
      </form>
2812 stevensc 66
    </div >
1 www 67
  );
68
};
69
 
70
// const mapStateToProps = (state) => ({});
71
 
72
const mapDispatchToProps = {
73
  openShareModal: (postUrl, modalType, feedType) =>
74
    openShareModal(postUrl, modalType, feedType),
75
};
76
 
77
export default connect(null, mapDispatchToProps)(ShareFeed);