mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-21 10:29:00 +02:00
Add back panels
This commit is contained in:
@@ -18,10 +18,12 @@ interface ButtonProps {
|
||||
onSubmit?(e: SubmitEvent): void;
|
||||
}
|
||||
|
||||
const DialogButton = Object.values(CommonUIModule).find((mod: any) =>
|
||||
mod?.render?.toString()?.includes('Object.assign({type:"button"') && mod?.render?.toString()?.includes('DialogButton')
|
||||
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<ButtonProps> // its actually a forwarded ref but that doesn't really matter in usage
|
||||
export const Button = DialogButton!.render({}).type as FC<ButtonProps>; // its actually a forwarded ref but that doesn't really matter in usage
|
||||
|
||||
23
src/deck-components/Panel.tsx
Normal file
23
src/deck-components/Panel.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { FC } from 'react';
|
||||
|
||||
import { findModuleChild } from '../webpack';
|
||||
|
||||
interface PanelSectionProps {
|
||||
title?: string;
|
||||
spinner?: boolean;
|
||||
}
|
||||
|
||||
const [panelSection, mod] = findModuleChild((mod: any) => {
|
||||
for (let prop in mod) {
|
||||
if (mod[prop]?.toString()?.includes('.PanelSection')) {
|
||||
return [mod[prop], mod];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
export const PanelSection = panelSection as FC<PanelSectionProps>;
|
||||
|
||||
export const PanelSectionRow = Object.values(mod).filter(
|
||||
(exp: any) => !exp?.toString()?.includes('.PanelSection'),
|
||||
)[0] as FC;
|
||||
@@ -2,6 +2,7 @@ export * from './Button';
|
||||
export * from './ButtonItem';
|
||||
export * from './Menu';
|
||||
export * from './Modal';
|
||||
export * from './Panel';
|
||||
export * from './Slider';
|
||||
export * from './Spinner';
|
||||
export * from './static-classes';
|
||||
|
||||
Reference in New Issue
Block a user