Added sender to messages sent IO-590
This commit is contained in:
@@ -8,6 +8,8 @@ import {
|
||||
List,
|
||||
} from "react-virtualized";
|
||||
import "./chat-message-list.styles.scss";
|
||||
import i18n from "i18next";
|
||||
import moment from "moment";
|
||||
|
||||
export default function ChatMessageListComponent({ messages }) {
|
||||
const virtualizedListRef = useRef(null);
|
||||
@@ -79,7 +81,19 @@ const MessageRender = (message) => {
|
||||
</a>
|
||||
);
|
||||
} else {
|
||||
return <span>{message.text}</span>;
|
||||
return (
|
||||
<div>
|
||||
<div>{message.text}</div>
|
||||
{message.isoutbound && (
|
||||
<div style={{ color: "slategray", fontSize: 10 }}>
|
||||
{i18n.t("messaging.labels.sentby", {
|
||||
by: message.userid,
|
||||
time: moment(message.created_at).format("MM/DD/YYYY @ hh:mm a"),
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -39,6 +39,8 @@ export const CONVERSATION_SUBSCRIPTION_BY_PK = gql`
|
||||
isoutbound
|
||||
image
|
||||
image_path
|
||||
userid
|
||||
created_at
|
||||
}
|
||||
messages_aggregate(
|
||||
where: { read: { _eq: false }, isoutbound: { _eq: false } }
|
||||
|
||||
@@ -1315,6 +1315,7 @@
|
||||
"nojobs": "Not associated to any job.",
|
||||
"phonenumber": "Phone #",
|
||||
"presets": "Presets",
|
||||
"sentby": "Sent by {{by}} at {{time}}",
|
||||
"typeamessage": "Send a message..."
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1315,6 +1315,7 @@
|
||||
"nojobs": "",
|
||||
"phonenumber": "",
|
||||
"presets": "",
|
||||
"sentby": "",
|
||||
"typeamessage": "Enviar un mensaje..."
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1315,6 +1315,7 @@
|
||||
"nojobs": "",
|
||||
"phonenumber": "",
|
||||
"presets": "",
|
||||
"sentby": "",
|
||||
"typeamessage": "Envoyer un message..."
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user