Rev 7378 | AutorÃa | Comparar con el anterior | Ultima modificación | Ver Log |
import React from 'react'
import { openShareModal } from '../../../redux/share-modal/shareModal.actions'
import { shareModalTypes } from '../../../redux/share-modal/shareModal.types'
import { useDispatch, useSelector } from 'react-redux'
import CreateIcon from '@mui/icons-material/Create'
import ImageIcon from '@mui/icons-material/Image'
import SubscriptionsIcon from '@mui/icons-material/Subscriptions'
import ArticleIcon from '@mui/icons-material/Article'
import PostAddIcon from '@mui/icons-material/PostAdd'
import InputOption from './InputOption'
import { Avatar } from '@mui/material'
const FeedShare = ({ feedType, postUrl = '', image = '' }) => {
const labels = useSelector(({ intl }) => intl.labels)
const dispatch = useDispatch()
const onClickHandler = (postType) => {
dispatch(openShareModal(postUrl, postType, feedType))
}
return (
<div className="feed__share">
<div className="feed__input-container">
<Avatar src={image} sx={{ width: '60px', height: '60px' }} />
<div
className="feed__input"
onClick={() => onClickHandler(shareModalTypes.POST)}
>
<CreateIcon />
<input
type="text"
placeholder={labels.what_are_you_thinking}
readOnly
/>
</div>
</div>
<div className="feed__share-options">
<InputOption
Icon={ImageIcon}
title={labels.image}
color="#7405f9"
onClick={() => onClickHandler(shareModalTypes.IMAGE)}
withTitle
/>
<InputOption
Icon={SubscriptionsIcon}
title={labels.video}
color="#E7A33E"
onClick={() => onClickHandler(shareModalTypes.VIDEO)}
withTitle
/>
<InputOption
Icon={ArticleIcon}
title={labels.document}
color="#C0C8CD"
onClick={() => onClickHandler(shareModalTypes.FILE)}
withTitle
/>
<InputOption
Icon={PostAddIcon}
title={labels.write}
color="#7FC15E"
onClick={() => onClickHandler(shareModalTypes.POST)}
withTitle
/>
</div>
</div>
)
}
export default FeedShare