Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 2822 | Rev 2829 | 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'
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
13
  const { openShareModal, feedType, postUrl } = props;
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}>
2817 stevensc 23
        <input
2815 stevensc 24
          name="description-main"
2816 stevensc 25
          placeholder="Que estas pensando?"
2815 stevensc 26
          className="form-control"
27
          readOnly
28
          onClick={(e) => onClickHandler(e, shareModalTypes.POST)}
29
        />
30
        <div className={styles.shareRowContainer}>
2828 stevensc 31
          <button
32
            className={styles.shareIconContainer}
33
            onClick={(e) => onClickHandler(e, shareModalTypes.VIDEO)}
34
          >
35
            <BsCameraVideoFill className={styles.shareIcon} />
36
          </button>
37
          <button
38
            className={styles.shareIconContainer}
39
            onClick={(e) => onClickHandler(e, shareModalTypes.IMAGE)}
40
          >
41
            <BsCardImage className={styles.shareIcon} />
42
          </button>
43
          <button
44
            className={styles.shareIconContainer}
45
            onClick={(e) => onClickHandler(e, shareModalTypes.FILE)}
46
          >
47
            <CgLoadbarDoc className={styles.shareIcon} />
48
          </button>
49
          <button
50
            className={`${styles.shareIconContainer} ${styles.iconActive}`}
51
            onClick={(e) => onClickHandler(e, shareModalTypes.POST)}
52
          >
53
            <TbSend className={styles.shareIcon} />
54
          </button>
1 www 55
        </div>
2813 stevensc 56
      </form>
2812 stevensc 57
    </div >
1 www 58
  );
59
};
60
 
61
// const mapStateToProps = (state) => ({});
62
 
63
const mapDispatchToProps = {
64
  openShareModal: (postUrl, modalType, feedType) =>
65
    openShareModal(postUrl, modalType, feedType),
66
};
67
 
68
export default connect(null, mapDispatchToProps)(ShareFeed);