Skip to content

Commit 729ec90

Browse files
cleaned up grid item code
1 parent ba20fc9 commit 729ec90

File tree

2 files changed

+12
-85
lines changed

2 files changed

+12
-85
lines changed

frontend/alert/components/managealert/AlertHeader.tsx

+10-83
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,6 @@ import {
44
GridItem,
55
GridCourseTitle,
66
} from "pcx-shared-components/src/common/layout";
7-
import { P } from "../common/common";
8-
import ToggleSwitch from "../common/ToggleSwitch";
9-
import { AlertAction, SectionStatus } from "../../types";
10-
import { Img } from "../common/common";
11-
import { configureScope } from "@sentry/browser";
12-
import { Flex } from "pcx-shared-components/src/common/layout";
13-
14-
const GridTitle = styled.div`
15-
color: #282828;
16-
font-size: 1rem;
17-
font-family: "Inter", sans-serif;
18-
font-weight: bold;
19-
padding-top: 0.5rem;
20-
`;
217

228
const GridSubtitle = styled.div`
239
color: #282828;
@@ -28,18 +14,6 @@ const GridSubtitle = styled.div`
2814
white-space: nowrap;
2915
`;
3016

31-
const TrashImg = styled(Img)`
32-
cursor: pointer;
33-
opacity: 75%;
34-
35-
&:hover {
36-
opacity: 100%;
37-
}
38-
&:active {
39-
transform: translateY(0.1rem);
40-
}
41-
`;
42-
4317
// Component for an alert entry (renders as a row in CSS grid)
4418
interface AlertHeaderProps {
4519
course: string;
@@ -51,64 +25,17 @@ export const AlertHeader = ({ course, rownum }: AlertHeaderProps) => {
5125
<GridCourseTitle column={1} valign border>
5226
<GridSubtitle>{course.toUpperCase()}</GridSubtitle>
5327
</GridCourseTitle>
54-
5528
{/* used to make sure grid line goes to end */}
56-
<GridItem
57-
column={2}
58-
row={rownum}
59-
border
60-
halign
61-
valign
62-
talign
63-
></GridItem>
64-
<GridItem
65-
column={3}
66-
row={rownum}
67-
border
68-
halign
69-
valign
70-
talign
71-
></GridItem>
72-
<GridItem
73-
column={4}
74-
row={rownum}
75-
border
76-
halign
77-
valign
78-
talign
79-
></GridItem>
80-
<GridItem
81-
column={5}
82-
row={rownum}
83-
border
84-
halign
85-
valign
86-
talign
87-
></GridItem>
88-
<GridItem
89-
column={6}
90-
row={rownum}
91-
border
92-
halign
93-
valign
94-
talign
95-
></GridItem>
96-
<GridItem
97-
column={7}
98-
row={rownum}
99-
border
100-
halign
101-
valign
102-
talign
103-
></GridItem>
104-
<GridItem
105-
column={8}
106-
row={rownum}
107-
border
108-
halign
109-
valign
110-
talign
111-
></GridItem>
29+
{Array.from({ length: 7 }, (_, index) => (
30+
<GridItem
31+
column={index + 2}
32+
row={rownum}
33+
border
34+
halign
35+
valign
36+
talign
37+
/>
38+
))}
11239
</>
11340
);
11441
};

frontend/alert/components/managealert/ManageAlertUI.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export const ManageAlert = ({
9191
const [searchTimeout, setSearchTimeout] = useState<number>();
9292
const [numSelected, setNumSelected] = useState(0);
9393

94-
//Alerts for testing
94+
// Alerts for testing
9595
var alert1: Alert = {
9696
id: 1,
9797
originalCreatedAt: "2023-09-11T12:00:00Z",
@@ -201,7 +201,7 @@ export const ManageAlert = ({
201201
* Returns alerts grouped by course
202202
* @return grouped alerts
203203
*/
204-
const groupedAlerts = alerts
204+
const groupedAlerts = testAlerts
205205
.sort((a, b) => a.section.localeCompare(b.section))
206206
.reduce((res, obj) => {
207207
const [courseName, midNum, endNum] = obj.section.split("-");

0 commit comments

Comments
 (0)