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/Messenger.tsx b/client/src/pages/Messenger.tsx
index 294e069..f498625 100644
--- a/client/src/pages/Messenger.tsx
+++ b/client/src/pages/Messenger.tsx
@@ -16,32 +16,19 @@
* <https://www.gnu.org/licenses/>.
*/
import { Box, Stack } from '@mui/material';
-import { ReactNode, useContext } from 'react';
+import { ReactNode } from 'react';
-//import Sound from 'react-sound';
import ConversationList from '../components/ConversationList';
import Header from '../components/Header';
-import LoadingPage from '../components/Loading';
import NewContactForm from '../components/NewContactForm';
-import { MessengerContext } from '../contexts/MessengerProvider';
-import AddContactPage from './AddContactPage';
const Messenger = ({ children }: { children?: ReactNode }) => {
- const { newContactId, conversations } = useContext(MessengerContext);
-
return (
<Box display="flex" height="100%">
<Stack flexGrow={0} flexShrink={0} overflow="auto">
<Header />
<NewContactForm />
- {newContactId && <AddContactPage contactId={newContactId} />}
- {conversations ? (
- <ConversationList conversations={conversations} />
- ) : (
- <div className="rooms-list">
- <LoadingPage />
- </div>
- )}
+ <ConversationList />
</Stack>
<Box flexGrow={1} display="flex" position="relative">
{children}