From 29201fadafff6bdaa0f8fe7d7806cfa88ec545ab Mon Sep 17 00:00:00 2001 From: AAGaming Date: Sun, 18 Sep 2022 15:01:40 -0400 Subject: [PATCH] fix(Button): add types to DialogButton also remove useless Button component. --- src/deck-components/Button.tsx | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/deck-components/Button.tsx b/src/deck-components/Button.tsx index 24dd10e..f4c06a7 100644 --- a/src/deck-components/Button.tsx +++ b/src/deck-components/Button.tsx @@ -2,29 +2,20 @@ import { CSSProperties, FC } from 'react'; import { CommonUIModule } from '../webpack'; -export interface ButtonProps { +export interface DialogButtonProps { + label?: string; style: CSSProperties; className?: string; noFocusRing?: boolean; - disabled?: boolean; + description?: string; + layout?: 'below'; onClick?(e: MouseEvent): void; - onPointerDown?(e: PointerEvent): void; - onPointerUp?(e: PointerEvent): void; - onPointerCancel?(e: PointerEvent): void; - onMouseDown?(e: PointerEvent): void; - onMouseUp?(e: MouseEvent): void; - onTouchStart?(e: TouchEvent): void; - onTouchEnd?(e: TouchEvent): void; - onTouchCancel?(e: TouchEvent): void; - onSubmit?(e: SubmitEvent): void; + disabled?: boolean; + bottomSeparator?: boolean; } export const DialogButton = Object.values(CommonUIModule).find( (mod: any) => mod?.render?.toString()?.includes('Object.assign({type:"button"') && mod?.render?.toString()?.includes('DialogButton'), -) as any; - -// Button isn't exported, so call DialogButton to grab it - -export const Button = DialogButton!.render({}).type as FC; // its actually a forwarded ref but that doesn't really matter in usage +) as FC; \ No newline at end of file