mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
parent
8240de0a44
commit
5b41f24404
2 changed files with 20 additions and 7 deletions
|
|
@ -111,6 +111,12 @@ const JoinRoom: React.FC = () => {
|
|||
webSocketService.submitAnswer(answerData);
|
||||
};
|
||||
|
||||
const handleReturnKey = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||
if (e.key === 'Enter') {
|
||||
handleSocket();
|
||||
}
|
||||
};
|
||||
|
||||
if (isWaitingForTeacher) {
|
||||
return (
|
||||
<div className='room'>
|
||||
|
|
@ -167,7 +173,8 @@ const JoinRoom: React.FC = () => {
|
|||
onChange={(e) => setRoomName(e.target.value)}
|
||||
placeholder="Numéro de la salle"
|
||||
sx={{ marginBottom: '1rem' }}
|
||||
fullWidth
|
||||
fullWidth={true}
|
||||
onKeyDown={handleReturnKey}
|
||||
/>
|
||||
|
||||
<TextField
|
||||
|
|
@ -177,7 +184,8 @@ const JoinRoom: React.FC = () => {
|
|||
onChange={(e) => setUsername(e.target.value)}
|
||||
placeholder="Nom d'utilisateur"
|
||||
sx={{ marginBottom: '1rem' }}
|
||||
fullWidth
|
||||
fullWidth={true}
|
||||
onKeyDown={handleReturnKey}
|
||||
/>
|
||||
|
||||
<LoadingButton
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
import { useNavigate, Link } from 'react-router-dom';
|
||||
|
||||
// JoinRoom.tsx
|
||||
import { Link, useNavigate } from 'react-router-dom';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
import './Login.css';
|
||||
|
|
@ -38,6 +36,11 @@ const Login: React.FC = () => {
|
|||
|
||||
};
|
||||
|
||||
const handleKeyPress = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||
if (e.key === 'Enter') {
|
||||
login();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<LoginContainer
|
||||
|
|
@ -51,7 +54,8 @@ const Login: React.FC = () => {
|
|||
onChange={(e) => setEmail(e.target.value)}
|
||||
placeholder="Adresse courriel"
|
||||
sx={{ marginBottom: '1rem' }}
|
||||
fullWidth
|
||||
fullWidth={true}
|
||||
onKeyDown={handleKeyPress} // Add this line as well
|
||||
/>
|
||||
|
||||
<TextField
|
||||
|
|
@ -62,7 +66,8 @@ const Login: React.FC = () => {
|
|||
onChange={(e) => setPassword(e.target.value)}
|
||||
placeholder="Mot de passe"
|
||||
sx={{ marginBottom: '1rem' }}
|
||||
fullWidth
|
||||
fullWidth={true}
|
||||
onKeyDown={handleKeyPress} // Add this line as well
|
||||
/>
|
||||
|
||||
<LoadingButton
|
||||
|
|
|
|||
Loading…
Reference in a new issue