diff options
Diffstat (limited to 'packages/merchant-backoffice-ui/src/components/exception')
3 files changed, 42 insertions, 20 deletions
| diff --git a/packages/merchant-backoffice-ui/src/components/exception/AsyncButton.tsx b/packages/merchant-backoffice-ui/src/components/exception/AsyncButton.tsx index b234ce847..510bc29b8 100644 --- a/packages/merchant-backoffice-ui/src/components/exception/AsyncButton.tsx +++ b/packages/merchant-backoffice-ui/src/components/exception/AsyncButton.tsx @@ -15,9 +15,9 @@   */  /** -* -* @author Sebastian Javier Marchano (sebasjm) -*/ + * + * @author Sebastian Javier Marchano (sebasjm) + */  import { ComponentChildren, h } from "preact";  import { LoadingModal } from "../modal/index.js"; @@ -25,10 +25,10 @@ import { useAsync } from "../../hooks/async.js";  import { Translate } from "../../i18n/index.js";  type Props = { -  children: ComponentChildren, +  children: ComponentChildren;    disabled: boolean;    onClick?: () => Promise<void>; -  [rest:string]: any, +  [rest: string]: any;  };  export function AsyncButton({ onClick, disabled, children, ...rest }: Props) { @@ -38,12 +38,18 @@ export function AsyncButton({ onClick, disabled, children, ...rest }: Props) {      return <LoadingModal onCancel={cancel} />;    }    if (isLoading) { -    return <button class="button"><Translate>Loading...</Translate></button>; +    return ( +      <button class="button"> +        <Translate>Loading...</Translate> +      </button> +    );    } -  return <span {...rest}> -    <button class="button is-success" onClick={request} disabled={disabled}> -      {children} -    </button> -  </span>; +  return ( +    <span {...rest}> +      <button class="button is-success" onClick={request} disabled={disabled}> +        {children} +      </button> +    </span> +  );  } diff --git a/packages/merchant-backoffice-ui/src/components/exception/loading.tsx b/packages/merchant-backoffice-ui/src/components/exception/loading.tsx index 9c9b4daae..a043b81eb 100644 --- a/packages/merchant-backoffice-ui/src/components/exception/loading.tsx +++ b/packages/merchant-backoffice-ui/src/components/exception/loading.tsx @@ -15,18 +15,34 @@   */  /** -* -* @author Sebastian Javier Marchano (sebasjm) -*/ + * + * @author Sebastian Javier Marchano (sebasjm) + */  import { h, VNode } from "preact";  export function Loading(): VNode { -  return <div class="columns is-centered is-vcentered" style={{ height: 'calc(100% - 3rem)', position: 'absolute', width: '100%' }}> -    <Spinner /> -  </div> +  return ( +    <div +      class="columns is-centered is-vcentered" +      style={{ +        height: "calc(100% - 3rem)", +        position: "absolute", +        width: "100%", +      }} +    > +      <Spinner /> +    </div> +  );  }  export function Spinner(): VNode { -  return <div class="lds-ring"><div /><div /><div /><div /></div> -}
\ No newline at end of file +  return ( +    <div class="lds-ring"> +      <div /> +      <div /> +      <div /> +      <div /> +    </div> +  ); +} diff --git a/packages/merchant-backoffice-ui/src/components/exception/login.tsx b/packages/merchant-backoffice-ui/src/components/exception/login.tsx index c2af2a83a..d1898915d 100644 --- a/packages/merchant-backoffice-ui/src/components/exception/login.tsx +++ b/packages/merchant-backoffice-ui/src/components/exception/login.tsx @@ -46,7 +46,7 @@ export function LoginModal({ onConfirm, withMessage }: Props): VNode {    const { url: backendUrl, token: baseToken } = useBackendContext();    const { admin, token: instanceToken } = useInstanceContext();    const currentToken = getTokenValuePart( -    !admin ? baseToken : instanceToken || "" +    !admin ? baseToken : instanceToken || "",    );    const [token, setToken] = useState(currentToken); | 
