Skip to content

Commit 3e28a96

Browse files
Merge pull request #753 from hilton326/test
Fixed schedule day card overflow in mobile view
2 parents c3c62f1 + 7d1fcb0 commit 3e28a96

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

frontend/src/components/schedules/WeekSchedule.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export default function WeekSchedule({ weekData }: WeekScheduleProps) {
186186
}, []);
187187

188188
return (
189-
<div className="relative z-0 mx-auto w-screen max-w-[1800px] overflow-x-hidden px-8">
189+
<div className="relative z-0 mx-auto w-screen max-w-[1800px] overflow-x-hidden px-4">
190190
<button
191191
className="absolute left-0 top-0 z-10 flex h-full w-8 rotate-180 items-center justify-between rounded-r-lg border-l-2 border-pink-900 bg-pink-50 py-4 text-center font-bold text-pink-900 transition-[left] [writing-mode:vertical-lr] 2xl:hidden [&:not([data-scroll-target])]:-left-8"
192192
data-scroll-target={prev}
@@ -198,18 +198,22 @@ export default function WeekSchedule({ weekData }: WeekScheduleProps) {
198198
<PiCaretDoubleRightBold />
199199
</button>
200200

201+
{/* Viewport of schedule display */}
201202
<section
202-
className="m-2 grid h-[750px] w-full snap-x snap-mandatory grid-cols-[1rem_repeat(5,calc((100%-1rem)/var(--cols)))] overflow-x-auto scroll-smooth rounded-lg bg-pink-200/50 p-4 [--cols:1] sm:[--cols:2] md:overflow-hidden lg:[--cols:3] xl:[--cols:4] 2xl:[--cols:5]"
203+
className="grid h-[750px] w-full snap-x snap-mandatory grid-cols-[1rem_repeat(5,calc((100%-1rem)/var(--cols)))] overflow-x-auto scroll-smooth rounded-lg bg-pink-200/50 py-4 [--cols:1] sm:[--cols:2] md:overflow-hidden lg:[--cols:3] xl:[--cols:4] 2xl:[--cols:5]"
203204
ref={scrollportRef}
204205
>
205206
<div />
206207

207208
{Object.entries(weekData).map(([day, classes]) => (
208209
<div className="snap-end snap-always pr-4" data-title={day} key={day}>
210+
{/* One day's schedule */}
209211
<article className="flex h-full w-full flex-col gap-4 rounded-xl bg-white px-0 py-0">
212+
{/* Day label */}
210213
<h2 className="text rounded-lg bg-[#222233] px-4 py-3 text-center text-xl font-bold text-white">
211214
{day}
212215
</h2>
216+
{/* Class list */}
213217
<div className="relative h-full">
214218
{createHourlySections()}
215219
{classes.map((classData, index) => {

0 commit comments

Comments
 (0)