Few changes to Chat input
This commit is contained in:
@@ -1,8 +1,13 @@
|
|||||||
.root {
|
.root {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0px;
|
||||||
|
width: 100%;
|
||||||
padding: .3rem;
|
padding: .3rem;
|
||||||
color: var(--text-secondry);
|
color: var(--text-secondry);
|
||||||
|
overflow-x: hidden;
|
||||||
div[role=textbox] {
|
div[role=textbox] {
|
||||||
padding: .6rem;
|
padding: .6rem;
|
||||||
|
padding-right: calc(0.6rem + 44px);
|
||||||
border-radius: .35rem;
|
border-radius: .35rem;
|
||||||
background-color: var(--color-owncast-gray-700);
|
background-color: var(--color-owncast-gray-700);
|
||||||
& > p {
|
& > p {
|
||||||
@@ -10,3 +15,22 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.inputWrapper {
|
||||||
|
display: flex;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.emojiButton {
|
||||||
|
border: none;
|
||||||
|
margin-right: 5px;
|
||||||
|
position: absolute;
|
||||||
|
right: 0px;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.submitButtonWrapper {
|
||||||
|
display: flex;
|
||||||
|
padding: 6px 0;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|||||||
@@ -144,25 +144,34 @@ export default function ChatTextField(props: Props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={s.root}>
|
<div className={s.root}>
|
||||||
<Slate
|
<div className={s.inputWrapper}>
|
||||||
editor={editor}
|
<Slate
|
||||||
value={[{ type: 'paragraph', children: [{ text: '' }] }]}
|
editor={editor}
|
||||||
onChange={handleChange}
|
value={[{ type: 'paragraph', children: [{ text: '' }] }]}
|
||||||
>
|
onChange={handleChange}
|
||||||
<Editable
|
>
|
||||||
onKeyDown={onKeyDown}
|
<Editable
|
||||||
renderElement={p => <Element {...p} />}
|
onKeyDown={onKeyDown}
|
||||||
// placeholder="Chat message goes here..."
|
renderElement={p => <Element {...p} />}
|
||||||
/>
|
placeholder="Chat message goes here..."
|
||||||
</Slate>
|
style={{ width: '100%' }}
|
||||||
<Button type="default" ghost title="Emoji" onClick={() => setShowEmojis(!showEmojis)}>
|
/>
|
||||||
<SmileOutlined style={{ color: 'rgba(0,0,0,.45)' }} />
|
</Slate>
|
||||||
</Button>
|
<Button
|
||||||
|
className={s.emojiButton}
|
||||||
<Button size={size} type="primary" onClick={sendMessage}>
|
type="default"
|
||||||
Submit
|
ghost
|
||||||
</Button>
|
title="Emoji"
|
||||||
|
onClick={() => setShowEmojis(!showEmojis)}
|
||||||
|
>
|
||||||
|
<SmileOutlined />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<div className={s.submitButtonWrapper}>
|
||||||
|
<Button size={size} type="primary" onClick={sendMessage}>
|
||||||
|
Submit
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
<Popover
|
<Popover
|
||||||
content={<EmojiPicker onEmojiSelect={handleEmojiSelect} />}
|
content={<EmojiPicker onEmojiSelect={handleEmojiSelect} />}
|
||||||
trigger="click"
|
trigger="click"
|
||||||
|
|||||||
Reference in New Issue
Block a user