Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 5338 | Rev 5925 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 5338 Rev 5923
Línea 13... Línea 13...
13
    if (message.type === 'group' && !message.u === 1) return message.user_name
13
    if (message.type === 'group' && !message.u === 1) return message.user_name
14
  }
14
  }
Línea 15... Línea 15...
15
 
15
 
16
  const handleCopy = async () => {
16
  const handleCopy = async () => {
-
 
17
    await navigator.clipboard.writeText(`${message.m}`)
-
 
18
    dispatch(
-
 
19
      addNotification({
17
    await navigator.clipboard.writeText(`${message.m}`)
20
        style: 'success',
-
 
21
        msg: 'Mensaje copiado en el portapapeles',
-
 
22
      })
18
    dispatch(addNotification({ style: 'success', msg: 'Mensaje copiado en el portapapeles' }))
23
    )
Línea 19... Línea 24...
19
  }
24
  }
Línea 20... Línea 25...
20
 
25
 
Línea 21... Línea 26...
21
  const likeMessage = () => setIsLiked(!isLiked)
26
  const likeMessage = () => setIsLiked(!isLiked)
22
 
27
 
23
  const handleResponse = (msg) => setResponseMessage(msg)
28
  const handleResponse = (msg) => setResponseMessage(msg)
24
 
29
 
-
 
30
  const messagesContent = {
-
 
31
    text: <p>{parse(emojione.shortnameToImage(message.m))}</p>,
-
 
32
    image: <img src={message.m} alt="chat_image" />,
25
  const messagesContent = {
33
    video: <video src={message.m} preload="none" controls />,
-
 
34
    document: (
-
 
35
      <img
-
 
36
        className="pdf"
26
    text: <p>{parse(emojione.shortnameToImage(message.m))}</p>,
37
        src="/storage/type/default/filename/pdf.png"
Línea 27... Línea 38...
27
    image: <img src={message.m} alt="chat_image" />,
38
        alt="pdf"
-
 
39
      />
-
 
40
    ),
28
    video: <video src={message.m} preload="none" controls></video>,
41
  }
-
 
42
 
-
 
43
  return (
29
    document: <img className="pdf" src="/storage/type/default/filename/pdf.png" alt="pdf"/>
44
    <div
30
  }
45
      className={`message ${
31
 
46
        message.u === 1 ? 'message_sent' : 'message_received'
32
  return (
47
      }`}
33
        <div className={`conversation-text ${message.u === 1 && 'odd'}`}>
-
 
34
            <div className="ctext-wrap">
48
    >
35
                {senderName(message)}
-
 
36
                {messagesContent[message.mtype]}
-
 
37
                <label>
49
      <div className="messageContainer">
38
                    {!message.not_received && <i className='fa fa-check' style={message.seen ? { color: 'blue' } : { color: 'gray' }} />}
-
 
39
                    {message.time}
50
        <span className="userName">{senderName(message)}</span>
40
                </label>
-
 
41
                {isLiked && <i className="fas fa-heart" style={{ color: '#0961bf', position: 'absolute', top: '87%', left: '85%' }} />}
51
        {messagesContent[message.mtype]}
42
            </div>
-
 
43
            <Message.Reactions
52
        <label>
-
 
53
          {!message.not_received && (
-
 
54
            <i
-
 
55
              className="fa fa-check"
-
 
56
              style={message.seen ? { color: 'blue' } : { color: 'gray' }}
-
 
57
            />
-
 
58
          )}
-
 
59
          {message.time}
-
 
60
        </label>
-
 
61
        <span className={'message__time'}>{message.time}</span>
-
 
62
        {isLiked && (
-
 
63
          <i
-
 
64
            className="fas fa-heart"
-
 
65
            style={{
-
 
66
              color: '#0961bf',
-
 
67
              position: 'absolute',
44
                message={message}
68
              top: '87%',
-
 
69
              left: '85%',
-
 
70
            }}
-
 
71
          />
-
 
72
        )}
-
 
73
      </div>
-
 
74
      <Message.Reactions
-
 
75
        message={message}
45
                onLike={likeMessage}
76
        onLike={likeMessage}
46
                onResponse={handleResponse}
77
        onResponse={handleResponse}
Línea 47... Línea 78...
47
                onClipboard={handleCopy}
78
        onClipboard={handleCopy}
48
            />
79
      />
49
        </div>
80
    </div>
50
  )
81
  )
51
}
82
}
52
 
83
 
53
const Reactions = ({
84
const Reactions = ({
Línea 54... Línea 85...
54
  message = {},
85
  message = {},
55
  onLike = () => false,
86
  onLike = () => false,
56
  onResponse = () => false,
87
  onResponse = () => false,
57
  onClipboard = () => false
88
  onClipboard = () => false,
58
}) => {
89
}) => {
59
  const [isShow, setIsShow] = useState(false)
90
  const [isShow, setIsShow] = useState(false)
60
 
91
 
61
  return (
92
  return (
62
        <>
93
    <>
63
            <i className="la la-ellipsis-v icon" onClick={() => setIsShow(!isShow)}/>
94
      <i className="la la-ellipsis-v icon" onClick={() => setIsShow(!isShow)} />
64
            {isShow &&
95
      {isShow && (
65
                <div className="display-reactions" >
96
        <div className="display-reactions">
66
                    <LikeButton onClick={onLike} />
97
          <LikeButton onClick={onLike} />
-
 
98
          <button onClick={() => onResponse(message)}>
67
                    <button onClick={() => onResponse(message)}>
99
            <i className="fa fa-reply" />
68
                        <i className="fa fa-reply" />
100
          </button>
69
                    </button>
101
          <button onClick={() => onClipboard(message)}>
Línea 70... Línea 102...
70
                    <button onClick={() => onClipboard(message)}>
102
            <i className="fa fa-copy" />