Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 7378 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
6830 stevensc 1
import React from 'react'
6832 stevensc 2
import { openShareModal } from '../../../redux/share-modal/shareModal.actions'
3
import { shareModalTypes } from '../../../redux/share-modal/shareModal.types'
4
import { useDispatch, useSelector } from 'react-redux'
6830 stevensc 5
import CreateIcon from '@mui/icons-material/Create'
6
import ImageIcon from '@mui/icons-material/Image'
7
import SubscriptionsIcon from '@mui/icons-material/Subscriptions'
8
import ArticleIcon from '@mui/icons-material/Article'
9
import PostAddIcon from '@mui/icons-material/PostAdd'
6832 stevensc 10
 
6830 stevensc 11
import InputOption from './InputOption'
7379 stevensc 12
import { Avatar } from '@mui/material'
6830 stevensc 13
 
7378 stevensc 14
const FeedShare = ({ feedType, postUrl = '', image = '' }) => {
6832 stevensc 15
  const labels = useSelector(({ intl }) => intl.labels)
6830 stevensc 16
  const dispatch = useDispatch()
6832 stevensc 17
 
18
  const onClickHandler = (postType) => {
6830 stevensc 19
    dispatch(openShareModal(postUrl, postType, feedType))
6832 stevensc 20
  }
6830 stevensc 21
 
22
  return (
23
    <div className="feed__share">
24
      <div className="feed__input-container">
7379 stevensc 25
        <Avatar src={image} sx={{ width: '60px', height: '60px' }} />
6830 stevensc 26
        <div
27
          className="feed__input"
28
          onClick={() => onClickHandler(shareModalTypes.POST)}
29
        >
30
          <CreateIcon />
31
          <input
32
            type="text"
6832 stevensc 33
            placeholder={labels.what_are_you_thinking}
6830 stevensc 34
            readOnly
35
          />
36
        </div>
37
      </div>
38
      <div className="feed__share-options">
39
        <InputOption
40
          Icon={ImageIcon}
6832 stevensc 41
          title={labels.image}
6830 stevensc 42
          color="#7405f9"
43
          onClick={() => onClickHandler(shareModalTypes.IMAGE)}
44
          withTitle
45
        />
46
        <InputOption
47
          Icon={SubscriptionsIcon}
6832 stevensc 48
          title={labels.video}
6830 stevensc 49
          color="#E7A33E"
50
          onClick={() => onClickHandler(shareModalTypes.VIDEO)}
51
          withTitle
52
        />
53
        <InputOption
54
          Icon={ArticleIcon}
6832 stevensc 55
          title={labels.document}
6830 stevensc 56
          color="#C0C8CD"
57
          onClick={() => onClickHandler(shareModalTypes.FILE)}
58
          withTitle
59
        />
60
        <InputOption
61
          Icon={PostAddIcon}
6832 stevensc 62
          title={labels.write}
6830 stevensc 63
          color="#7FC15E"
64
          onClick={() => onClickHandler(shareModalTypes.POST)}
65
          withTitle
66
        />
67
      </div>
68
    </div>
69
  )
70
}
71
 
72
export default FeedShare