From 1cb84d23ff0de4811591af20fd118d368af94137 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Wed, 3 Apr 2024 10:19:22 -0700 Subject: [PATCH] chore: remove unused hero --- components/DropdownComponent.tsx | 34 ---------- components/hero/Hero.tsx | 103 ------------------------------- 2 files changed, 137 deletions(-) delete mode 100644 components/hero/Hero.tsx diff --git a/components/DropdownComponent.tsx b/components/DropdownComponent.tsx index 05af086..25b2ea3 100644 --- a/components/DropdownComponent.tsx +++ b/components/DropdownComponent.tsx @@ -7,40 +7,6 @@ export interface DropdownComponentProps { onChange: any; // FIX ME } -export const DropdownComponentHero = (props: DropdownComponentProps) => { - const { defaultValue, data, onChange } = props; - - const [value, setValue] = useState(defaultValue); - - const handleChange = (e: ChangeEvent) => { - onChange(e.target.value); - setValue(e.target.value); - }; - - return ( -
-
- -
- -
-
-
- ); -}; - export const DropdownComponentSearch = (props: DropdownComponentProps) => { const { defaultValue, data, onChange } = props; diff --git a/components/hero/Hero.tsx b/components/hero/Hero.tsx deleted file mode 100644 index 256617f..0000000 --- a/components/hero/Hero.tsx +++ /dev/null @@ -1,103 +0,0 @@ -"use client"; - -import { UNIVERSITY_GE } from "@/lib/constants"; -import React, { ChangeEvent, FormEvent, useState } from "react"; -import { FaChevronDown, FaSearch } from "react-icons/fa"; -import { useRouter } from "next/navigation"; -import { analyticsEnum, logAnalytics } from "@/lib/analytics"; -import { DropdownComponentHero } from "../DropdownComponent"; - -interface DropdownComponentProps { - defaultValue: string; - data: string[]; - onChange: (value: string) => void; -} - -const Hero = () => { - const router = useRouter(); - - const [university, setUniversity] = useState(Object.keys(UNIVERSITY_GE)[0]); - const [ge, setGE] = useState(UNIVERSITY_GE[university][0]); - - const handleSubmit = (e: FormEvent) => { - e.preventDefault(); - - logAnalytics({ - category: analyticsEnum.search.title, - action: analyticsEnum.search.actions.SEARCH, - label: university, - value: UNIVERSITY_GE[university].findIndex((item) => { - return item.includes(ge); - }), - }); - - router.push( - `/search?uni=${encodeURIComponent( - university, - )}&ge=${encodeURIComponent(ge)}`, - ); - }; - - return ( - <> -
-
- Find the - -  Perfect CC  - - Course -
- -
- Data sourced from{" "} - - Assist.org - {" "} - and{" "} - - CVC.edu - -
- -
-
- - -
- -
- -
-
-
- - ); -}; - -export default Hero;