diff options
author | Sebastian <sebasjm@gmail.com> | 2022-06-24 11:42:21 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-06-24 11:42:21 -0300 |
commit | 50379a1d5b89822dd32618c32433cf12d1a1779e (patch) | |
tree | f6851306ed7bb39429f5336ece0151fee128631f /packages/taler-wallet-webextension/src/mui/Button.tsx | |
parent | b06ae62de00a536525eac342c3dcb99d45c9eb86 (diff) | |
download | wallet-core-50379a1d5b89822dd32618c32433cf12d1a1779e.tar.xz |
mui menu, select input inprogress
Diffstat (limited to 'packages/taler-wallet-webextension/src/mui/Button.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/mui/Button.tsx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/taler-wallet-webextension/src/mui/Button.tsx b/packages/taler-wallet-webextension/src/mui/Button.tsx index 7afa3643c..a7657ae29 100644 --- a/packages/taler-wallet-webextension/src/mui/Button.tsx +++ b/packages/taler-wallet-webextension/src/mui/Button.tsx @@ -16,11 +16,11 @@ import { ComponentChildren, h, VNode, JSX } from "preact"; import { css } from "@linaria/core"; // eslint-disable-next-line import/extensions -import { theme, ripple, Colors, rippleOutlined } from "./style"; +import { theme, Colors, rippleEnabled, rippleEnabledOutlined } from "./style"; // eslint-disable-next-line import/extensions import { alpha } from "./colors/manipulation"; -const buttonBaseStyle = css` +export const buttonBaseStyle = css` display: inline-flex; align-items: center; justify-content: center; @@ -318,6 +318,7 @@ interface BaseProps extends JSX.HTMLAttributes<HTMLButtonElement> { onClick?: () => Promise<void>; containedRipple?: boolean; children?: ComponentChildren; + svg?: any; } function ButtonBase({ @@ -325,7 +326,7 @@ function ButtonBase({ children, containedRipple, onClick, - dangerouslySetInnerHTML, + svg, ...rest }: BaseProps): VNode { function doClick(): void { @@ -334,14 +335,14 @@ function ButtonBase({ const classNames = [ buttonBaseStyle, _class, - containedRipple ? ripple : rippleOutlined, + containedRipple ? rippleEnabled : rippleEnabledOutlined, ].join(" "); - if (dangerouslySetInnerHTML) { + if (svg) { return ( <button onClick={doClick} class={classNames} - dangerouslySetInnerHTML={dangerouslySetInnerHTML} + dangerouslySetInnerHTML={{ __html: svg }} {...rest} /> ); @@ -375,7 +376,7 @@ export function IconButton({ fill: currentColor; `, ].join(" ")} - dangerouslySetInnerHTML={{ __html: svg }} + svg={svg} /> ); } |