Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 5899 | Rev 5910 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
4265 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'
5107 stevensc 6
import ArticleIcon from '@mui/icons-material/Article'
7
import PostAddIcon from '@mui/icons-material/PostAdd'
4265 stevensc 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'
5107 stevensc 12
import Avatar from '../../../../shared/Avatar/Avatar'
4265 stevensc 13
 
5899 stevensc 14
const FeedShare = ({ feedType, postUrl, image }) => {
4265 stevensc 15
  const dispatch = useDispatch()
5899 stevensc 16
  const onClickHandler = (postType) =>
17
    dispatch(openShareModal(postUrl, postType, feedType))
4265 stevensc 18
 
19
  return (
5899 stevensc 20
    <div className="feed__share">
4284 stevensc 21
      <div className="feed__input-container">
5899 stevensc 22
        <Avatar imageUrl={image} size="xl" />
23
        <div
24
          className="feed__input"
25
          onClick={() => onClickHandler(shareModalTypes.POST)}
26
        >
4284 stevensc 27
          <CreateIcon />
5899 stevensc 28
          <input type="text" placeholder={LABELS.WRITE} readOnly />
4284 stevensc 29
        </div>
4265 stevensc 30
      </div>
5899 stevensc 31
      <div className="feed__share-options">
32
        <InputOption
33
          Icon={ImageIcon}
34
          title={LABELS.IMAGE}
35
          color="#7405f9"
36
          onClick={() => onClickHandler(shareModalTypes.IMAGE)}
5908 stevensc 37
          withTitle
5899 stevensc 38
        />
39
        <InputOption
40
          Icon={SubscriptionsIcon}
41
          title={LABELS.VIDEO}
42
          color="#E7A33E"
43
          onClick={() => onClickHandler(shareModalTypes.VIDEO)}
5908 stevensc 44
          withTitle
5899 stevensc 45
        />
46
        <InputOption
47
          Icon={ArticleIcon}
48
          title={LABELS.DOCUMENT}
49
          color="#C0C8CD"
50
          onClick={() => onClickHandler(shareModalTypes.FILE)}
5908 stevensc 51
          withTitle
5899 stevensc 52
        />
53
        <InputOption
54
          Icon={PostAddIcon}
55
          title={LABELS.WRITE_A_POST}
56
          color="#7FC15E"
57
          onClick={() => onClickHandler(shareModalTypes.POST)}
5908 stevensc 58
          withTitle
5899 stevensc 59
        />
4265 stevensc 60
      </div>
61
    </div>
62
  )
63
}
64
 
65
export default FeedShare