Added sender to messages sent IO-590

This commit is contained in:
Patrick Fic
2021-02-19 11:38:23 -08:00
parent 95ad458795
commit b152dd042f
20 changed files with 248 additions and 12 deletions

View File

@@ -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>
);
}
};

View File

@@ -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 } }

View File

@@ -1315,6 +1315,7 @@
"nojobs": "Not associated to any job.",
"phonenumber": "Phone #",
"presets": "Presets",
"sentby": "Sent by {{by}} at {{time}}",
"typeamessage": "Send a message..."
}
},

View File

@@ -1315,6 +1315,7 @@
"nojobs": "",
"phonenumber": "",
"presets": "",
"sentby": "",
"typeamessage": "Enviar un mensaje..."
}
},

View File

@@ -1315,6 +1315,7 @@
"nojobs": "",
"phonenumber": "",
"presets": "",
"sentby": "",
"typeamessage": "Envoyer un message..."
}
},