From 6f2f11e686e468df84993fc8f354bbef3a74ff85 Mon Sep 17 00:00:00 2001 From: Igor Papandinas Date: Sun, 21 Jan 2024 02:38:44 +0100 Subject: [PATCH] chore: Useless components removed --- app/explore/[slug]/page.tsx | 2 +- components/bounties.tsx | 58 ------------------------------ components/search.tsx | 72 ------------------------------------- 3 files changed, 1 insertion(+), 131 deletions(-) delete mode 100644 components/bounties.tsx delete mode 100644 components/search.tsx diff --git a/app/explore/[slug]/page.tsx b/app/explore/[slug]/page.tsx index 1741b13..5079f03 100644 --- a/app/explore/[slug]/page.tsx +++ b/app/explore/[slug]/page.tsx @@ -1,4 +1,4 @@ -import { Metadata, ResolvingMetadata } from "next"; +import { Metadata } from "next"; import ContributionsTable from "@/components/table/table"; import { DEFAULT_PAGE_SIZE } from "@/data/fetch"; import { queryDatabase } from "@/lib/notion"; diff --git a/components/bounties.tsx b/components/bounties.tsx deleted file mode 100644 index 316bd20..0000000 --- a/components/bounties.tsx +++ /dev/null @@ -1,58 +0,0 @@ -"use client"; -import React, { FC } from "react"; -import { Button } from "@nextui-org/button"; -import { - Dropdown, - DropdownTrigger, - DropdownMenu, - DropdownItem, -} from "@nextui-org/dropdown"; -import { Slider } from "@nextui-org/slider"; -import { ChevronOpenIcon } from "@/assets/icons"; -import Emoji from "./emoji"; - -interface BountiesProps { - currency: string; - emoji: string; - defaultValue: number; - maxValue: number; -} - -const Bounties: FC = ({ - currency, - defaultValue, - maxValue, - emoji, -}) => { - const formatOptions = { style: "currency", currency }; - return ( - - - - - - - - - - - ); -}; - -export default Bounties; diff --git a/components/search.tsx b/components/search.tsx deleted file mode 100644 index f5025a2..0000000 --- a/components/search.tsx +++ /dev/null @@ -1,72 +0,0 @@ -"use client"; -import React, { FC, useEffect } from "react"; -import { Autocomplete, AutocompleteItem } from "@nextui-org/autocomplete"; -import { FilterOption } from "@/types/filters"; -import Emoji from "./emoji"; -import { useRouter } from "next/navigation"; -import { usePathname, useSearchParams } from "next/navigation"; -import { createUrl } from "@/utils/url"; - -interface SearchProps { - placeholder: string; - emoji: string; - items: FilterOption[]; - selectedValue?: string; -} - -const Search: FC = ({ - placeholder, - emoji, - items, - selectedValue, -}: SearchProps) => { - const [value, setValue] = React.useState(selectedValue); - - const router = useRouter(); - const pathname = usePathname(); - const params = useSearchParams(); - - useEffect(() => { - setValue(selectedValue || ""); - }, [selectedValue]); - - useEffect(() => { - if (value === undefined || value === "") { - return; - } - const newUrl = createUrl(placeholder, [value], pathname); - router.replace(newUrl, { scroll: false }); - }, [params, pathname, placeholder, router, value]); - - return ( - } - className="max-w-md" - size="lg" - selectedKey={value} - // onSelectionChange={setValue} - allowsCustomValue={true} - clearButtonProps={{ - id: "clear-button", - }} - selectorButtonProps={{ - id: "selector-button", - }} - > - {(item: FilterOption) => { - return ( - - -   - {item.label} - - ); - }} - - ); -}; - -export default Search;