Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16671 | Autoría | Ultima modificación | Ver Log |

import React from 'react'
import { useDispatch } from 'react-redux'
import { openShareModal } from '../../redux/share-modal/shareModal.actions'
import { shareModalTypes } from '../../redux/share-modal/shareModal.types'

const FeedShare = ({ post_url }) => {
  const dispatch = useDispatch()

  const onClickHandler = (e, modalType) => {
    e.preventDefault()
    dispatch(openShareModal(post_url, modalType))
  }

  return (
    <form className={'formContainer'}>
      <div className={'userInputContainer'}>
        <input
          name="description-main"
          placeholder="¿Qué tienes en mente?"
          className="form-control"
          readOnly
          onClick={(e) => onClickHandler(e, shareModalTypes.POST)}
          onFocus={(e) => {
            e.target.blur()
            onClickHandler(e, shareModalTypes.POST)
          }}
        />
      </div>
      <div className={'shareRowContainer'}>
        <button
          className="btn shareIconContainer"
          onClick={(e) => onClickHandler(e, shareModalTypes.VIDEO)}
        >
          <i className={`${'shareIcon'} fa fa-video-camera`} />
        </button>
        <button
          className="btn shareIconContainer"
          onClick={(e) => onClickHandler(e, shareModalTypes.IMAGE)}
        >
          <i className={`${'shareIcon'} fa fa-image`} />
        </button>
        <button
          className="btn shareIconContainer"
          onClick={(e) => onClickHandler(e, shareModalTypes.FILE)}
        >
          <i className={`${'shareIcon'} fa fa-file`} />
        </button>
        <button
          className="btn shareIconContainer iconActive"
          onClick={(e) => onClickHandler(e, shareModalTypes.POST)}
        >
          <i className={`${'shareIcon'} fa fa-send`} />
        </button>
      </div>
    </form>
  )
}

export default FeedShare