Skip to content

Commit cfe8122

Browse files
committed
Labeled days : Pramit
1 parent af398bb commit cfe8122

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

src/frontend/Components/Sidebar/Drawer.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ export function DrawerRight({
180180

181181
const theme = useTheme();
182182
if (!slot) return null;
183+
184+
const DAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
185+
183186
return (
184187
<Drawer
185188
sx={{
@@ -207,7 +210,10 @@ export function DrawerRight({
207210
variant="h6"
208211
sx={{ fontWeight: "bold", marginLeft: "10px", marginTop: "10px" }}
209212
>
210-
Day: {slot.day}, Slot: {slot.number}, Index: {selectedSlotIndex}
213+
{DAYS[slot.day - 1]}, Slot: {slot.number}
214+
<br />
215+
<br />
216+
{/* , Index: {selectedSlotIndex} */}
211217
</Typography>
212218
<Divider />
213219
{slot.SlotDatas!.map((_, index) => (

src/frontend/Components/Timetable/MuiTimetable.tsx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,13 @@ function printClasses(slotDataClasses: SlotDataClasses) {
3939
));
4040
}
4141
function printSubdivisions(slotDataSubdivisions: SlotDataSubdivisions, viewAllData: boolean) {
42-
return viewAllData ? (
43-
slotDataSubdivisions?.map((slotDataSubdivision, slotDataSubdivisionIndex) => (
44-
<React.Fragment key={slotDataSubdivisionIndex}>
45-
{" "}
46-
{slotDataSubdivision.Subdivision?.subdivisionName}
47-
{slotDataSubdivisionIndex !== slotDataSubdivisions.length - 1 && ","}
48-
</React.Fragment>
49-
))
50-
) : (
51-
<></>
52-
);
42+
return slotDataSubdivisions?.map((slotDataSubdivision, slotDataSubdivisionIndex) => (
43+
<React.Fragment key={slotDataSubdivisionIndex}>
44+
{" "}
45+
{slotDataSubdivision.Subdivision?.subdivisionName}
46+
{slotDataSubdivisionIndex !== slotDataSubdivisions.length - 1 && ","}
47+
</React.Fragment>
48+
));
5349
}
5450

5551
function Cell({
@@ -107,16 +103,18 @@ function Row({
107103
setSelectedSlotIndex,
108104
}: {
109105
timetable: Timetable;
110-
day: number | string;
106+
day: number;
111107
slotNumbers: Set<Slots[0]["number"]>;
112108
viewAllData: boolean;
113109
handleDrawerOpen: () => void;
114110
setSelectedSlotIndex: React.Dispatch<React.SetStateAction<number | null>>;
115111
}) {
112+
const DAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
113+
116114
return (
117115
<TableRow>
118116
{/* <TableHead> */}
119-
<TableCell>{day}</TableCell>
117+
<TableCell>{DAYS[day - 1]}</TableCell>
120118
{/* </TableHead> */}
121119

122120
{Array.from(slotNumbers)

0 commit comments

Comments
 (0)