Proyectos de Subversion LeadersLinked - Backend

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
12149 stevensc 1
import React from 'react'
2
import { useDispatch } from 'react-redux'
3
import { openShareModal } from '../../redux/share-modal/shareModal.actions'
4
import { shareModalTypes } from '../../redux/share-modal/shareModal.types'
7154 stevensc 5
 
7386 stevensc 6
const FeedShare = ({ post_url }) => {
16655 stevensc 7
  const dispatch = useDispatch()
7154 stevensc 8
 
16655 stevensc 9
  const onClickHandler = (e, modalType) => {
10
    e.preventDefault()
11
    dispatch(openShareModal(post_url, modalType))
12
  }
7386 stevensc 13
 
16655 stevensc 14
  return (
16696 stevensc 15
    <form className={'formContainer'}>
16
      <div className={'userInputContainer'}>
17
        <input
18
          name="description-main"
19
          placeholder="¿Qué tienes en mente?"
20
          className="form-control"
21
          readOnly
22
          onClick={(e) => onClickHandler(e, shareModalTypes.POST)}
23
          onFocus={(e) => {
24
            e.target.blur()
25
            onClickHandler(e, shareModalTypes.POST)
26
          }}
27
        />
16655 stevensc 28
      </div>
16696 stevensc 29
      <div className={'shareRowContainer'}>
30
        <button
31
          className="btn shareIconContainer"
32
          onClick={(e) => onClickHandler(e, shareModalTypes.VIDEO)}
33
        >
34
          <i className={`${'shareIcon'} fa fa-video-camera`} />
35
        </button>
36
        <button
37
          className="btn shareIconContainer"
38
          onClick={(e) => onClickHandler(e, shareModalTypes.IMAGE)}
39
        >
40
          <i className={`${'shareIcon'} fa fa-image`} />
41
        </button>
42
        <button
43
          className="btn shareIconContainer"
44
          onClick={(e) => onClickHandler(e, shareModalTypes.FILE)}
45
        >
46
          <i className={`${'shareIcon'} fa fa-file`} />
47
        </button>
48
        <button
49
          className="btn shareIconContainer iconActive"
50
          onClick={(e) => onClickHandler(e, shareModalTypes.POST)}
51
        >
52
          <i className={`${'shareIcon'} fa fa-send`} />
53
        </button>
54
      </div>
55
    </form>
16655 stevensc 56
  )
12149 stevensc 57
}
7154 stevensc 58
 
59
export default FeedShare