Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 2812 | Rev 2814 | 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">
21
        <div className="share_feed_post_topbar">
22
          <textarea
23
            id="description-main"
24
            name="description-main"
25
            placeholder="Publica contenido para intercambiar con tus contactos"
26
            className="form-control"
27
            readOnly
28
            rows="2"
29
            onClick={(e) => onClickHandler(e, shareModalTypes.POST)}
30
            style={{ resize: "none" }}
31
          />
32
          <div className="clearfix">
33
            <div className="row p-1">
34
              <div className={styles.shareRowContainer}>
35
                <div className={styles.shareIconContainer}>
36
                  <button
37
                    className="btn btn-trans p-0 d-flex justify-content-center"
38
                    onClick={(e) => onClickHandler(e, shareModalTypes.VIDEO)}
39
                  >
40
                    <img src="/images/video-icon.png" className={styles.shareImage} />
41
                  </button>
42
                </div>
43
                <div className={styles.shareIconContainer}>
44
                  <button
45
                    className="btn btn-trans p-0"
46
                    onClick={(e) => onClickHandler(e, shareModalTypes.IMAGE)}
47
                  >
48
                    <BsCardImage className={styles.shareIcon} />
49
                  </button>
50
                </div>
51
                <div className={styles.shareIconContainer}>
52
                  <button
53
                    className="btn btn-trans p-0"
54
                    onClick={(e) => onClickHandler(e, shareModalTypes.FILE)}
55
                  >
56
                    <BsFillFileEarmarkTextFill className={styles.shareIcon} />
57
                  </button>
58
                </div>
59
                <div className={`text-center ${styles.shareIconContainer}`}>
60
                  <button
61
                    className="btn btn-primary"
62
                    type="button"
63
                    id="btn-description-main"
2371 stevensc 64
                    onClick={(e) => onClickHandler(e, shareModalTypes.POST)}
2813 stevensc 65
                    style={{ padding: '2px 10px' }}
66
                  >
67
                    Compartir
68
                  </button>
1 www 69
                </div>
70
              </div>
71
            </div>
2813 stevensc 72
          </div>
1 www 73
        </div>
2813 stevensc 74
      </form>
2812 stevensc 75
    </div >
1 www 76
  );
77
};
78
 
79
// const mapStateToProps = (state) => ({});
80
 
81
const mapDispatchToProps = {
82
  openShareModal: (postUrl, modalType, feedType) =>
83
    openShareModal(postUrl, modalType, feedType),
84
};
85
 
86
export default connect(null, mapDispatchToProps)(ShareFeed);