mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-06-04 16:46:57 +02:00
add modal support, showModal->showContextMenu and new showModal
This commit is contained in:
11
src/deck-components/Menu.tsx
Normal file → Executable file
11
src/deck-components/Menu.tsx
Normal file → Executable file
@@ -1,7 +1,16 @@
|
||||
import { FC } from 'react';
|
||||
import { FC, ReactNode } from 'react';
|
||||
|
||||
import { findModuleChild } from '../webpack';
|
||||
|
||||
export const showContextMenu: (children: ReactNode, parent?: EventTarget) => void = findModuleChild((m) => {
|
||||
if (typeof m !== 'object') return undefined;
|
||||
for (let prop in m) {
|
||||
if (typeof m[prop] === 'function' && m[prop].toString().includes('stopPropagation))')) {
|
||||
return m[prop];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
interface MenuProps {
|
||||
label: string;
|
||||
onCancel?(): void;
|
||||
|
||||
Reference in New Issue
Block a user