mirror of
https://github.com/hubHarmony/servii-frontend.git
synced 2024-11-18 05:40:31 +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) {
|
if (loading) {
|
||||||
return <Loading />;
|
return <Loading />;
|
||||||
@ -108,6 +114,7 @@ const ServerConsole = () => {
|
|||||||
className={styles.chatInput}
|
className={styles.chatInput}
|
||||||
value={message}
|
value={message}
|
||||||
onChange={(e) => setMessage(e.target.value)}
|
onChange={(e) => setMessage(e.target.value)}
|
||||||
|
onKeyPress={handleKeyPress}
|
||||||
placeholder="Écrire un message..."
|
placeholder="Écrire un message..."
|
||||||
/>
|
/>
|
||||||
<button className={styles.sendButton} onClick={handleSendMessage}>
|
<button className={styles.sendButton} onClick={handleSendMessage}>
|
||||||
|
Loading…
Reference in New Issue
Block a user