From 5f4b97e004a6729d1cd8a10a93ac892faa423dac Mon Sep 17 00:00:00 2001 From: NouhailaAater Date: Tue, 25 Mar 2025 04:40:47 -0400 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20bouton=20recherche=20quiz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/Teacher/Dashboard/Dashboard.tsx | 123 +++++++++++------- 1 file changed, 76 insertions(+), 47 deletions(-) diff --git a/client/src/pages/Teacher/Dashboard/Dashboard.tsx b/client/src/pages/Teacher/Dashboard/Dashboard.tsx index 9d84bbb..9b5ba1b 100644 --- a/client/src/pages/Teacher/Dashboard/Dashboard.tsx +++ b/client/src/pages/Teacher/Dashboard/Dashboard.tsx @@ -66,6 +66,7 @@ const Dashboard: React.FC = () => { const [selectedRoom, selectRoom] = useState(); // menu const [errorMessage, setErrorMessage] = useState(''); const [showErrorDialog, setShowErrorDialog] = useState(false); + const [isSearchVisible, setIsSearchVisible] = useState(false); // Filter quizzes based on search term // const filteredQuizzes = quizzes.filter(quiz => @@ -120,6 +121,9 @@ const Dashboard: React.FC = () => { selectRoomByName(event.target.value); } }; + const toggleSearchVisibility = () => { + setIsSearchVisible(!isSearchVisible); // Alterne entre afficher et cacher la barre de recherche + }; // Créer une salle const createRoom = async (title: string) => { @@ -511,62 +515,87 @@ const Dashboard: React.FC = () => {
-
- - - - - - ) - }} - sx={{ - '& .MuiOutlinedInput-root': { + {/* Barre de recherche avec un bouton d'icône qui s'affiche ou se cache */} +
+ {!isSearchVisible ? ( + + border: '1px solid #ccc', + padding: '8px 12px', + backgroundColor: '#fff', + color: '#5271FF' + }} + > + + + ) : ( + // Barre de recherche visible + + + + + + ) + }} + /> + )}
-
- + > + Ajouter nouveau quiz + - -
+ > + Importer +
{/* Conteneur principal avec les actions et la liste des quiz */}