From 334268b5ee0aaf6b36481c802b42e47f029c5cc9 Mon Sep 17 00:00:00 2001 From: Ari Date: Tue, 24 May 2022 21:31:54 -0400 Subject: [PATCH] deprecated textarea --- .../AutomationEditor/AutoInfoBox.tsx | 3 +- webapp/src/components/Inputs/InputText.tsx | 6 ++- .../Inputs/InputTextArea.stories.tsx | 25 --------- .../src/components/Inputs/InputTextArea.tsx | 54 ------------------- 4 files changed, 6 insertions(+), 82 deletions(-) delete mode 100644 webapp/src/components/Inputs/InputTextArea.stories.tsx delete mode 100644 webapp/src/components/Inputs/InputTextArea.tsx diff --git a/webapp/src/components/AutomationEditor/AutoInfoBox.tsx b/webapp/src/components/AutomationEditor/AutoInfoBox.tsx index 89da26b..3f4f753 100644 --- a/webapp/src/components/AutomationEditor/AutoInfoBox.tsx +++ b/webapp/src/components/AutomationEditor/AutoInfoBox.tsx @@ -2,7 +2,6 @@ import "./AutoInfoBox.css"; import { AutomationMetadata } from "types/automations"; import { InputList } from "components/Inputs/InputList"; import InputText from "components/Inputs/InputText"; -import InputTextArea from "components/Inputs/InputTextArea"; import { FC, useRef, useState } from 'react'; import { AddIcon, TrashIcon } from "components/Icons"; import { Button } from "components/Inputs/Button"; @@ -81,7 +80,7 @@ export const AutoInfoBox: FC = ({
- + void; onEnter?: () => void; additionalTooltipFilters?: Record; + multiline?: boolean; + maxRows?: number; } export default function InputText({ label, @@ -17,11 +19,13 @@ export default function InputText({ onChange, onEnter = () => { }, additionalTooltipFilters = {}, + multiline = false, + maxRows = 4, children, }: PropsWithChildren) { const tooltip = useToolTip(); const [isFocused, setIsFocused] = useState(false) - return { if (e.key === 'Enter') { onEnter(); diff --git a/webapp/src/components/Inputs/InputTextArea.stories.tsx b/webapp/src/components/Inputs/InputTextArea.stories.tsx deleted file mode 100644 index 1b8ebc0..0000000 --- a/webapp/src/components/Inputs/InputTextArea.stories.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentMeta, ComponentStory } from "@storybook/react"; -import { Page } from "components/Page"; -import { useState } from "react"; - -import InputTextArea from "./InputTextArea"; - -export default { - title: 'Inputs/InputTextArea', - component: InputTextArea, - parameters: { actions: { argTypesRegex: '^on.*' } }, -} as ComponentMeta; - - -const Template: ComponentStory = args => { - - const [value, setValue] = useState('') - return - - -} - -export const SimpleText = Template.bind({}) -SimpleText.args = { - label: "Entity ID", -} diff --git a/webapp/src/components/Inputs/InputTextArea.tsx b/webapp/src/components/Inputs/InputTextArea.tsx deleted file mode 100644 index ca99be5..0000000 --- a/webapp/src/components/Inputs/InputTextArea.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { useState } from "react"; -import { useToolTip } from "tooltip/context"; -import InputWrapper from "./InputWrapper"; -import { useInputTextAreaStyles } from "./styles"; - -export interface Props { - textBoxFor?: string; - label: string; - value: string; - onChange: (v: string) => void; - additionalTooltipFilters?: Record; - error?: string; - resizable?: boolean; -} -export default function InputTextArea({ - label, - textBoxFor, - value = "", - onChange, - error, - additionalTooltipFilters = {}, - resizable = false, -}: Props) { - const { classes } = useInputTextAreaStyles({ resizable }); - const tooltip = useToolTip(); - const [isFocused, setIsFocused] = useState(false) - return -