| 6515 |
stevensc |
1 |
/* eslint-disable react/prop-types */
|
|
|
2 |
import React from 'react'
|
|
|
3 |
import { useDispatch, useSelector } from 'react-redux'
|
|
|
4 |
import { openShareModal } from '../../../redux/share-modal/shareModal.actions'
|
|
|
5 |
import { shareModalTypes } from '../../../redux/share-modal/shareModal.types'
|
|
|
6 |
import VideocamOutlinedIcon from '@mui/icons-material/VideocamOutlined'
|
|
|
7 |
import ImageOutlinedIcon from '@mui/icons-material/ImageOutlined'
|
|
|
8 |
import PostAddOutlinedIcon from '@mui/icons-material/PostAddOutlined'
|
|
|
9 |
import SendOutlinedIcon from '@mui/icons-material/SendOutlined'
|
|
|
10 |
|
|
|
11 |
const ShareFeed = ({
|
|
|
12 |
feedType,
|
|
|
13 |
postUrl,
|
|
|
14 |
image
|
|
|
15 |
}) => {
|
|
|
16 |
const dispatch = useDispatch()
|
|
|
17 |
const { WHAT_ARE_YOU_THINKING } = useSelector(state => state.labels)
|
|
|
18 |
|
|
|
19 |
const onClickHandler = (postType) => dispatch(openShareModal(postUrl, postType, feedType))
|
|
|
20 |
|
|
|
21 |
return (
|
|
|
22 |
<div className='share-feed'>
|
|
|
23 |
<div className='share_form-container'>
|
|
|
24 |
<img src={image} alt="User image profile" loading="lazy" />
|
|
|
25 |
<input
|
|
|
26 |
placeholder={WHAT_ARE_YOU_THINKING}
|
|
|
27 |
readOnly
|
|
|
28 |
onClick={() => onClickHandler(shareModalTypes.POST)}
|
|
|
29 |
/>
|
|
|
30 |
<div className='share_icons-container'>
|
|
|
31 |
<button
|
|
|
32 |
className='share-icon'
|
|
|
33 |
onClick={() => onClickHandler(shareModalTypes.VIDEO)}
|
|
|
34 |
>
|
|
|
35 |
<VideocamOutlinedIcon />
|
|
|
36 |
</button>
|
|
|
37 |
<button
|
|
|
38 |
className='share-icon'
|
|
|
39 |
onClick={() => onClickHandler(shareModalTypes.IMAGE)}
|
|
|
40 |
>
|
|
|
41 |
<ImageOutlinedIcon />
|
|
|
42 |
</button>
|
|
|
43 |
<button
|
|
|
44 |
className='share-icon'
|
|
|
45 |
onClick={() => onClickHandler(shareModalTypes.FILE)}
|
|
|
46 |
>
|
|
|
47 |
<PostAddOutlinedIcon />
|
|
|
48 |
</button>
|
|
|
49 |
<button
|
|
|
50 |
className='share-icon active'
|
|
|
51 |
onClick={() => onClickHandler(shareModalTypes.POST)}
|
|
|
52 |
>
|
|
|
53 |
<SendOutlinedIcon />
|
|
|
54 |
</button>
|
|
|
55 |
</div>
|
|
|
56 |
</div>
|
|
|
57 |
</div>
|
|
|
58 |
)
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
export default ShareFeed
|