From 4418a50aaaa1a4983898f9ed5b949299ba45ad83 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 29 Dec 2023 08:55:09 -0800 Subject: [PATCH 01/12] fix: styling and warnings --- components/search/filterComponents.tsx | 4 ++-- components/search/search.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/search/filterComponents.tsx b/components/search/filterComponents.tsx index 5568b0f..5141919 100644 --- a/components/search/filterComponents.tsx +++ b/components/search/filterComponents.tsx @@ -91,7 +91,7 @@ export const CalendarFilter = (props: CalendarFilterProps) => {
@@ -104,7 +104,7 @@ export const CalendarFilter = (props: CalendarFilterProps) => {
diff --git a/components/search/search.tsx b/components/search/search.tsx index c1db16f..36da50f 100644 --- a/components/search/search.tsx +++ b/components/search/search.tsx @@ -236,7 +236,7 @@ const Search = () => { }); fetchData(); - }, [university, ge]); + }, [university, ge, toast]); return ( <> From 6525a42781d4d2f109b810f8941927cf221858c6 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 29 Dec 2023 09:11:57 -0800 Subject: [PATCH 02/12] style: h-full, w-full --- components/search/filterComponents.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/search/filterComponents.tsx b/components/search/filterComponents.tsx index 5141919..734cdab 100644 --- a/components/search/filterComponents.tsx +++ b/components/search/filterComponents.tsx @@ -91,7 +91,7 @@ export const CalendarFilter = (props: CalendarFilterProps) => {
@@ -104,7 +104,7 @@ export const CalendarFilter = (props: CalendarFilterProps) => {
From 0a94429548e172cfb5a4a74b55cadf03cb2ec738 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 29 Dec 2023 09:41:16 -0800 Subject: [PATCH 03/12] fix: start and end default values --- components/search/filterComponents.tsx | 2 +- components/search/filters.tsx | 2 +- components/search/search.tsx | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/components/search/filterComponents.tsx b/components/search/filterComponents.tsx index 734cdab..2f72fd7 100644 --- a/components/search/filterComponents.tsx +++ b/components/search/filterComponents.tsx @@ -59,7 +59,7 @@ export const CustomFilterCheckbox = (props: FilterCheckboxProps) => { interface CalendarFilterProps { onStartChange: Dispatch>; - onEndChange: Dispatch>; + onEndChange: Dispatch>; defaultStart: string | undefined; defaultEnd: string | undefined; } diff --git a/components/search/filters.tsx b/components/search/filters.tsx index d12b246..6a3f32e 100644 --- a/components/search/filters.tsx +++ b/components/search/filters.tsx @@ -14,7 +14,7 @@ interface SearchFilterProps { setEnrollment: Dispatch>; setAvailable: Dispatch>; setStart: Dispatch>; - setEnd: Dispatch>; + setEnd: Dispatch>; setInstitution: Dispatch>; setMin: Dispatch>; setMax: Dispatch>; diff --git a/components/search/search.tsx b/components/search/search.tsx index 36da50f..5f675fc 100644 --- a/components/search/search.tsx +++ b/components/search/search.tsx @@ -70,8 +70,14 @@ const Search = () => { const [format, setFormat] = useState([true, true]); const [enrollment, setEnrollment] = useState([true]); const [available, setAvailable] = useState([true]); - const [start, setStart] = useState(new Date().toLocaleDateString("en-CA")); - const [end, setEnd] = useState(); + const [start, setStart] = useState(() => { + const today = new Date(); + const year = today.getFullYear(); + const month = (today.getMonth() + 1).toString().padStart(2, "0"); + const day = today.getDate().toString().padStart(2, "0"); + return `${year}-${month}-${day}`; + }); + const [end, setEnd] = useState(""); const [institution, setInstitution] = useState("Any Institution"); const [min, setMin] = useState(0); const [max, setMax] = useState(20); From bdb23a43593e8162297ab12d26786d981225c2e0 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 29 Dec 2023 09:47:46 -0800 Subject: [PATCH 04/12] chore: update file names --- __tests__/search-filters.test.ts | 4 ++-- app/search/page.tsx | 2 +- components/search/blurb.tsx | 2 +- components/search/{filterUtils.ts => filter-utils.ts} | 2 +- components/search/filterComponents.tsx | 2 +- components/search/filters.tsx | 2 +- components/search/search.tsx | 2 +- components/search/searchResults.tsx | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) rename components/search/{filterUtils.ts => filter-utils.ts} (98%) diff --git a/__tests__/search-filters.test.ts b/__tests__/search-filters.test.ts index 6c15277..e784d2a 100644 --- a/__tests__/search-filters.test.ts +++ b/__tests__/search-filters.test.ts @@ -1,9 +1,9 @@ -import { FilterValues } from "@/components/search/search"; +import { FilterValues } from "@/components/search/Search"; import { endsBefore, filterData, startsAfter, -} from "@/components/search/filterUtils"; +} from "@/components/search/filter-utils"; import "@testing-library/jest-dom"; const data = { diff --git a/app/search/page.tsx b/app/search/page.tsx index ecf1944..75bde11 100644 --- a/app/search/page.tsx +++ b/app/search/page.tsx @@ -1,4 +1,4 @@ -import Search from "@/components/search/search"; +import Search from "@/components/search/Search"; import React from "react"; const SearchPage = () => { diff --git a/components/search/blurb.tsx b/components/search/blurb.tsx index b458de2..7699438 100644 --- a/components/search/blurb.tsx +++ b/components/search/blurb.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { CollegeObject, FilterValues } from "./search"; +import { CollegeObject, FilterValues } from "./Search"; interface BlurbProps { filterData: ( diff --git a/components/search/filterUtils.ts b/components/search/filter-utils.ts similarity index 98% rename from components/search/filterUtils.ts rename to components/search/filter-utils.ts index 8eb8d46..8265e08 100644 --- a/components/search/filterUtils.ts +++ b/components/search/filter-utils.ts @@ -1,4 +1,4 @@ -import { CollegeObject, FilterValues } from "./search"; +import { CollegeObject, FilterValues } from "./Search"; export const startsAfter = ( start: string | undefined, diff --git a/components/search/filterComponents.tsx b/components/search/filterComponents.tsx index 2f72fd7..d8f3591 100644 --- a/components/search/filterComponents.tsx +++ b/components/search/filterComponents.tsx @@ -2,7 +2,7 @@ import React, { ChangeEvent, Dispatch, SetStateAction, useState } from "react"; import { FaCheck, FaChevronDown } from "react-icons/fa"; -import { CollegeObject } from "./search"; +import { CollegeObject } from "./Search"; interface FilterCheckboxProps { title: string; diff --git a/components/search/filters.tsx b/components/search/filters.tsx index 6a3f32e..e6f629a 100644 --- a/components/search/filters.tsx +++ b/components/search/filters.tsx @@ -6,7 +6,7 @@ import { UnitsFilter, } from "./filterComponents"; import { FaCircleXmark } from "react-icons/fa6"; -import { CollegeObject, FilterValues } from "./search"; +import { CollegeObject, FilterValues } from "./Search"; interface SearchFilterProps { handleClick: () => void; diff --git a/components/search/search.tsx b/components/search/search.tsx index 5f675fc..efc5db2 100644 --- a/components/search/search.tsx +++ b/components/search/search.tsx @@ -9,7 +9,7 @@ import SearchResults from "./searchResults"; import { FaFilter } from "react-icons/fa6"; import { SearchFilterPage, SearchFilters } from "./filters"; import SearchBlurb from "./blurb"; -import { filterData } from "./filterUtils"; +import { filterData } from "./filter-utils"; import { UNIVERSITY_GE } from "@/lib/constants"; import { analyticsEnum, logAnalytics } from "@/lib/analytics"; diff --git a/components/search/searchResults.tsx b/components/search/searchResults.tsx index bcd55c1..47b2272 100644 --- a/components/search/searchResults.tsx +++ b/components/search/searchResults.tsx @@ -1,6 +1,6 @@ import LazyLoad from "react-lazy-load"; import { FaUpRightFromSquare } from "react-icons/fa6"; -import { CollegeObject } from "./search"; +import { CollegeObject } from "./Search"; import Tags from "./tags"; interface SearchResultsProps { From 66aaaa382a2cdd27a54201bbd28aae141fc02efe Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 29 Dec 2023 09:57:03 -0800 Subject: [PATCH 05/12] fix: adjust type for start and end --- components/search/blurb.tsx | 9 ++++++--- components/search/filter-utils.ts | 13 ++++++++++--- components/search/filterComponents.tsx | 14 ++++++++------ components/search/filters.tsx | 2 +- components/search/search.tsx | 6 +++--- 5 files changed, 28 insertions(+), 16 deletions(-) diff --git a/components/search/blurb.tsx b/components/search/blurb.tsx index 7699438..c67d818 100644 --- a/components/search/blurb.tsx +++ b/components/search/blurb.tsx @@ -6,7 +6,7 @@ interface BlurbProps { data: CollegeObject[], filterValues: FilterValues, ) => CollegeObject[]; - data: CollegeObject[]; + data: CollegeObject[] | undefined; filterValues: FilterValues; searchUniversity: string; searchGE: string; @@ -26,10 +26,13 @@ const SearchBlurb = (props: BlurbProps) => {
We found{" "} - {filterData(data, filterValues).length} courses + {data ? filterData(data, filterValues).length : "x"} + courses {" "} that may articulate to{" "} - {searchUniversity} for{" "} + + {searchUniversity} + for{" "} {`${searchGE?.split( " ", )[0]} Category ${searchGE?.split(" ")[1]}`}{" "} diff --git a/components/search/filter-utils.ts b/components/search/filter-utils.ts index 8265e08..b4c78a5 100644 --- a/components/search/filter-utils.ts +++ b/components/search/filter-utils.ts @@ -13,8 +13,8 @@ export const startsAfter = ( ); }; -export const endsBefore = (end: string | undefined, result: CollegeObject) => { - if (end == undefined) return true; +export const endsBefore = (end: string, result: CollegeObject) => { + if (end == "") return true; return ( `2024-${result.endMonth.toString().padStart(2, "0")}-${result.endDay @@ -23,7 +23,14 @@ export const endsBefore = (end: string | undefined, result: CollegeObject) => { ); }; -export function filterData(data: CollegeObject[], filterValues: FilterValues) { +export function filterData( + data: CollegeObject[] | undefined, + filterValues: FilterValues, +) { + if (!data) { + return []; + } + const filteredResults = data.filter((result) => { const onlineFormat = (filterValues.format[0] && filterValues.format[1]) || diff --git a/components/search/filterComponents.tsx b/components/search/filterComponents.tsx index d8f3591..9b9819c 100644 --- a/components/search/filterComponents.tsx +++ b/components/search/filterComponents.tsx @@ -118,7 +118,7 @@ export const CalendarFilter = (props: CalendarFilterProps) => { interface InstitutionDropdownProps { defaultValue: string; - courses: CollegeObject[]; + courses: CollegeObject[] | undefined; onChange: Dispatch>; } @@ -139,13 +139,15 @@ export const InstitutionDropdown = (props: InstitutionDropdownProps) => { (course: CollegeObject) => course.sendingInstitution, ); - for (const college of sendingInstitutions) { - if (!uniqueColleges.includes(college)) { - uniqueColleges.push(college); + if (sendingInstitutions) { + for (const college of sendingInstitutions) { + if (!uniqueColleges.includes(college)) { + uniqueColleges.push(college); + } } - } - uniqueColleges.sort(); + uniqueColleges.sort(); + } return (
diff --git a/components/search/filters.tsx b/components/search/filters.tsx index e6f629a..3d1ec19 100644 --- a/components/search/filters.tsx +++ b/components/search/filters.tsx @@ -19,7 +19,7 @@ interface SearchFilterProps { setMin: Dispatch>; setMax: Dispatch>; filterValues: FilterValues; - courses: CollegeObject[]; + courses: CollegeObject[] | undefined; } export const SearchFilters = (props: SearchFilterProps) => { diff --git a/components/search/search.tsx b/components/search/search.tsx index efc5db2..8429343 100644 --- a/components/search/search.tsx +++ b/components/search/search.tsx @@ -43,8 +43,8 @@ export type FilterValues = { format: boolean[]; enrollment: boolean[]; available: boolean[]; - start: string | undefined; - end: string | undefined; + start: string; + end: string; institution: string; min: number; max: number; @@ -84,7 +84,7 @@ const Search = () => { const [sort, setSort] = useState("Default Sort"); - const [courses, setCourses] = useState([]); + const [courses, setCourses] = useState(); const [filterValues, setFilterValues] = useState({ format: format, From ca81804b248894e2f4ba38304c37df39da84c3a8 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 29 Dec 2023 09:57:27 -0800 Subject: [PATCH 06/12] fix: space in blurb --- components/search/blurb.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/components/search/blurb.tsx b/components/search/blurb.tsx index c67d818..0c16f2b 100644 --- a/components/search/blurb.tsx +++ b/components/search/blurb.tsx @@ -26,13 +26,11 @@ const SearchBlurb = (props: BlurbProps) => {
We found{" "} - {data ? filterData(data, filterValues).length : "x"} + {data ? filterData(data, filterValues).length : "x"}{" "} courses {" "} that may articulate to{" "} - - {searchUniversity} - for{" "} + {searchUniversity} for{" "} {`${searchGE?.split( " ", )[0]} Category ${searchGE?.split(" ")[1]}`}{" "} From e7af9ec12fd6b05fd8ee64bfce7f70a7ebdb9351 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 29 Dec 2023 10:03:24 -0800 Subject: [PATCH 07/12] chore: update metadata --- app/layout.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/layout.tsx b/app/layout.tsx index b1f8c00..115f7fb 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,8 +1,8 @@ import type { Metadata } from "next"; import { Inter } from "next/font/google"; import "./globals.css"; -import Header from "@/components/header"; -import Footer from "@/components/footer"; +import Header from "@/components/Header"; +import Footer from "@/components/Footer"; import GoogleAnalytics from "@/components/GoogleAnalytics"; import { Toaster } from "@/components/ui/toaster"; @@ -12,6 +12,7 @@ export const metadata: Metadata = { title: "GE-Z", description: "GE-Z sources data from Assist.org and CVC.edu to find the perfect community college courses for you to take.", + metadataBase: new URL("https://ge-z.vercel.app"), openGraph: { title: "GE-Z", description: From 02773bf0a7bcf5df96fa09135c1d091d4896cce5 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 29 Dec 2023 10:08:16 -0800 Subject: [PATCH 08/12] fix: git mv to rename files --- __tests__/search-filters.test.ts | 2 +- app/page.tsx | 2 +- app/search/page.tsx | 2 +- components/search/{blurb.tsx => Blurb.tsx} | 2 +- .../search/{filterComponents.tsx => FilterComponents.tsx} | 2 +- components/search/{filters.tsx => Filters.tsx} | 2 +- components/search/{search.tsx => Search.tsx} | 4 ++-- components/search/{searchResults.tsx => SearchResults.tsx} | 2 +- components/search/{tags.tsx => Tags.tsx} | 0 components/search/filter-utils.ts | 2 +- components/search/{queryDatabase.ts => query-db.ts} | 0 11 files changed, 10 insertions(+), 10 deletions(-) rename components/search/{blurb.tsx => Blurb.tsx} (97%) rename components/search/{filterComponents.tsx => FilterComponents.tsx} (99%) rename components/search/{filters.tsx => Filters.tsx} (98%) rename components/search/{search.tsx => Search.tsx} (99%) rename components/search/{searchResults.tsx => SearchResults.tsx} (99%) rename components/search/{tags.tsx => Tags.tsx} (100%) rename components/search/{queryDatabase.ts => query-db.ts} (100%) diff --git a/__tests__/search-filters.test.ts b/__tests__/search-filters.test.ts index e784d2a..fbe1ca1 100644 --- a/__tests__/search-filters.test.ts +++ b/__tests__/search-filters.test.ts @@ -1,4 +1,4 @@ -import { FilterValues } from "@/components/search/Search"; +import { FilterValues } from "@/components/search/search"; import { endsBefore, filterData, diff --git a/app/page.tsx b/app/page.tsx index fcafec2..fcd7f03 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,4 +1,4 @@ -import Hero from "@/components/hero/hero"; +import Hero from "@/components/hero/Hero"; export default function Home() { return ( diff --git a/app/search/page.tsx b/app/search/page.tsx index 75bde11..ecf1944 100644 --- a/app/search/page.tsx +++ b/app/search/page.tsx @@ -1,4 +1,4 @@ -import Search from "@/components/search/Search"; +import Search from "@/components/search/search"; import React from "react"; const SearchPage = () => { diff --git a/components/search/blurb.tsx b/components/search/Blurb.tsx similarity index 97% rename from components/search/blurb.tsx rename to components/search/Blurb.tsx index 0c16f2b..f7f8ce7 100644 --- a/components/search/blurb.tsx +++ b/components/search/Blurb.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { CollegeObject, FilterValues } from "./Search"; +import { CollegeObject, FilterValues } from "./search"; interface BlurbProps { filterData: ( diff --git a/components/search/filterComponents.tsx b/components/search/FilterComponents.tsx similarity index 99% rename from components/search/filterComponents.tsx rename to components/search/FilterComponents.tsx index 9b9819c..909d82d 100644 --- a/components/search/filterComponents.tsx +++ b/components/search/FilterComponents.tsx @@ -2,7 +2,7 @@ import React, { ChangeEvent, Dispatch, SetStateAction, useState } from "react"; import { FaCheck, FaChevronDown } from "react-icons/fa"; -import { CollegeObject } from "./Search"; +import { CollegeObject } from "./search"; interface FilterCheckboxProps { title: string; diff --git a/components/search/filters.tsx b/components/search/Filters.tsx similarity index 98% rename from components/search/filters.tsx rename to components/search/Filters.tsx index 3d1ec19..4ab0db7 100644 --- a/components/search/filters.tsx +++ b/components/search/Filters.tsx @@ -6,7 +6,7 @@ import { UnitsFilter, } from "./filterComponents"; import { FaCircleXmark } from "react-icons/fa6"; -import { CollegeObject, FilterValues } from "./Search"; +import { CollegeObject, FilterValues } from "./search"; interface SearchFilterProps { handleClick: () => void; diff --git a/components/search/search.tsx b/components/search/Search.tsx similarity index 99% rename from components/search/search.tsx rename to components/search/Search.tsx index 8429343..8f92fd1 100644 --- a/components/search/search.tsx +++ b/components/search/Search.tsx @@ -4,11 +4,11 @@ import React, { useEffect, useState } from "react"; import { DropdownComponentSearch } from "../DropdownComponent"; import { SortDropdown } from "./filterComponents"; import { useRouter, useSearchParams } from "next/navigation"; -import { queryDatabase } from "./queryDatabase"; +import { queryDatabase } from "./query-db"; import SearchResults from "./searchResults"; import { FaFilter } from "react-icons/fa6"; import { SearchFilterPage, SearchFilters } from "./filters"; -import SearchBlurb from "./blurb"; +import SearchBlurb from "./Blurb"; import { filterData } from "./filter-utils"; import { UNIVERSITY_GE } from "@/lib/constants"; diff --git a/components/search/searchResults.tsx b/components/search/SearchResults.tsx similarity index 99% rename from components/search/searchResults.tsx rename to components/search/SearchResults.tsx index 47b2272..bcd55c1 100644 --- a/components/search/searchResults.tsx +++ b/components/search/SearchResults.tsx @@ -1,6 +1,6 @@ import LazyLoad from "react-lazy-load"; import { FaUpRightFromSquare } from "react-icons/fa6"; -import { CollegeObject } from "./Search"; +import { CollegeObject } from "./search"; import Tags from "./tags"; interface SearchResultsProps { diff --git a/components/search/tags.tsx b/components/search/Tags.tsx similarity index 100% rename from components/search/tags.tsx rename to components/search/Tags.tsx diff --git a/components/search/filter-utils.ts b/components/search/filter-utils.ts index b4c78a5..b08c750 100644 --- a/components/search/filter-utils.ts +++ b/components/search/filter-utils.ts @@ -1,4 +1,4 @@ -import { CollegeObject, FilterValues } from "./Search"; +import { CollegeObject, FilterValues } from "./search"; export const startsAfter = ( start: string | undefined, diff --git a/components/search/queryDatabase.ts b/components/search/query-db.ts similarity index 100% rename from components/search/queryDatabase.ts rename to components/search/query-db.ts From d06be1a86436df6afbf61b7a7c0f0de56aa1f2f2 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 29 Dec 2023 10:12:50 -0800 Subject: [PATCH 09/12] fix: correct imports --- __tests__/search-filters.test.ts | 12 ++++++------ components/{footer.tsx => Footer.tsx} | 0 components/{header.tsx => Header.tsx} | 0 components/search/Blurb.tsx | 2 +- components/search/FilterComponents.tsx | 2 +- components/search/Filters.tsx | 4 ++-- components/search/Search.tsx | 6 +++--- components/search/SearchResults.tsx | 4 ++-- components/search/filter-utils.ts | 7 ++----- 9 files changed, 17 insertions(+), 20 deletions(-) rename components/{footer.tsx => Footer.tsx} (100%) rename components/{header.tsx => Header.tsx} (100%) diff --git a/__tests__/search-filters.test.ts b/__tests__/search-filters.test.ts index fbe1ca1..58934fa 100644 --- a/__tests__/search-filters.test.ts +++ b/__tests__/search-filters.test.ts @@ -1,4 +1,4 @@ -import { FilterValues } from "@/components/search/search"; +import { FilterValues } from "@/components/search/Search"; import { endsBefore, filterData, @@ -81,7 +81,7 @@ const defaultFilterValues: FilterValues = { enrollment: [false], available: [false], start: "2023-12-20", - end: undefined, + end: "", institution: "Any Institution", min: 0, max: 20, @@ -192,8 +192,8 @@ describe("Search Filters", () => { }); describe("Filter Utils' Time Utilities", () => { - test("startsAfter undefined", async () => { - const result = startsAfter(undefined, data.courses[0]); + test("startsAfter none", async () => { + const result = startsAfter("", data.courses[0]); expect(result).toBe(true); }); @@ -207,8 +207,8 @@ describe("Filter Utils' Time Utilities", () => { expect(result).toBe(false); }); - test("endsBefore undefined", async () => { - const result = endsBefore(undefined, data.courses[0]); + test("endsBefore none", async () => { + const result = endsBefore("", data.courses[0]); expect(result).toBe(true); }); diff --git a/components/footer.tsx b/components/Footer.tsx similarity index 100% rename from components/footer.tsx rename to components/Footer.tsx diff --git a/components/header.tsx b/components/Header.tsx similarity index 100% rename from components/header.tsx rename to components/Header.tsx diff --git a/components/search/Blurb.tsx b/components/search/Blurb.tsx index f7f8ce7..0c16f2b 100644 --- a/components/search/Blurb.tsx +++ b/components/search/Blurb.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { CollegeObject, FilterValues } from "./search"; +import { CollegeObject, FilterValues } from "./Search"; interface BlurbProps { filterData: ( diff --git a/components/search/FilterComponents.tsx b/components/search/FilterComponents.tsx index 909d82d..9b9819c 100644 --- a/components/search/FilterComponents.tsx +++ b/components/search/FilterComponents.tsx @@ -2,7 +2,7 @@ import React, { ChangeEvent, Dispatch, SetStateAction, useState } from "react"; import { FaCheck, FaChevronDown } from "react-icons/fa"; -import { CollegeObject } from "./search"; +import { CollegeObject } from "./Search"; interface FilterCheckboxProps { title: string; diff --git a/components/search/Filters.tsx b/components/search/Filters.tsx index 4ab0db7..4f0ec75 100644 --- a/components/search/Filters.tsx +++ b/components/search/Filters.tsx @@ -4,9 +4,9 @@ import { CustomFilterCheckbox, InstitutionDropdown, UnitsFilter, -} from "./filterComponents"; +} from "./FilterComponents"; import { FaCircleXmark } from "react-icons/fa6"; -import { CollegeObject, FilterValues } from "./search"; +import { CollegeObject, FilterValues } from "./Search"; interface SearchFilterProps { handleClick: () => void; diff --git a/components/search/Search.tsx b/components/search/Search.tsx index 8f92fd1..bd0deb4 100644 --- a/components/search/Search.tsx +++ b/components/search/Search.tsx @@ -2,12 +2,12 @@ import React, { useEffect, useState } from "react"; import { DropdownComponentSearch } from "../DropdownComponent"; -import { SortDropdown } from "./filterComponents"; +import { SortDropdown } from "./FilterComponents"; import { useRouter, useSearchParams } from "next/navigation"; import { queryDatabase } from "./query-db"; -import SearchResults from "./searchResults"; +import SearchResults from "./SearchResults"; import { FaFilter } from "react-icons/fa6"; -import { SearchFilterPage, SearchFilters } from "./filters"; +import { SearchFilterPage, SearchFilters } from "./Filters"; import SearchBlurb from "./Blurb"; import { filterData } from "./filter-utils"; import { UNIVERSITY_GE } from "@/lib/constants"; diff --git a/components/search/SearchResults.tsx b/components/search/SearchResults.tsx index bcd55c1..ce1509b 100644 --- a/components/search/SearchResults.tsx +++ b/components/search/SearchResults.tsx @@ -1,7 +1,7 @@ import LazyLoad from "react-lazy-load"; import { FaUpRightFromSquare } from "react-icons/fa6"; -import { CollegeObject } from "./search"; -import Tags from "./tags"; +import { CollegeObject } from "./Search"; +import Tags from "./Tags"; interface SearchResultsProps { results: CollegeObject[]; diff --git a/components/search/filter-utils.ts b/components/search/filter-utils.ts index b08c750..c67dbbc 100644 --- a/components/search/filter-utils.ts +++ b/components/search/filter-utils.ts @@ -1,9 +1,6 @@ -import { CollegeObject, FilterValues } from "./search"; +import { CollegeObject, FilterValues } from "./Search"; -export const startsAfter = ( - start: string | undefined, - result: CollegeObject, -) => { +export const startsAfter = (start: string, result: CollegeObject) => { if (start == undefined) return true; return ( From 9e7205a8fb3f8ef7ebf7d31ca04033ea1ec6540a Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 29 Dec 2023 10:14:38 -0800 Subject: [PATCH 10/12] chore: rename hero to Hero --- components/hero/{hero.tsx => Hero.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename components/hero/{hero.tsx => Hero.tsx} (100%) diff --git a/components/hero/hero.tsx b/components/hero/Hero.tsx similarity index 100% rename from components/hero/hero.tsx rename to components/hero/Hero.tsx From 694c4ac791021d13ae807af56a068fe252bec676 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 29 Dec 2023 10:15:16 -0800 Subject: [PATCH 11/12] chore: fix Search import --- app/search/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/search/page.tsx b/app/search/page.tsx index ecf1944..75bde11 100644 --- a/app/search/page.tsx +++ b/app/search/page.tsx @@ -1,4 +1,4 @@ -import Search from "@/components/search/search"; +import Search from "@/components/search/Search"; import React from "react"; const SearchPage = () => { From 5c4771d7f77e994fa96e6a256b1f023719b49b25 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 29 Dec 2023 10:22:31 -0800 Subject: [PATCH 12/12] fix: undo w-full, h-full --- components/search/FilterComponents.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/search/FilterComponents.tsx b/components/search/FilterComponents.tsx index 9b9819c..d09126c 100644 --- a/components/search/FilterComponents.tsx +++ b/components/search/FilterComponents.tsx @@ -91,7 +91,7 @@ export const CalendarFilter = (props: CalendarFilterProps) => {
@@ -104,7 +104,7 @@ export const CalendarFilter = (props: CalendarFilterProps) => {