Skip to content

Commit 6f31b91

Browse files
committed
cleanup
1 parent 54b3614 commit 6f31b91

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

frontend/src/ts/components/TextButton.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { JSXElement } from "solid-js";
1+
import { JSXElement, Show } from "solid-js";
22

33
export function TextButton(props: {
44
icon?: string;
@@ -13,9 +13,11 @@ export function TextButton(props: {
1313
textButton: props.class === undefined,
1414
[props.class ?? ""]: props.class !== undefined,
1515
}}
16-
onClick={props.onClick}
16+
onClick={() => props.onClick?.()}
1717
>
18-
{props.icon !== undefined && <i class={`fas fa-fw ${props.icon}`} />}
18+
<Show when={props.icon !== undefined}>
19+
<i class={`fas fa-fw ${props.icon}`}></i>
20+
</Show>
1921
{props.children}
2022
</button>
2123
);

0 commit comments

Comments
 (0)