From 9be04b18bab391760b54a2b29c619f745a754407 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 19 Apr 2024 00:12:53 -0700 Subject: [PATCH] fix: correct example handling wrong urls --- components/hero/Examples.tsx | 6 +++--- components/search/Search.tsx | 2 +- components/search/SearchSelect.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/hero/Examples.tsx b/components/hero/Examples.tsx index 5421893..52006e9 100644 --- a/components/hero/Examples.tsx +++ b/components/hero/Examples.tsx @@ -25,21 +25,21 @@ const EXAMPLES: Example[] = [ geText: "GE IV - Arts and Humanities", institution: "UCI", ge: "IV", - link: "/search?uni=UCI&ge=GE%20IV", + link: "/search?uni=University%20of%20California%2C%20Irvine&ge=GE%20IV", }, { name: "UCLA", geText: "Life Sciences", institution: "UCLA", ge: "Scientific Inquiry: Life Sciences", - link: "search?uni=UCLA&ge=Scientific%20Inquiry%3A%20Life%20Sciences", + link: "search?uni=University%20of%20California%2C%20Los%20Angeles&ge=Scientific%20Inquiry%3A%20Life%20Sciences", }, { name: "UC Santa Barbara", geText: "GE E - Culture and Thought", institution: "UCSB", ge: "E", - link: "/search?uni=UCSB&ge=GE%20E", + link: "/search?uni=University%20of%20California%2C%20Santa%20Barbara&ge=GE%20E", }, ]; diff --git a/components/search/Search.tsx b/components/search/Search.tsx index 0ce880d..b666912 100644 --- a/components/search/Search.tsx +++ b/components/search/Search.tsx @@ -255,7 +255,7 @@ const Search = () => { category: analyticsEnum.search.title, action: analyticsEnum.search.actions.SEARCH, label: university, - value: UNIVERSITY_GE[university].findIndex((item) => { + value: UNIVERSITY_GE[university]?.findIndex((item) => { return item.includes(ge); }), }); diff --git a/components/search/SearchSelect.tsx b/components/search/SearchSelect.tsx index ea4d92c..05593ed 100644 --- a/components/search/SearchSelect.tsx +++ b/components/search/SearchSelect.tsx @@ -10,7 +10,7 @@ import { export interface DropdownComponentProps { value: string; - data: string[]; + data?: string[]; onChange: (university: string) => void; placeholder?: string; } @@ -25,7 +25,7 @@ export const SearchSelect = (props: DropdownComponentProps) => { - {data.map((item) => { + {data?.map((item) => { let option = item; if (option.includes("University of California")) {