Browse Source

Fix empty state for text field

pull/2032/head
Gabe Kangas 3 years ago
parent
commit
0d5d89a1c8
No known key found for this signature in database
GPG Key ID: 9A56337728BC81EA
  1. 16
      web/components/chat/ChatTextField/ChatTextField.tsx
  2. 4
      web/components/ui/Sidebar/Sidebar.tsx

16
web/components/chat/ChatTextField/ChatTextField.tsx

@ -104,16 +104,6 @@ export default function ChatTextField(props: Props) { @@ -104,16 +104,6 @@ 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) {
@ -154,11 +144,7 @@ export default function ChatTextField(props: Props) { @@ -154,11 +144,7 @@ export default function ChatTextField(props: Props) {
return (
<div className={s.root}>
<Slate
editor={editor}
value={[{ type: 'span', children: [{ text: 'hey' }] }]}
onChange={handleChange}
>
<Slate editor={editor} value={[]} onChange={handleChange}>
<Editable
onKeyDown={onKeyDown}
renderElement={p => <Element {...p} />}

4
web/components/ui/Sidebar/Sidebar.tsx

@ -26,8 +26,8 @@ export default function Sidebar() { @@ -26,8 +26,8 @@ export default function Sidebar() {
<div className={s.chatHeader}>
<span>stream chat</span>
</div>
<ChatContainer messages={messages} state={chatState} />
<ChatTextField />
<ChatContainer messages={messages} state={chatState} />
<ChatTextField />
</Sider>
);
}

Loading…
Cancel
Save