Skip to content

Commit e2e9945

Browse files
committed
linter
1 parent ab230e1 commit e2e9945

File tree

4 files changed

+36
-25
lines changed

4 files changed

+36
-25
lines changed

frontend/src/APIClients/Types/ResidentsType.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ export type ResidentResponse = {
5353
credits: number;
5454
dateJoined: Date;
5555
dateLeft: Date;
56-
}
56+
};

frontend/src/components/pages/announcements/AnnouncementsGroups.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ export const formatRooms = (roomIDs: number[]) => {
4646
const formattedRooms = roomIDs.map((id) => {
4747
if (id === 0) {
4848
return "New Announcement";
49-
} if (id === -1) {
49+
}
50+
if (id === -1) {
5051
return "All Rooms";
5152
}
5253
return `Room ${id}`;
@@ -107,7 +108,7 @@ const GroupTab = ({
107108
<Flex flexDir="column" w="100%">
108109
<Flex justifyContent="space-between">
109110
<Text as="b" color={isDraft ? "gray.500" : "black"}>
110-
{announcementGroup? 'All Rooms': formatRooms(rooms)}
111+
{announcementGroup ? "All Rooms" : formatRooms(rooms)}
111112
</Text>
112113
<Text margin="0" color="gray.500">
113114
{firstAnnouncement

frontend/src/components/pages/announcements/AnnouncementsPage.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ const AnnouncementsPage = (): React.ReactElement => {
6262
// userId: number;
6363
// }>(SEND_ANNOUNCEMENT);
6464

65-
const {
66-
loading: allNotificationsLoading,
67-
error: allNotificationsError,
68-
data: allNotificationsData,
69-
} = useQuery(GET_ALL_GROUPS_AND_NOTIFICATIONS);
70-
7165
// const {
7266
// loading: notificationByIdLoading,
7367
// error: notificationByIdError,
@@ -146,6 +140,12 @@ const AnnouncementsPage = (): React.ReactElement => {
146140
]
147141
*/
148142

143+
const {
144+
loading: allNotificationsLoading,
145+
error: allNotificationsError,
146+
data: allNotificationsData,
147+
} = useQuery(GET_ALL_GROUPS_AND_NOTIFICATIONS);
148+
149149
const [sendNotificationToGroup] = useMutation(SEND_NOTIFICATION_TO_GROUP);
150150
const [createNotificationGroup] = useMutation(CREATE_NOTIFICATION_GROUP);
151151
const [createAnnouncementGroup] = useMutation(CREATE_ANNOUNCEMENT_GROUP);

frontend/src/components/pages/announcements/AnnouncementsView.tsx

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ const AnnouncementsView = ({
142142
createNotificationGroupAndSendNotification,
143143
}: Props): React.ReactElement => {
144144
const groupInfo = announcements.find((group) => group.id === selectedGroup);
145-
const rooms = groupInfo && groupInfo.recipients? groupInfo.recipients.map((recipient) => recipient.roomNumber): [];
145+
const rooms =
146+
groupInfo && groupInfo.recipients
147+
? groupInfo.recipients.map((recipient) => recipient.roomNumber)
148+
: [];
146149
const [allRooms, setAllRooms] = useState([1, 2, 3, 4, 5, 6]);
147150

148151
const addRoomToNewRoom = (roomId: number) => {
@@ -181,34 +184,43 @@ const AnnouncementsView = ({
181184
border="1px solid #57469D"
182185
backgroundColor="#F9F7FF"
183186
>
184-
<TagLabel textAlign="center"> {room === -1? 'All Rooms': `Room ${room}`}</TagLabel>
187+
<TagLabel textAlign="center">
188+
{" "}
189+
{room === -1 ? "All Rooms" : `Room ${room}`}
190+
</TagLabel>
185191
<TagCloseButton
186192
onClick={() => deleteRoomSelected(room)}
187193
color="#57469D"
188194
/>
189195
</Tag>
190196
))}
191-
{selectedRooms.length === 0 &&
197+
{selectedRooms.length === 0 && (
192198
<Menu>
193199
<MenuButton>
194200
<AddCircleOutlineOutlinedIcon sx={{ color: "#57469D" }} />
195201
</MenuButton>
196202
<MenuList maxH="40vh" overflow="auto">
197203
{[
198-
<MenuItem onClick={() => addRoomToNewRoom(-1)} key='all-rooms'>
199-
All Rooms
200-
</MenuItem>,
204+
<MenuItem
205+
onClick={() => addRoomToNewRoom(-1)}
206+
key="all-rooms"
207+
>
208+
All Rooms
209+
</MenuItem>,
201210
...allRooms
202211
.filter((room) => !selectedRooms.includes(room))
203212
.map((room) => (
204-
<MenuItem onClick={() => addRoomToNewRoom(room)} key={room}>
213+
<MenuItem
214+
onClick={() => addRoomToNewRoom(room)}
215+
key={room}
216+
>
205217
Room {room}
206218
</MenuItem>
207-
))
219+
)),
208220
]}
209221
</MenuList>
210222
</Menu>
211-
}
223+
)}
212224
</HStack>
213225
</Flex>
214226
);
@@ -219,12 +231,12 @@ const AnnouncementsView = ({
219231
const getHeader = () => {
220232
if (selectedGroup === "" || selectedGroup === "0") {
221233
return formatHeader(rooms);
222-
}
234+
}
223235
if (groupInfo?.announcementGroup) {
224-
return 'All Rooms';
225-
}
236+
return "All Rooms";
237+
}
226238
return formatRooms(rooms);
227-
}
239+
};
228240

229241
return (
230242
<Box h="100vh" w="100%">
@@ -238,9 +250,7 @@ const AnnouncementsView = ({
238250
justifyContent="space-between"
239251
h="10vh"
240252
>
241-
<h1 style={{ fontSize: "24px", margin: "0" }}>
242-
{getHeader()}
243-
</h1>
253+
<h1 style={{ fontSize: "24px", margin: "0" }}>{getHeader()}</h1>
244254
<IconButton
245255
aria-label="info"
246256
color="purple.main"

0 commit comments

Comments
 (0)