fix(DialogHeader): valve rewrote component on beta, update filter to search for both versions

This commit is contained in:
AAGaming
2025-08-20 15:35:17 -04:00
parent ed87f73602
commit 37dd88513e

View File

@@ -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>;