Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/client/components/ui/components/design/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Show, createRenderEffect, on, splitProps } from "solid-js";
import { Show, createRenderEffect, mergeProps, on, splitProps } from "solid-js";
import { JSX } from "solid-js/jsx-runtime";

import { AriaButtonProps, createButton } from "@solid-aria/button";
import { cva } from "styled-system/css/cva";

import { debounce } from "@revolt/common";
Comment thread
Pecacheu marked this conversation as resolved.
import { Ripple } from "./Ripple";
import { typography } from "./Text";

Expand Down Expand Up @@ -89,7 +90,7 @@ export function Button(props: Props) {
"role",
]);

const [style, rest] = splitProps(propsRest, [
const [style, noSty] = splitProps(propsRest, [
"bg",
"size",
"shape",
Expand Down Expand Up @@ -118,6 +119,12 @@ export function Button(props: Props) {
),
);

const [btn, noBtnRest] = splitProps(noSty, ["onPress"]);

// eslint-disable-next-line @typescript-eslint/no-explicit-any, solid/reactivity
Comment thread
Pecacheu marked this conversation as resolved.
const onPress = debounce((e: any) => btn.onPress?.(e), 100),
rest = mergeProps(noBtnRest, { onPress });

const { buttonProps } = createButton(rest, () => ref);
return (
<button
Expand Down
Loading