We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54b3614 commit 6f31b91Copy full SHA for 6f31b91
frontend/src/ts/components/TextButton.tsx
@@ -1,4 +1,4 @@
1
-import { JSXElement } from "solid-js";
+import { JSXElement, Show } from "solid-js";
2
3
export function TextButton(props: {
4
icon?: string;
@@ -13,9 +13,11 @@ export function TextButton(props: {
13
textButton: props.class === undefined,
14
[props.class ?? ""]: props.class !== undefined,
15
}}
16
- onClick={props.onClick}
+ onClick={() => props.onClick?.()}
17
>
18
- {props.icon !== undefined && <i class={`fas fa-fw ${props.icon}`} />}
+ <Show when={props.icon !== undefined}>
19
+ <i class={`fas fa-fw ${props.icon}`}></i>
20
+ </Show>
21
{props.children}
22
</button>
23
);
0 commit comments