Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1189 Rev 1191
Línea 1... Línea 1...
1
import React from "react";
1
import React, { useState } from "react";
2
import parse from "html-react-parser";
2
import parse from "html-react-parser";
3
import styled from "styled-components";
3
import styled from "styled-components";
-
 
4
import LikeButton from "../like-button/LikeButton";
Línea 4... Línea 5...
4
 
5
 
5
const StyledChatImgMessage = styled.div`
6
const StyledChatImgMessage = styled.div`
6
  display: flex;
7
  display: flex;
7
  justify-content: center;
8
  justify-content: center;
Línea 29... Línea 30...
29
    }
30
    }
30
  }
31
  }
31
`;
32
`;
Línea 32... Línea 33...
32
 
33
 
-
 
34
const MessageTemplate = ({ message }) => {
-
 
35
 
33
const MessageTemplate = ({ message }) => {
36
  const [isShow, setIsShow] = useState(false);
34
  const senderName = (message) => {
37
  const senderName = (message) => {
35
    if (message.type === "group") {
38
    if (message.type === "group") {
36
      return message.u === 1 ? "" : message.user_name;
39
      return message.u === 1 ? "" : message.user_name;
37
    }
40
    }
-
 
41
  };
38
  };
42
 
39
  switch (message.mtype) {
43
  switch (message.mtype) {
40
    case "text":
44
    case "text":
41
      return (
45
      return (
42
        <li
46
        <li
Línea 56... Línea 60...
56
                {parse(emojione.shortnameToImage(message.m))}
60
                {parse(emojione.shortnameToImage(message.m))}
57
                <br />
61
                <br />
58
                <i className="text-right">{message.time}</i>
62
                <i className="text-right">{message.time}</i>
59
              </p>
63
              </p>
60
            </div>
64
            </div>
-
 
65
            <i
61
            <i className="la la-ellipsis-v icon"></i>
66
              className="la la-ellipsis-v icon"
-
 
67
              style={{ position: 'relative' }}
-
 
68
              onClick={() => setIsShow(!isShow)}
-
 
69
            >
-
 
70
              {
-
 
71
                isShow
-
 
72
                &&
-
 
73
                <div
-
 
74
                  style={{ position: "absolute", top: '-100%', left: '0', width: '2rem', height: '2rem', display: 'grid', placeItems: 'center' }}
-
 
75
                >
-
 
76
                  <LikeButton />
-
 
77
                </div>
-
 
78
              }
-
 
79
            </i>
62
          </div>
80
          </div>
63
        </li>
81
        </li>
64
      );
82
      );
65
    case "image":
83
    case "image":
66
      return (
84
      return (