Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 2829 | Rev 3503 | 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";
3192 stevensc 5
import { BsCameraVideoFill, BsCardImage } from 'react-icons/bs'
2822 stevensc 6
import { TbSend } from 'react-icons/tb'
7
import { CgLoadbarDoc } from 'react-icons/cg'
1 www 8
 
9
import styles from "./shareFeed.module.scss";
10
 
11
const ShareFeed = (props) => {
12
  // Reduce destructuring
2829 stevensc 13
  const { openShareModal, feedType, postUrl, image } = props;
1 www 14
 
2371 stevensc 15
  const onClickHandler = (e, postType) => {
16
    e.preventDefault()
1 www 17
    openShareModal(postUrl, postType, feedType);
18
  };
2196 stevensc 19
 
1 www 20
  return (
2813 stevensc 21
    <div id="publica-feed" className={styles.shareFeed}>
2816 stevensc 22
      <form id="form-main" name="form-main" className={styles.formContainer}>
2829 stevensc 23
        <div className={styles.userInputContainer}>
24
          <img
25
            src={image}
26
            alt="User image profile"
27
          />
28
          <input
29
            name="description-main"
30
            placeholder="Que estas pensando?"
31
            className="form-control"
32
            readOnly
33
            onClick={(e) => onClickHandler(e, shareModalTypes.POST)}
34
          />
35
        </div>
2815 stevensc 36
        <div className={styles.shareRowContainer}>
2828 stevensc 37
          <button
38
            className={styles.shareIconContainer}
39
            onClick={(e) => onClickHandler(e, shareModalTypes.VIDEO)}
40
          >
41
            <BsCameraVideoFill className={styles.shareIcon} />
42
          </button>
43
          <button
44
            className={styles.shareIconContainer}
45
            onClick={(e) => onClickHandler(e, shareModalTypes.IMAGE)}
46
          >
47
            <BsCardImage className={styles.shareIcon} />
48
          </button>
49
          <button
50
            className={styles.shareIconContainer}
51
            onClick={(e) => onClickHandler(e, shareModalTypes.FILE)}
52
          >
53
            <CgLoadbarDoc className={styles.shareIcon} />
54
          </button>
55
          <button
56
            className={`${styles.shareIconContainer} ${styles.iconActive}`}
57
            onClick={(e) => onClickHandler(e, shareModalTypes.POST)}
58
          >
59
            <TbSend className={styles.shareIcon} />
60
          </button>
1 www 61
        </div>
2813 stevensc 62
      </form>
2812 stevensc 63
    </div >
1 www 64
  );
65
};
66
 
67
// const mapStateToProps = (state) => ({});
68
 
69
const mapDispatchToProps = {
70
  openShareModal: (postUrl, modalType, feedType) =>
71
    openShareModal(postUrl, modalType, feedType),
72
};
73
 
74
export default connect(null, mapDispatchToProps)(ShareFeed);