mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-19 09:30:08 +02:00
fix(DialogHeader): valve rewrote component on beta, update filter to search for both versions
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { CSSProperties, FC, ReactNode, RefAttributes } from 'react';
|
||||
|
||||
import { CommonUIModule } from '../webpack';
|
||||
import { CommonUIModule, Module } from '../webpack';
|
||||
import { FooterLegendProps } from './FooterLegend';
|
||||
|
||||
export interface DialogCommonProps extends RefAttributes<HTMLDivElement> {
|
||||
@@ -68,7 +68,12 @@ const MappedDialogDivs = new Map(
|
||||
}),
|
||||
);
|
||||
|
||||
export const DialogHeader = MappedDialogDivs.get('DialogHeader') as FC<DialogCommonProps>;
|
||||
// Old | New
|
||||
export const DialogHeader = (MappedDialogDivs.get('DialogHeader') || Object.values(CommonUIModule).find((component: Module) => {
|
||||
const str = component?.render?.toString?.();
|
||||
return str?.includes("role:\"heading\"") && str.includes(")(\"DialogHeader\",");
|
||||
})) as FC<DialogCommonProps>;
|
||||
|
||||
export const DialogSubHeader = MappedDialogDivs.get('DialogSubHeader') as FC<DialogCommonProps>;
|
||||
export const DialogFooter = MappedDialogDivs.get('DialogFooter') as FC<DialogCommonProps>;
|
||||
export const DialogLabel = MappedDialogDivs.get('DialogLabel') as FC<DialogCommonProps>;
|
||||
|
||||
Reference in New Issue
Block a user