Divide Conversation into ConversationInfos, ConversationMember, and ConversationSummary
- ConversationSummary is used to display ConversationList.
- Having the three separated will help managing queries.
- Adding ConversationSummary required to solve some inconsistencies in ConversationList, which was mixing contacts and conversations. ContactSearchResultList has been added as a quick fix . It will need more work.
- Some tools to uniformize conversation names have been introduced. They will need more work.
Note the diplaying of ConversationList is left broken in this commit.
Change-Id: I29337906cc43781a9c4790735490a6ee2cc51cb0
diff --git a/client/src/pages/ChatInterface.tsx b/client/src/pages/ChatInterface.tsx
index 00aeb3e..0db7171 100644
--- a/client/src/pages/ChatInterface.tsx
+++ b/client/src/pages/ChatInterface.tsx
@@ -31,7 +31,7 @@
const ChatInterface = () => {
const webSocket = useContext(WebSocketContext);
- const { conversationId, conversation } = useConversationContext();
+ const { conversationId } = useConversationContext();
const [messages, setMessages] = useState<Message[]>([]);
const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState(false);
@@ -105,8 +105,6 @@
return <div>Error loading {conversationId}</div>;
}
- const members = conversation.members;
-
return (
<Stack flex={1} overflow="hidden" {...getRootProps()} paddingBottom="16px">
{isDragActive && (
@@ -123,14 +121,14 @@
/>
)}
<input {...getInputProps()} />
- <MessageList members={members} messages={messages} />
+ <MessageList messages={messages} />
<Divider
sx={{
margin: '30px 16px 0px 16px',
borderTop: '1px solid #E5E5E5',
}}
/>
- <SendMessageForm members={members} onSend={sendMessage} openFilePicker={openFilePicker} />
+ <SendMessageForm onSend={sendMessage} openFilePicker={openFilePicker} />
{fileHandlers.length > 0 && <FilePreviewsList fileHandlers={fileHandlers} removeFile={removeFile} />}
</Stack>
);