Skip to content

Commit

Permalink
Re-organize chat component components
Browse files Browse the repository at this point in the history
  • Loading branch information
musale committed Jan 16, 2024
1 parent 88eabb0 commit 45444fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions packages/mgt-chat/src/components/Chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ export const Chat = ({ chatId }: IMgtChatProps) => {
<FluentThemeProvider fluentTheme={FluentTheme}>
<FluentProvider theme={webLightTheme} className={styles.fullHeight}>
<div className={styles.chat}>
<ChatHeader chatState={chatState} />
{chatState.userId && chatId && chatState.messages.length > 0 ? (
<>
<ChatHeader chatState={chatState} />
<div className={styles.chatMessages}>
<MessageThread
userId={chatState.userId}
Expand Down Expand Up @@ -153,12 +153,11 @@ export const Chat = ({ chatId }: IMgtChatProps) => {
/>
</div>
<div className={styles.chatInput}>
<SendBox onSendMessage={chatState.onSendMessage} />
<SendBox onSendMessage={chatState.onSendMessage} strings={{ placeholderText }} />
</div>
</>
) : (
<>
<ChatHeader chatState={chatState} />
{isLoading && (
<div className={styles.spinner}>
<Spinner /> <br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ detail: ${JSON.stringify(eventDetail)}`);
error(e?.message);
this.notifyStateChange((draft: GraphChatClient) => {
draft.status = 'error';
draft.activeErrorMessages = [...draft.activeErrorMessages, e];
draft.activeErrorMessages = [e];
draft.chat = { topic: 'Unknown' };
});
};
Expand Down

0 comments on commit 45444fa

Please sign in to comment.