mirror of
https://gitlab.aliens-lyon.fr/encartes/web-interface.git
synced 2026-03-17 22:51:04 +01:00
Update menu
This commit is contained in:
parent
b06eec2c37
commit
104da0242b
@ -93,11 +93,8 @@ function RoomInformation({ roomId }) {
|
||||
fetch("https://encartes.aliens-lyon.fr/api/map/get_place_info/" + roomId)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
setNames(data['names']);
|
||||
setUsers(data['users']);
|
||||
})
|
||||
.catch(error => {
|
||||
// TODO: error tooltip
|
||||
setNames(data.names);
|
||||
setUsers(data.users);
|
||||
});
|
||||
}, [roomId]);
|
||||
|
||||
|
||||
@ -7,11 +7,15 @@ import TableBody from '@mui/material/TableBody';
|
||||
|
||||
/* Displays a list of rooms */
|
||||
export default function Rooms({ rooms, callbackRoomSelected }) {
|
||||
if (rooms.length == 0) {
|
||||
return;
|
||||
}
|
||||
return <TableContainer variant="outlined">
|
||||
<Table aria-label="demo table">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>Salle</TableCell>
|
||||
<TableCell>Bâtiment</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
@ -19,9 +23,10 @@ export default function Rooms({ rooms, callbackRoomSelected }) {
|
||||
return <>
|
||||
<TableRow
|
||||
hover={true}
|
||||
onClick={() => callbackRoomSelected(room['idFloors'][0], room['idRoom'])}
|
||||
onClick={() => callbackRoomSelected(room.floors[0].id, room.idPlace)}
|
||||
>
|
||||
<TableCell>{room['idRoom']}</TableCell>
|
||||
<TableCell>{room.namePlace[0]}</TableCell>
|
||||
<TableCell>{room.nameBuilding}</TableCell>
|
||||
</TableRow>
|
||||
</>
|
||||
})}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user