Skip to content

Commit c73f762

Browse files
authored
Merge pull request #162 from crux-bphc/minor-bug-fixes
Minor bug fixes for mobile devices, and refetching
2 parents 485fd9f + 73935f5 commit c73f762

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

frontend/src/components/TimetableGrid.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ export function TimetableGrid({
126126
}, [timetableDetailsSections, isVertical]);
127127

128128
return (
129-
<div className="flex w-full h-full">
129+
<div className="flex w-full lg:h-full h-[150%]">
130130
{isVertical ? (
131131
<div
132-
className={`mt-16 gap-9 sm:gap-0 sm:mt-12 sm:h-full grid justify-between grid-rows-${displayCols} text-md text-center text-foreground/80 font-bold`}
132+
className={`pt-16 gap-9 sm:gap-8 sm:mt-4 lg:pt-8 lg:gap-2 sm:h-full grid justify-between grid-rows-${displayCols} md:text-md text-sm text-center text-foreground/80 font-bold`}
133133
>
134134
{timings
135135
.filter((_, i) => i < displayCols)
@@ -141,7 +141,7 @@ export function TimetableGrid({
141141
</div>
142142
) : (
143143
<div
144-
className={`grid grid-rows-${displayRows} items-center mr-4 mt-12 text-lg text-center font-bold text-foreground/80`}
144+
className={`grid grid-rows-${displayRows} items-center mr-4 mt-12 md:text-lg text-md text-center font-bold text-foreground/80`}
145145
>
146146
{daysOfWeek.map((e) => (
147147
<span key={e}>{e}</span>
@@ -151,15 +151,15 @@ export function TimetableGrid({
151151
<div className="flex flex-col w-full h-full">
152152
{isVertical ? (
153153
<div
154-
className={`grid grid-cols-${displayRows} items-center pr-2 text-lg text-center font-bold text-foreground/80 `}
154+
className={`grid grid-cols-${displayRows} items-center pr-2 md:text-lg text-md text-center font-bold text-foreground/80 `}
155155
>
156156
{daysOfWeek.map((e) => (
157157
<span key={e}>{e}</span>
158158
))}
159159
</div>
160160
) : (
161161
<div
162-
className={`grid grid-cols-${displayCols} justify-between text-md text-center font-bold text-foreground/80`}
162+
className={`grid grid-cols-${displayCols} justify-between md:text-md text-sm text-center font-bold text-foreground/80`}
163163
>
164164
{timings
165165
.filter((_, i) => i < displayCols)

frontend/src/components/side-menu.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export function SideMenu({
228228
// JSX SECTION
229229
if (isOnCourseDetails) {
230230
return (
231-
<div className="bg-secondary h-[calc(100vh-13rem)]">
231+
<div className="bg-secondary w-[26rem] h-[calc(100vh-13rem)]">
232232
<div className="flex items-center py-2 w-full">
233233
<Button
234234
variant={"ghost"}
@@ -270,7 +270,7 @@ export function SideMenu({
270270
className="h-[calc(100vh-20rem)]"
271271
key={sectionType}
272272
>
273-
<div className="flex flex-col gap-2 p-0 m-0 px-2 overflow-y-scroll w-[28rem] h-[calc(100vh-20rem)]">
273+
<div className="flex flex-col gap-2 p-0 m-0 px-2 overflow-y-scroll w-[26rem] h-[calc(100vh-20rem)]">
274274
{currentCourseDetails.data?.sections
275275
.filter((section) => section.type === sectionType)
276276
.map((section) => {
@@ -321,7 +321,7 @@ export function SideMenu({
321321
<span className="font-semibold whitespace-pre-wrap text-md">
322322
{section.instructors.join(", ")}
323323
</span>
324-
<span className="font-normal">
324+
<span className="font-normal whitespace-pre-wrap">
325325
{section.roomTime
326326
.map((e) =>
327327
e.split(":").splice(1).join(" "),
@@ -355,7 +355,7 @@ export function SideMenu({
355355

356356
// user is not in course details
357357
return (
358-
<div className="bg-secondary w-[28rem]">
358+
<div className="bg-secondary w-[26rem]">
359359
<Tabs
360360
value={isScreenshotMode ? "exams" : currentTab}
361361
className="py-2 h-[calc(100vh-16rem)]"
@@ -398,7 +398,7 @@ export function SideMenu({
398398

399399
<TabsContent
400400
value="CDCs"
401-
className="border-muted-foreground/80 flex flex-col"
401+
className="border-muted-foreground/80 w-[26rem] data-[state=inactive]:h-0 flex flex-col h-full overflow-y-scroll"
402402
>
403403
{cdcs
404404
.filter((course) => course.id !== null)
@@ -458,7 +458,7 @@ export function SideMenu({
458458

459459
<TabsContent
460460
value="currentCourses"
461-
className="flex flex-col px-2 gap-2"
461+
className="flex h-full data-[state=inactive]:h-0 w-[26rem] overflow-y-scroll flex-col px-2 gap-2"
462462
>
463463
{coursesInTimetable.map((course) => {
464464
if (course === undefined) return <></>;
@@ -497,7 +497,10 @@ export function SideMenu({
497497
})}
498498
</TabsContent>
499499

500-
<TabsContent value="exams" className="flex flex-col">
500+
<TabsContent
501+
value="exams"
502+
className="flex data-[state=inactive]:h-0 w-[26rem] flex-col h-full overflow-y-scroll"
503+
>
501504
<span className="text-xl font-bold pl-4 flex mb-2">Midsems</span>
502505
{timetable.examTimes
503506
.filter((e) => e.includes("|MIDSEM|"))
@@ -594,9 +597,9 @@ export function SideMenu({
594597

595598
<TabsContent
596599
value="search"
597-
className="h-full w-[26rem] overflow-y-scroll"
600+
className="data-[state=inactive]:h-0 w-[26rem] h-full"
598601
>
599-
<div className="px-4 pb-4 pt-1">
602+
<div className="px-4 pb-4">
600603
<Input
601604
value={searchTerm}
602605
onChange={(e) => setSearchTerm(e.target.value)}
@@ -605,7 +608,7 @@ export function SideMenu({
605608
/>
606609
</div>
607610

608-
<div>
611+
<div className="h-[calc(100%-3rem)] overflow-y-scroll">
609612
{courseSearchResults.map((course) => (
610613
// TODO - deal with this biome rule
611614
// biome-ignore lint/a11y/useKeyWithClickEvents: <explanation>

frontend/src/main.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ import RootComponent from "./RootComponent";
2323
import viewTimetableRoute from "./ViewTimetable";
2424
import "./index.css";
2525

26-
const queryClient = new QueryClient();
26+
const queryClient = new QueryClient({
27+
defaultOptions: {
28+
queries: {
29+
refetchOnWindowFocus: false,
30+
},
31+
},
32+
});
2733

2834
export const rootRoute = rootRouteWithContext<{
2935
queryClient: QueryClient;

0 commit comments

Comments
 (0)