Skip to content

Commit

Permalink
Labeled days : Pramit
Browse files Browse the repository at this point in the history
  • Loading branch information
pranav-suri committed May 14, 2024
1 parent af398bb commit cfe8122
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
8 changes: 7 additions & 1 deletion src/frontend/Components/Sidebar/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ export function DrawerRight({

const theme = useTheme();
if (!slot) return null;

const DAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

return (
<Drawer
sx={{
Expand Down Expand Up @@ -207,7 +210,10 @@ export function DrawerRight({
variant="h6"
sx={{ fontWeight: "bold", marginLeft: "10px", marginTop: "10px" }}
>
Day: {slot.day}, Slot: {slot.number}, Index: {selectedSlotIndex}
{DAYS[slot.day - 1]}, Slot: {slot.number}
<br />
<br />
{/* , Index: {selectedSlotIndex} */}
</Typography>
<Divider />
{slot.SlotDatas!.map((_, index) => (
Expand Down
24 changes: 11 additions & 13 deletions src/frontend/Components/Timetable/MuiTimetable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,13 @@ function printClasses(slotDataClasses: SlotDataClasses) {
));
}
function printSubdivisions(slotDataSubdivisions: SlotDataSubdivisions, viewAllData: boolean) {
return viewAllData ? (
slotDataSubdivisions?.map((slotDataSubdivision, slotDataSubdivisionIndex) => (
<React.Fragment key={slotDataSubdivisionIndex}>
{" "}
{slotDataSubdivision.Subdivision?.subdivisionName}
{slotDataSubdivisionIndex !== slotDataSubdivisions.length - 1 && ","}
</React.Fragment>
))
) : (
<></>
);
return slotDataSubdivisions?.map((slotDataSubdivision, slotDataSubdivisionIndex) => (
<React.Fragment key={slotDataSubdivisionIndex}>
{" "}
{slotDataSubdivision.Subdivision?.subdivisionName}
{slotDataSubdivisionIndex !== slotDataSubdivisions.length - 1 && ","}
</React.Fragment>
));
}

function Cell({
Expand Down Expand Up @@ -107,16 +103,18 @@ function Row({
setSelectedSlotIndex,
}: {
timetable: Timetable;
day: number | string;
day: number;
slotNumbers: Set<Slots[0]["number"]>;
viewAllData: boolean;
handleDrawerOpen: () => void;
setSelectedSlotIndex: React.Dispatch<React.SetStateAction<number | null>>;
}) {
const DAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

return (
<TableRow>
{/* <TableHead> */}
<TableCell>{day}</TableCell>
<TableCell>{DAYS[day - 1]}</TableCell>
{/* </TableHead> */}

{Array.from(slotNumbers)
Expand Down

0 comments on commit cfe8122

Please sign in to comment.