added input text view + moved things

This commit is contained in:
Ari Sosnovsky committed 2021-11-12 14:09:00 -05:00
1 parent 9694ffb238
commit 54c1edba0c
17 files changed
+166 -121

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
import { useToolTip } from "~/tooltip/context";
import InputWrapper from "./InputWrapper";
export interface Props {
textBoxFor?: string;
label: string;
value: string;
onChange: (v: string) => void;
additionalTooltipFilters?: Record<string, string>;
}
export default function InputText({
label,
textBoxFor,
value="",
onChange,
additionalTooltipFilters={},
}: Props) {
const tooltip = useToolTip();
return <InputWrapper label={label}>
<input
value={value}
onChange={e => {
e.preventDefault();
onChange(e.target.value)
}}
onFocus={e => textBoxFor && tooltip.setFocus(
e.target.getBoundingClientRect(),
{
searchObject: textBoxFor,
searchText: value,
filterObjects: additionalTooltipFilters,
},
onChange
)}
/>
</InputWrapper>
}