From c47d16fa3063deddf52c797240dd4ff1e66977e5 Mon Sep 17 00:00:00 2001 From: Joshua Coles Date: Fri, 13 Oct 2023 17:56:02 +0100 Subject: [PATCH] Abstract to allow for different select components --- src/App.tsx | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 8f3096b..8347939 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,7 +4,7 @@ import Select, {createFilter, MenuListProps} from "react-select"; import * as R from 'ramda'; import {useQuery} from "@tanstack/react-query"; -import {Alias, CustomAlias, LinkCollection, Option} from "./aliases"; +import {LinkCollection, Option} from "./aliases"; // TODO: Fix this for wrapping items, esp on phones const height = 35; @@ -36,7 +36,9 @@ function MenuList(props: MenuListProps) { ); } -export function LargeSelect() { +function NaiveSelect({setSelected}: { + setSelected: (value: Option) => void +}) { const { data: options, isLoading, @@ -55,25 +57,31 @@ export function LargeSelect() { }, }); - const [selected, setSelected] = useState