From 44ef64b3b5081bfbd950d7fe1a2936f2b606304f Mon Sep 17 00:00:00 2001 From: t1enne Date: Fri, 30 Sep 2022 13:17:22 +0200 Subject: [PATCH] fixed chat container not showing in SB + minor changes --- .../ChatContainer/ChatContainer.module.scss | 11 ++- .../ChatContainer/ChatContainer.stories.tsx | 20 +++--- .../chat/ChatContainer/ChatContainer.tsx | 21 +----- .../ChatTextField/ChatTextField.module.scss | 2 + .../chat/ChatTextField/ChatTextField.tsx | 71 +++++++++---------- 5 files changed, 58 insertions(+), 67 deletions(-) diff --git a/web/components/chat/ChatContainer/ChatContainer.module.scss b/web/components/chat/ChatContainer/ChatContainer.module.scss index 3cf57fecf..44312d66e 100644 --- a/web/components/chat/ChatContainer/ChatContainer.module.scss +++ b/web/components/chat/ChatContainer/ChatContainer.module.scss @@ -9,11 +9,17 @@ .toBottomWrap { display: flex; - opacity: 0.9; width: 100%; justify-content: center; position: absolute; - bottom: 75px; + bottom: 50px; + color: var(--text-color-secondary); + & .toBottomWrap { + & .toBottomBtn { + border: none; + background-color: gray; + } + } } .nameChangeView { @@ -36,6 +42,7 @@ .chatContainer { display: grid; grid-template-rows: 1fr 65px; + background-color: var(--theme-color-background-chat); height: 100%; } .virtuoso { diff --git a/web/components/chat/ChatContainer/ChatContainer.stories.tsx b/web/components/chat/ChatContainer/ChatContainer.stories.tsx index d8f5026bc..b0686eded 100644 --- a/web/components/chat/ChatContainer/ChatContainer.stories.tsx +++ b/web/components/chat/ChatContainer/ChatContainer.stories.tsx @@ -30,15 +30,17 @@ const AddMessagesChatExample = args => { return ( - - +
+ + +
); }; diff --git a/web/components/chat/ChatContainer/ChatContainer.tsx b/web/components/chat/ChatContainer/ChatContainer.tsx index f9f71b620..2a7c045fb 100644 --- a/web/components/chat/ChatContainer/ChatContainer.tsx +++ b/web/components/chat/ChatContainer/ChatContainer.tsx @@ -1,7 +1,6 @@ -import { Button } from 'antd'; import { Virtuoso } from 'react-virtuoso'; import { useState, useMemo, useRef, CSSProperties, FC } from 'react'; -import { EditFilled, VerticalAlignBottomOutlined } from '@ant-design/icons'; +import { EditFilled } from '@ant-design/icons'; import { ConnectedClientInfoEvent, MessageType, @@ -15,6 +14,7 @@ import { ChatModeratorNotification } from '../ChatModeratorNotification/ChatMode // import ChatActionMessage from '../ChatAction/ChatActionMessage'; import { ChatSystemMessage } from '../ChatSystemMessage/ChatSystemMessage'; import { ChatJoinMessage } from '../ChatJoinMessage/ChatJoinMessage'; +import { ScrollToBotBtn } from './ScrollToBotBtn'; export type ChatContainerProps = { messages: ChatMessage[]; @@ -176,22 +176,7 @@ export const ChatContainer: FC = ({ alignToBottom atBottomStateChange={bottom => setAtBottom(bottom)} /> - {!atBottom && ( -
- -
- )} + {!atBottom && } ), [messages, usernameToHighlight, chatUserId, isModerator, atBottom], diff --git a/web/components/chat/ChatTextField/ChatTextField.module.scss b/web/components/chat/ChatTextField/ChatTextField.module.scss index 81cc06f1e..b0fae308d 100644 --- a/web/components/chat/ChatTextField/ChatTextField.module.scss +++ b/web/components/chat/ChatTextField/ChatTextField.module.scss @@ -5,6 +5,8 @@ width: 100%; padding: 0.3rem; color: var(--theme-color-components-form-field-text); + border-radius: var(--theme-rounded-corners); + outline: 1px solid gray; overflow-x: hidden; div[role='textbox'] { diff --git a/web/components/chat/ChatTextField/ChatTextField.tsx b/web/components/chat/ChatTextField/ChatTextField.tsx index e672281bf..0bfc1a22a 100644 --- a/web/components/chat/ChatTextField/ChatTextField.tsx +++ b/web/components/chat/ChatTextField/ChatTextField.tsx @@ -197,45 +197,40 @@ export const ChatTextField: FC = () => { }; return ( -
-
- - - - } - trigger="click" - onVisibleChange={visible => setShowEmojis(visible)} - visible={showEmojis} - /> - - - - +
); };