| 6830 |
stevensc |
1 |
/* eslint-disable react/prop-types */
|
|
|
2 |
import React from 'react'
|
|
|
3 |
import CreateIcon from '@mui/icons-material/Create'
|
|
|
4 |
import ImageIcon from '@mui/icons-material/Image'
|
|
|
5 |
import SubscriptionsIcon from '@mui/icons-material/Subscriptions'
|
|
|
6 |
import ArticleIcon from '@mui/icons-material/Article'
|
|
|
7 |
import PostAddIcon from '@mui/icons-material/PostAdd'
|
|
|
8 |
import InputOption from './InputOption'
|
|
|
9 |
import { useDispatch } from 'react-redux'
|
|
|
10 |
import { openShareModal } from '../../../../redux/share-modal/shareModal.actions'
|
|
|
11 |
import { shareModalTypes } from '../../../../redux/share-modal/shareModal.types'
|
|
|
12 |
import Avatar from '../../../../shared/Avatar/Avatar'
|
|
|
13 |
|
|
|
14 |
const FeedShare = ({ feedType, postUrl, image }) => {
|
|
|
15 |
const dispatch = useDispatch()
|
|
|
16 |
const onClickHandler = (postType) =>
|
|
|
17 |
dispatch(openShareModal(postUrl, postType, feedType))
|
|
|
18 |
|
|
|
19 |
return (
|
|
|
20 |
<div className="feed__share">
|
|
|
21 |
<div className="feed__input-container">
|
|
|
22 |
<Avatar imageUrl={image} size="xl" />
|
|
|
23 |
<div
|
|
|
24 |
className="feed__input"
|
|
|
25 |
onClick={() => onClickHandler(shareModalTypes.POST)}
|
|
|
26 |
>
|
|
|
27 |
<CreateIcon />
|
|
|
28 |
<input
|
|
|
29 |
type="text"
|
|
|
30 |
placeholder={LABELS.WHAT_ARE_YOU_THINKING}
|
|
|
31 |
readOnly
|
|
|
32 |
/>
|
|
|
33 |
</div>
|
|
|
34 |
</div>
|
|
|
35 |
<div className="feed__share-options">
|
|
|
36 |
<InputOption
|
|
|
37 |
Icon={ImageIcon}
|
|
|
38 |
title={LABELS.IMAGE}
|
|
|
39 |
color="#7405f9"
|
|
|
40 |
onClick={() => onClickHandler(shareModalTypes.IMAGE)}
|
|
|
41 |
withTitle
|
|
|
42 |
/>
|
|
|
43 |
<InputOption
|
|
|
44 |
Icon={SubscriptionsIcon}
|
|
|
45 |
title={LABELS.VIDEO}
|
|
|
46 |
color="#E7A33E"
|
|
|
47 |
onClick={() => onClickHandler(shareModalTypes.VIDEO)}
|
|
|
48 |
withTitle
|
|
|
49 |
/>
|
|
|
50 |
<InputOption
|
|
|
51 |
Icon={ArticleIcon}
|
|
|
52 |
title={LABELS.DOCUMENT}
|
|
|
53 |
color="#C0C8CD"
|
|
|
54 |
onClick={() => onClickHandler(shareModalTypes.FILE)}
|
|
|
55 |
withTitle
|
|
|
56 |
/>
|
|
|
57 |
<InputOption
|
|
|
58 |
Icon={PostAddIcon}
|
|
|
59 |
title={LABELS.WRITE}
|
|
|
60 |
color="#7FC15E"
|
|
|
61 |
onClick={() => onClickHandler(shareModalTypes.POST)}
|
|
|
62 |
withTitle
|
|
|
63 |
/>
|
|
|
64 |
</div>
|
|
|
65 |
</div>
|
|
|
66 |
)
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
export default FeedShare
|