diff options
author | Sebastian <sebasjm@gmail.com> | 2023-03-13 00:24:28 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-03-13 00:24:28 -0300 |
commit | 3267f56dc3de054a7dbdd6cd83305b92cf16bd61 (patch) | |
tree | 5f3b77915e5bc9af05bfeed30436e70b372e3d21 /packages/merchant-backoffice-ui/src/components | |
parent | a1af7945d17d40b33aeaf3894ed348b083f98f9a (diff) | |
download | wallet-core-3267f56dc3de054a7dbdd6cd83305b92cf16bd61.tar.xz |
show/hide key
Diffstat (limited to 'packages/merchant-backoffice-ui/src/components')
-rw-r--r-- | packages/merchant-backoffice-ui/src/components/form/InputWithAddon.tsx | 2 | ||||
-rw-r--r-- | packages/merchant-backoffice-ui/src/components/modal/index.tsx | 31 |
2 files changed, 21 insertions, 12 deletions
diff --git a/packages/merchant-backoffice-ui/src/components/form/InputWithAddon.tsx b/packages/merchant-backoffice-ui/src/components/form/InputWithAddon.tsx index e5118c722..dbf4e2409 100644 --- a/packages/merchant-backoffice-ui/src/components/form/InputWithAddon.tsx +++ b/packages/merchant-backoffice-ui/src/components/form/InputWithAddon.tsx @@ -23,7 +23,7 @@ import { InputProps, useField } from "./useField.js"; export interface Props<T> extends InputProps<T> { expand?: boolean; - inputType?: "text" | "number"; + inputType?: "text" | "number" | "password"; addonBefore?: ComponentChildren; addonAfter?: ComponentChildren; toStr?: (v?: any) => string; diff --git a/packages/merchant-backoffice-ui/src/components/modal/index.tsx b/packages/merchant-backoffice-ui/src/components/modal/index.tsx index c9c7d0ce5..875e89e92 100644 --- a/packages/merchant-backoffice-ui/src/components/modal/index.tsx +++ b/packages/merchant-backoffice-ui/src/components/modal/index.tsx @@ -20,7 +20,7 @@ */ import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; -import { ComponentChildren, h, VNode } from "preact"; +import { ComponentChildren, Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; import { useInstanceContext } from "../../context/instance.js"; import { DEFAULT_REQUEST_TIMEOUT } from "../../utils/constants.js"; @@ -65,16 +65,25 @@ export function ConfirmModal({ <section class="modal-card-body">{children}</section> <footer class="modal-card-foot"> <div class="buttons is-right" style={{ width: "100%" }}> - <button class="button " onClick={onCancel}> - <i18n.Translate>Cancel</i18n.Translate> - </button> - <button - class={danger ? "button is-danger " : "button is-info "} - disabled={disabled} - onClick={onConfirm} - > - <i18n.Translate>{label}</i18n.Translate> - </button> + {onConfirm ? ( + <Fragment> + <button class="button " onClick={onCancel}> + <i18n.Translate>Cancel</i18n.Translate> + </button> + + <button + class={danger ? "button is-danger " : "button is-info "} + disabled={disabled} + onClick={onConfirm} + > + <i18n.Translate>{label}</i18n.Translate> + </button> + </Fragment> + ) : ( + <button class="button " onClick={onCancel}> + <i18n.Translate>Close</i18n.Translate> + </button> + )} </div> </footer> </div> |