diff options
author | Sebastian <sebasjm@gmail.com> | 2021-06-10 23:51:14 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-06-10 23:55:04 -0300 |
commit | c9c04a14be4bf9a70cd1730d2e8b5aa8bd38f032 (patch) | |
tree | c59f0b0906f97ffe2c8394cfb963c778b82ad244 /packages/frontend/src/components/exception/AsyncButton.tsx | |
parent | 352e23dbbc9a83b522964f3ba7fb06295d38c835 (diff) | |
download | merchant-backoffice-c9c04a14be4bf9a70cd1730d2e8b5aa8bd38f032.tar.gz merchant-backoffice-c9c04a14be4bf9a70cd1730d2e8b5aa8bd38f032.tar.bz2 merchant-backoffice-c9c04a14be4bf9a70cd1730d2e8b5aa8bd38f032.zip |
lots of fixes in same commit
added tooltips in buttons and fix tooltips styles in corner cases
added a start for required fields
token -> access token
fixed query product list
refactor instance update/create form
some more comments from christian email
Diffstat (limited to 'packages/frontend/src/components/exception/AsyncButton.tsx')
-rw-r--r-- | packages/frontend/src/components/exception/AsyncButton.tsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/frontend/src/components/exception/AsyncButton.tsx b/packages/frontend/src/components/exception/AsyncButton.tsx index 95e4e72..3dad3e0 100644 --- a/packages/frontend/src/components/exception/AsyncButton.tsx +++ b/packages/frontend/src/components/exception/AsyncButton.tsx @@ -25,12 +25,12 @@ import { useAsync } from "../../hooks/async"; import { Translate } from "../../i18n"; type Props = { - children: ComponentChildren, + children: ComponentChildren, disabled: boolean; onClick?: () => Promise<void>; }; -export function AsyncButton({ onClick, disabled, children }: Props) { +export function AsyncButton({ onClick, disabled, children, ...rest }: Props) { const { isSlow, isLoading, request, cancel } = useAsync(onClick); if (isSlow) { @@ -40,7 +40,9 @@ export function AsyncButton({ onClick, disabled, children }: Props) { return <button class="button"><Translate>Loading...</Translate></button>; } - return <button class="button is-success" onClick={request} disabled={disabled}> - {children} - </button>; + return <span {...rest}> + <button class="button is-success" onClick={request} disabled={disabled}> + {children} + </button> + </span>; } |