diff --git a/__tests__/search-filters.test.ts b/__tests__/search-filters.test.ts index ee78c82..828713a 100644 --- a/__tests__/search-filters.test.ts +++ b/__tests__/search-filters.test.ts @@ -1,9 +1,5 @@ import { FilterValues } from "@/components/search/Search"; -import { - endsBefore, - filterData, - startsAfter, -} from "@/components/search/filter-utils"; +import { endsBefore, filterData, startsAfter } from "@/lib/utils/filter"; import "@testing-library/jest-dom"; const data = { diff --git a/components/search/Search.tsx b/components/search/Search.tsx index c074f9e..9acd274 100644 --- a/components/search/Search.tsx +++ b/components/search/Search.tsx @@ -1,15 +1,15 @@ "use client"; import React, { useEffect, useState } from "react"; -import { SortDropdown } from "./FilterComponents"; +import { SortDropdown } from "./filter/FilterComponents"; import { useRouter, useSearchParams } from "next/navigation"; -import { queryDatabase } from "./query-db"; +import { queryDatabase } from "../../lib/utils/query-db"; import SearchResults from "./SearchResults"; import ScrollToTop from "./ScrollToTop"; import { FaFilter } from "react-icons/fa6"; -import { SearchFilterPage, SearchFilters } from "./Filters"; +import { SearchFilterPage, SearchFilters } from "./filter/Filters"; import Blurb from "./Blurb"; -import { filterData } from "./filter-utils"; +import { filterData } from "../../lib/utils/filter"; import { UNIVERSITY_GE } from "@/lib/constants"; import { analyticsEnum, logAnalytics } from "@/lib/analytics"; @@ -17,6 +17,7 @@ import { useToast } from "../ui/use-toast"; import { ToastAction } from "../ui/toast"; import Link from "next/link"; import { SearchSelect } from "./SearchSelect"; +import { getDismissedRecently, getNumSearches } from "@/lib/utils/search"; export interface CollegeObject { sendingInstitution: string; @@ -52,6 +53,38 @@ export type FilterValues = { sort: string; }; +const FILTER_PAGE_BREAKPOINT = 1280; + +const LoadingState = () => { + return ( +