From b6aa20b0aa029c64c556c0fcfb09f6648e0b5a1d Mon Sep 17 00:00:00 2001 From: t1enne Date: Tue, 17 May 2022 16:36:07 +0200 Subject: [PATCH] worked on chat styling --- web/components/chat/ChatContainer.tsx | 1 - .../ChatTextField/ChatTextField.module.scss | 12 ++++++++-- .../chat/ChatTextField/ChatTextField.tsx | 23 +++++++++++++++---- web/components/ui/Sidebar/Sidebar.module.scss | 21 +++++++++++++++-- web/components/ui/Sidebar/Sidebar.tsx | 11 +++++---- web/styles/variables.css | 2 +- 6 files changed, 56 insertions(+), 14 deletions(-) diff --git a/web/components/chat/ChatContainer.tsx b/web/components/chat/ChatContainer.tsx index 7c23f34c7..030c97125 100644 --- a/web/components/chat/ChatContainer.tsx +++ b/web/components/chat/ChatContainer.tsx @@ -30,7 +30,6 @@ export default function ChatContainer(props: Props) { return (
-

Chat

p { + margin: 0px; + } + } } diff --git a/web/components/chat/ChatTextField/ChatTextField.tsx b/web/components/chat/ChatTextField/ChatTextField.tsx index 1989c35ce..8c7d9702f 100644 --- a/web/components/chat/ChatTextField/ChatTextField.tsx +++ b/web/components/chat/ChatTextField/ChatTextField.tsx @@ -8,8 +8,9 @@ import EmojiPicker from './EmojiPicker'; import WebsocketService from '../../../services/websocket-service'; import { websocketServiceAtom } from '../../stores/ClientConfigStore'; import { MessageType } from '../../../interfaces/socket-events'; +import s from './ChatTextField.module.scss'; -type CustomElement = { type: 'paragraph'; children: CustomText[] }; +type CustomElement = { type: 'paragraph' | 'span'; children: CustomText[] }; type CustomText = { text: string }; declare module 'slate' { @@ -103,6 +104,16 @@ export default function ChatTextField(props: Props) { const [editor] = useState(() => withImages(withReact(createEditor()))); const size = 'small'; + const EMPTY_VALUE = [ + { + type: 'paragraph', + children: [ + { + text: '', + }, + ], + }, + ]; const sendMessage = () => { if (!websocketService) { @@ -142,12 +153,16 @@ export default function ChatTextField(props: Props) { }; return ( -
- +
+ } - placeholder="Chat message goes here..." + // placeholder="Chat message goes here..." />