mirror of
https://github.com/hubHarmony/servii-frontend.git
synced 2024-11-17 21:40:30 +00:00
Server console send key
This commit is contained in:
parent
4ec70e510e
commit
f52930bce4
@ -65,6 +65,12 @@ const ServerConsole = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleKeyPress = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
handleSendMessage();
|
||||
}
|
||||
};
|
||||
|
||||
if (loading) {
|
||||
return <Loading />;
|
||||
@ -108,6 +114,7 @@ const ServerConsole = () => {
|
||||
className={styles.chatInput}
|
||||
value={message}
|
||||
onChange={(e) => setMessage(e.target.value)}
|
||||
onKeyPress={handleKeyPress}
|
||||
placeholder="Écrire un message..."
|
||||
/>
|
||||
<button className={styles.sendButton} onClick={handleSendMessage}>
|
||||
|
Loading…
Reference in New Issue
Block a user