mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Compare commits
1 commit
a5671be906
...
360a93fc2a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
360a93fc2a |
1 changed files with 47 additions and 76 deletions
|
|
@ -66,7 +66,6 @@ const Dashboard: React.FC = () => {
|
||||||
const [selectedRoom, selectRoom] = useState<RoomType>(); // menu
|
const [selectedRoom, selectRoom] = useState<RoomType>(); // menu
|
||||||
const [errorMessage, setErrorMessage] = useState('');
|
const [errorMessage, setErrorMessage] = useState('');
|
||||||
const [showErrorDialog, setShowErrorDialog] = useState(false);
|
const [showErrorDialog, setShowErrorDialog] = useState(false);
|
||||||
const [isSearchVisible, setIsSearchVisible] = useState(false);
|
|
||||||
|
|
||||||
// Filter quizzes based on search term
|
// Filter quizzes based on search term
|
||||||
// const filteredQuizzes = quizzes.filter(quiz =>
|
// const filteredQuizzes = quizzes.filter(quiz =>
|
||||||
|
|
@ -121,9 +120,6 @@ const Dashboard: React.FC = () => {
|
||||||
selectRoomByName(event.target.value);
|
selectRoomByName(event.target.value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const toggleSearchVisibility = () => {
|
|
||||||
setIsSearchVisible(!isSearchVisible); // Alterne entre afficher et cacher la barre de recherche
|
|
||||||
};
|
|
||||||
|
|
||||||
// Créer une salle
|
// Créer une salle
|
||||||
const createRoom = async (title: string) => {
|
const createRoom = async (title: string) => {
|
||||||
|
|
@ -515,87 +511,62 @@ const Dashboard: React.FC = () => {
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
justifyContent: 'flex-end',
|
justifyContent: 'space-between',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
width: '100%',
|
marginBottom: '20px'
|
||||||
gap: '20px'
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* Barre de recherche avec un bouton d'icône qui s'affiche ou se cache */}
|
<div className="search-bar" style={{ flexGrow: 1, maxWidth: '400px' }}>
|
||||||
<div
|
<TextField
|
||||||
className="search-bar"
|
onChange={handleSearch}
|
||||||
style={{ display: 'flex', gap: '20px', alignItems: 'center' }}
|
value={searchTerm}
|
||||||
>
|
placeholder="Rechercher un quiz par son titre"
|
||||||
{!isSearchVisible ? (
|
fullWidth
|
||||||
<IconButton
|
variant="outlined"
|
||||||
onClick={toggleSearchVisibility}
|
InputProps={{
|
||||||
sx={{
|
endAdornment: (
|
||||||
|
<InputAdornment position="end">
|
||||||
|
<IconButton>
|
||||||
|
<Search />
|
||||||
|
</IconButton>
|
||||||
|
</InputAdornment>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
sx={{
|
||||||
|
'& .MuiOutlinedInput-root': {
|
||||||
borderRadius: '8px',
|
borderRadius: '8px',
|
||||||
border: '1px solid #ccc',
|
'& fieldset': {
|
||||||
padding: '8px 12px',
|
borderColor: '#e0e0e0'
|
||||||
backgroundColor: '#fff',
|
},
|
||||||
color: '#5271FF'
|
'&:hover fieldset': {
|
||||||
}}
|
borderColor: '#5271FF'
|
||||||
>
|
}
|
||||||
<Search />
|
}
|
||||||
</IconButton>
|
}}
|
||||||
) : (
|
/>
|
||||||
// Barre de recherche visible
|
|
||||||
<TextField
|
|
||||||
onChange={handleSearch}
|
|
||||||
value={searchTerm}
|
|
||||||
placeholder="Rechercher un quiz"
|
|
||||||
fullWidth
|
|
||||||
autoFocus
|
|
||||||
sx={{
|
|
||||||
borderRadius: '8px',
|
|
||||||
border: '1px solid #ccc',
|
|
||||||
padding: '8px 12px',
|
|
||||||
backgroundColor: '#fff',
|
|
||||||
maxWidth: '1000px',
|
|
||||||
width: '100%',
|
|
||||||
fontWeight: 500
|
|
||||||
}}
|
|
||||||
InputProps={{
|
|
||||||
endAdornment: (
|
|
||||||
<InputAdornment position="end">
|
|
||||||
<IconButton
|
|
||||||
onClick={toggleSearchVisibility}
|
|
||||||
sx={{
|
|
||||||
borderRadius: '8px',
|
|
||||||
border: '1px solid #ccc',
|
|
||||||
backgroundColor: '#fff',
|
|
||||||
color: '#5271FF'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Search />
|
|
||||||
</IconButton>
|
|
||||||
</InputAdornment>
|
|
||||||
)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button
|
<div style={{ display: 'flex', gap: '20px', alignItems: 'center' }}>
|
||||||
variant="outlined"
|
<Button
|
||||||
color="primary"
|
variant="outlined"
|
||||||
startIcon={<Add />}
|
color="primary"
|
||||||
onClick={handleCreateQuiz}
|
startIcon={<Add />}
|
||||||
|
onClick={handleCreateQuiz}
|
||||||
sx={{ borderRadius: '8px' }}
|
sx={{ borderRadius: '8px' }}
|
||||||
>
|
>
|
||||||
Ajouter nouveau quiz
|
Ajouter nouveau quiz
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
color="primary"
|
color="primary"
|
||||||
startIcon={<Upload />}
|
startIcon={<Upload />}
|
||||||
onClick={handleOnImport}
|
onClick={handleOnImport}
|
||||||
sx={{ borderRadius: '8px' }}
|
sx={{ borderRadius: '8px' }}
|
||||||
>
|
>
|
||||||
Importer
|
Importer
|
||||||
</Button>
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Conteneur principal avec les actions et la liste des quiz */}
|
{/* Conteneur principal avec les actions et la liste des quiz */}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue