Fixed messages not wrapping + changed some styles to accomodate scrollbar better

This commit is contained in:
t1enne
2022-09-13 08:43:59 +02:00
parent 930aef3d95
commit 0b35919357
5 changed files with 24 additions and 46 deletions

View File

@@ -164,7 +164,8 @@ export const ChatContainer: FC<ChatContainerProps> = ({
() => (
<>
<Virtuoso
style={{ height, width: 'auto' }}
style={{ height }}
className={styles.virtuoso}
ref={chatContainerRef}
initialTopMostItemIndex={messages.length - 1} // Force alignment to bottom
data={messages}
@@ -195,13 +196,7 @@ export const ChatContainer: FC<ChatContainerProps> = ({
);
return (
<div style={{ height: '100%' }}>
{
// <div className={s.chatHeader}>
// <span>stream chat</span>
// </div>
//
}
<div className={styles.chatContainer}>
{MessagesTable}
{showInput && <ChatTextField />}
</div>
@@ -210,5 +205,5 @@ export const ChatContainer: FC<ChatContainerProps> = ({
ChatContainer.defaultProps = {
showInput: true,
height: 'calc(100vh - 170px)',
height: 'auto',
};