Skip to content

Commit

Permalink
feat(Menu): add more missing props (SteamDeckHomebrew#60) [CI SKIP]
Browse files Browse the repository at this point in the history
* feat(Menu): extend FooterLegendProps

* feat(MenuItem): add more missing props
  • Loading branch information
doZennn authored Nov 29, 2022
1 parent 07d15f5 commit 678ba21
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/deck-components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { FC, ReactNode } from 'react';

import { fakeRenderComponent } from '../utils';
import { findModuleChild } from '../webpack';
import { FooterLegendProps } from './FooterLegend';

export const showContextMenu: (children: ReactNode, parent?: EventTarget) => void = findModuleChild((m) => {
if (typeof m !== 'object') return undefined;
Expand All @@ -12,7 +13,7 @@ export const showContextMenu: (children: ReactNode, parent?: EventTarget) => voi
}
});

export interface MenuProps {
export interface MenuProps extends FooterLegendProps {
label: string;
onCancel?(): void;
cancelText?: string;
Expand Down Expand Up @@ -49,13 +50,16 @@ export const MenuGroup: FC<MenuGroupProps> = findModuleChild((m) => {
}
});

export interface MenuItemProps {
export interface MenuItemProps extends FooterLegendProps {
bInteractableItem?: boolean;
onClick?(evt: Event): void;
onSelected?(evt: Event): void;
onMouseEnter?(evt: MouseEvent): void;
onMoveRight?(): void;
selected?: boolean;
disabled?: boolean;
bPlayAudio?: boolean;
tone?: 'positive' | 'emphasis' | 'destructive';
children?: ReactNode;
}

Expand Down

0 comments on commit 678ba21

Please sign in to comment.