diff --git a/src/app/[id]/apply/confirmation/page.tsx b/src/app/[id]/apply/confirmation/page.tsx index f99c799..14eb5e0 100644 --- a/src/app/[id]/apply/confirmation/page.tsx +++ b/src/app/[id]/apply/confirmation/page.tsx @@ -11,20 +11,17 @@ import ErrorPage from "@/src/app/error/page"; // types import { College } from "@/src/app/types"; -const filterCollege = (institutionsArray: College[], id: number) => { - return institutionsArray.filter((college) => college.id == id)[0]; -}; - export default function ConfirmationPage({ params }: Props) { - const { institutionsArray } = useContext(InstitutionContext); + const { institutionsObject } = useContext(InstitutionContext); const [loading, setLoading] = useState(true); const [selectedCollege, setSelectedCollege] = useState(); + useEffect(() => { - if (institutionsArray) { - setSelectedCollege(filterCollege(institutionsArray!, params.id)); + if (institutionsObject) { + setSelectedCollege(institutionsObject[params.id]); setLoading(false); } - }, [institutionsArray, params.id]); + }, [institutionsObject, params.id]); const View = !selectedCollege ? ( diff --git a/src/app/[id]/page.tsx b/src/app/[id]/page.tsx index 507b105..065ccf9 100644 --- a/src/app/[id]/page.tsx +++ b/src/app/[id]/page.tsx @@ -11,30 +11,26 @@ import NotFound from "@/src/app/not-found"; // types import { College } from "../types"; -const filterCollege = (institutionsArray: College[], id: number) => { - return institutionsArray.filter((college) => college.id == id)[0]; -}; - export default function InstitutionDetails({ params, }: { params: { id: number }; }) { - const { institutionsArray } = useContext(InstitutionContext); + const { institutionsObject } = useContext(InstitutionContext); const [loading, setLoading] = useState(true); const [selectedCollege, setSelectedCollege] = useState(); useEffect(() => { - if (institutionsArray) { - setSelectedCollege(filterCollege(institutionsArray!, params.id)); + if (institutionsObject) { + setSelectedCollege(institutionsObject[params.id]); setLoading(false); } - }, [institutionsArray, params.id]); + }, [institutionsObject, params.id]); const View = !selectedCollege ? ( ) : (
    - +
); diff --git a/src/app/assets/icons/arrow_upward.svg b/src/app/assets/icons/arrow_upward.svg deleted file mode 100644 index 3c4ac73..0000000 --- a/src/app/assets/icons/arrow_upward.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/src/app/components/cards/BannerCard.tsx b/src/app/components/cards/BannerCard.tsx index a35e18d..1629830 100644 --- a/src/app/components/cards/BannerCard.tsx +++ b/src/app/components/cards/BannerCard.tsx @@ -21,13 +21,13 @@ import { //types import { College } from "../../types"; -export const BannerCard = ({ college }: Props) => { +export const BannerCard = ({ college, id }: Props) => { return (
{ mixpanel.track("click_launch-application")} aria-label={`Apply to ${college.name}`} > @@ -79,4 +79,5 @@ export const BannerCard = ({ college }: Props) => { type Props = { college: College; + id: number; }; diff --git a/src/app/components/form/AppForm.tsx b/src/app/components/form/AppForm.tsx index e9d5da0..7e1b093 100644 --- a/src/app/components/form/AppForm.tsx +++ b/src/app/components/form/AppForm.tsx @@ -76,7 +76,7 @@ export const AppForm = ({ institutionId }: Props) => { const ApplicationView = !application ? ( ) : ( -
+
{