Skip to content

Commit

Permalink
refactor: message input
Browse files Browse the repository at this point in the history
  • Loading branch information
OysterD3 committed Mar 1, 2024
1 parent c9a492b commit 63664bf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/components/ChatRoom/MessageInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,19 @@ const MessageInput = () => {
<div className={bem()}>
<Textarea
ref={inputRef}
placeholder="Type a message..."
onKeyDown={(e) => {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
handleSendMessage();
}
}}
/>
<Button type="submit" onClick={handleSendMessage}>
Send
</Button>
<div className={bem('actions')}>
<Button size="sm" type="submit" onClick={handleSendMessage}>
Send
</Button>
</div>
</div>
);
};
Expand Down
10 changes: 9 additions & 1 deletion src/styles/components/message-input.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
.smartify-message-input {
@apply flex gap-2;
@apply flex flex-col gap-2 border-t;

.smartify-textarea {
@apply border-none focus-visible:ring-0;
}

&__actions {
@apply flex items-center gap-2 justify-end p-2;
}
}

0 comments on commit 63664bf

Please sign in to comment.