mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-18 17:10:09 +02:00
fix(components): fix missing components on oct 2 2024 beta
This commit is contained in:
@@ -28,9 +28,12 @@ export const DialogCheckbox = Object.values(
|
||||
}),
|
||||
).find(
|
||||
(m: any) =>
|
||||
m.contextType &&
|
||||
m.prototype?.render.toString().includes('fallback:') &&
|
||||
m?.prototype?.SetChecked &&
|
||||
m?.prototype?.Toggle &&
|
||||
m?.prototype?.GetPanelElementProps,
|
||||
m?.prototype?.GetPanelElementProps &&
|
||||
// beta || stable as of oct 2 2024
|
||||
(m?.prototype?.render?.toString().includes('="DialogCheckbox"') || (
|
||||
m.contextType &&
|
||||
m.prototype?.render.toString().includes('fallback:')
|
||||
))
|
||||
) as FC<DialogCheckboxProps>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { FC, ReactNode } from 'react';
|
||||
|
||||
import { findSP } from '../utils';
|
||||
import { Export, findModule, findModuleByExport, findModuleExport } from '../webpack';
|
||||
import { Export, findModule, findModuleDetailsByExport, findModuleExport } from '../webpack';
|
||||
|
||||
// All of the popout options + strTitle are related. Proper usage is not yet known...
|
||||
export interface ShowModalProps {
|
||||
@@ -105,7 +105,7 @@ interface SimpleModalProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
const ModalModule = findModuleByExport((e: Export) => e?.toString().includes('.ModalPosition,fallback:'), 5);
|
||||
const [ModalModule, _ModalPosition] = findModuleDetailsByExport((e: Export) => e?.toString().includes('.ModalPosition'), 5)
|
||||
|
||||
const ModalModuleProps = ModalModule ? Object.values(ModalModule) : [];
|
||||
|
||||
@@ -114,6 +114,4 @@ export const SimpleModal = ModalModuleProps.find((prop) => {
|
||||
return string?.includes('.ShowPortalModal()') && string?.includes('.OnElementReadyCallbacks.Register(');
|
||||
}) as FC<SimpleModalProps>;
|
||||
|
||||
export const ModalPosition = ModalModuleProps.find((prop) =>
|
||||
prop?.toString().includes('.ModalPosition,fallback:'),
|
||||
) as FC<SimpleModalProps>;
|
||||
export const ModalPosition = _ModalPosition as FC<SimpleModalProps>;
|
||||
|
||||
@@ -29,5 +29,6 @@ export interface SliderFieldProps extends ItemProps {
|
||||
}
|
||||
|
||||
export const SliderField = Object.values(CommonUIModule).find((mod: any) =>
|
||||
mod?.toString()?.includes('SliderField,fallback'),
|
||||
// stable || beta as of oct 2 2024
|
||||
mod?.toString()?.includes('SliderField,fallback') || mod?.toString()?.includes("SliderField\",")
|
||||
) as FC<SliderFieldProps>;
|
||||
|
||||
@@ -11,5 +11,6 @@ export interface ToggleFieldProps extends ItemProps {
|
||||
}
|
||||
|
||||
export const ToggleField = Object.values(CommonUIModule).find((mod: any) =>
|
||||
mod?.render?.toString()?.includes('ToggleField,fallback'),
|
||||
// stable || beta as of oct 2 2024
|
||||
mod?.render?.toString()?.includes('ToggleField,fallback') || mod?.render?.toString()?.includes("ToggleField\",")
|
||||
) as FC<ToggleFieldProps>;
|
||||
|
||||
Reference in New Issue
Block a user