Skip to content

Commit

Permalink
All Rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
KathleenX7 committed Dec 7, 2024
1 parent af71cbd commit ca9ac47
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions frontend/src/components/pages/announcements/AnnouncementsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,27 +181,34 @@ const AnnouncementsView = ({
border="1px solid #57469D"
backgroundColor="#F9F7FF"
>
<TagLabel textAlign="center"> Room {room}</TagLabel>
<TagLabel textAlign="center"> {room === -1? 'All Rooms': `Room ${room}`}</TagLabel>
<TagCloseButton
onClick={() => deleteRoomSelected(room)}
color="#57469D"
/>
</Tag>
))}
<Menu>
<MenuButton>
<AddCircleOutlineOutlinedIcon sx={{ color: "#57469D" }} />
</MenuButton>
<MenuList maxH="40vh" overflow="auto">
{allRooms
.filter((room) => !selectedRooms.includes(room))
.map((room) => (
<MenuItem onClick={() => addRoomToNewRoom(room)} key={room}>
Room {room}
</MenuItem>
))}
</MenuList>
</Menu>
{selectedRooms.length === 0 &&
<Menu>
<MenuButton>
<AddCircleOutlineOutlinedIcon sx={{ color: "#57469D" }} />
</MenuButton>
<MenuList maxH="40vh" overflow="auto">
{[
<MenuItem onClick={() => addRoomToNewRoom(-1)} key='all-rooms'>
All Rooms
</MenuItem>,
...allRooms
.filter((room) => !selectedRooms.includes(room))
.map((room) => (
<MenuItem onClick={() => addRoomToNewRoom(room)} key={room}>
Room {room}
</MenuItem>
))
]}
</MenuList>
</Menu>
}
</HStack>
</Flex>
);
Expand Down

0 comments on commit ca9ac47

Please sign in to comment.