From f4f798b1b4bae3073b669a562fd2b3a7880dffc3 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 15 May 2023 11:45:23 -0300 Subject: second form --- .../src/forms/InputChoice.tsx | 119 --------------------- 1 file changed, 119 deletions(-) delete mode 100644 packages/exchange-backoffice-ui/src/forms/InputChoice.tsx (limited to 'packages/exchange-backoffice-ui/src/forms/InputChoice.tsx') diff --git a/packages/exchange-backoffice-ui/src/forms/InputChoice.tsx b/packages/exchange-backoffice-ui/src/forms/InputChoice.tsx deleted file mode 100644 index 0e1b32cba..000000000 --- a/packages/exchange-backoffice-ui/src/forms/InputChoice.tsx +++ /dev/null @@ -1,119 +0,0 @@ -import { TranslatedString } from "@gnu-taler/taler-util"; -import { Fragment, VNode, h } from "preact"; -import { LabelWithTooltipMaybeRequired, UIFormProps } from "./InputLine.js"; -import { useField } from "./useField.js"; - -function classNames(...classes: string[]): string { - return classes.filter(Boolean).join(" "); -} -const memoryOptions = [ - { name: "4 GB", inStock: true }, - { name: "8 GB", inStock: true }, - { name: "16 GB", inStock: true }, - { name: "32 GB", inStock: true }, - { name: "64 GB", inStock: true }, - { name: "128 GB", inStock: false }, -]; - -export interface Choice { - label: TranslatedString; - description?: TranslatedString; - value: string; -} - -export function InputChoiceStacked( - props: { - choices: Choice[]; - } & UIFormProps, -): VNode { - const { - choices, - name, - label, - tooltip, - placeholder, - required, - before, - after, - converter, - } = props; - const { value, onChange, state, isDirty } = useField(name); - if (state.hidden) { - return ; - } - - return ( -
- -
- {value !== undefined && !required && ( -
-
- -
-
- )} - -
- {choices.map((choice) => { - let clazz = - "border relative block cursor-pointer rounded-lg bg-white px-6 py-4 shadow-sm focus:outline-none sm:flex sm:justify-between"; - if (choice.value === value) { - clazz += - " border-transparent border-indigo-600 ring-2 ring-indigo-600"; - } else { - clazz += " border-gray-300"; - } - return ( - - ); - })} -
-
-
- ); -} -- cgit v1.2.3