Skip to content

Commit 000623a

Browse files
Merge pull request #135 from Soham-Maha/staging
Changed filter to display slot alphabetically
2 parents db7c8b3 + 4f69720 commit 000623a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: src/components/FilterDialog.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export const FilterDialog = ({
2727
initialExams: string[] | undefined;
2828
initialSlots: string[] | undefined;
2929
initialYears: string[] | undefined;
30-
initialCampuses: string [] | undefined
31-
initialSemesters: string [] | undefined
30+
initialCampuses: string[] | undefined;
31+
initialSemesters: string[] | undefined;
3232

3333
onReset: () => void;
3434
onApplyFilters: (exams: string[], slots: string[], years: string[]) => void;
@@ -55,15 +55,15 @@ export const FilterDialog = ({
5555
setSelectedSlots(initialSlots ?? []);
5656
setSelectedYears(initialYears ?? []);
5757
setSelectedCampuses(initialCampuses ?? []);
58-
setSelectedSemesters(initialSemesters ?? [])
58+
setSelectedSemesters(initialSemesters ?? []);
5959
}, [initialExams, initialSlots, initialYears]);
6060

6161
const exams = filterOptions.uniqueExams.map((exam) => ({
6262
label: exam,
6363
value: exam,
6464
}));
65-
const slots = filterOptions.uniqueSlots.map((slot) => ({
66-
label: slot,
65+
const slots = filterOptions.uniqueSlots.sort((a, b) => a.localeCompare(b)).map((slot) => ({
66+
label: slot,
6767
value: slot,
6868
}));
6969
const years = filterOptions.uniqueYears.map((year) => ({

0 commit comments

Comments
 (0)