Rev 15178 | 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 (
<>
<div id="publica-feed" className={'shareFeed'}>
<form id="form-main" name="form-main" 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={'shareIconContainer'}
onClick={(e) => onClickHandler(e, shareModalTypes.VIDEO)}
>
<i className={`${'shareIcon'} fa fa-video-camera`} />
</button>
<button
className={'shareIconContainer'}
onClick={(e) => onClickHandler(e, shareModalTypes.IMAGE)}
>
<i className={`${'shareIcon'} fa fa-image`} />
</button>
<button
className={'shareIconContainer'}
onClick={(e) => onClickHandler(e, shareModalTypes.FILE)}
>
<i className={`${'shareIcon'} fa fa-file`} />
</button>
<button
className={`${'shareIconContainer'} ${'iconActive'}`}
onClick={(e) => onClickHandler(e, shareModalTypes.POST)}
>
<i className={`${'shareIcon'} fa fa-send`} />
</button>
</div>
</form>
</div>
</>
)
}
export default FeedShare