Grabbed dndbeyond's source code
``` ~/go/bin/sourcemapper -output ddb -jsurl https://media.dndbeyond.com/character-app/static/js/main.90aa78c5.js ```
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
import resolveProps from '@mui/utils/resolveProps';
|
||||
export default function getThemeProps(params) {
|
||||
const {
|
||||
theme,
|
||||
name,
|
||||
props
|
||||
} = params;
|
||||
if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {
|
||||
return props;
|
||||
}
|
||||
return resolveProps(theme.components[name].defaultProps, props);
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
'use client';
|
||||
|
||||
import getThemeProps from './getThemeProps';
|
||||
import useTheme from '../useTheme';
|
||||
export default function useThemeProps({
|
||||
props,
|
||||
name,
|
||||
defaultTheme,
|
||||
themeId
|
||||
}) {
|
||||
let theme = useTheme(defaultTheme);
|
||||
if (themeId) {
|
||||
theme = theme[themeId] || theme;
|
||||
}
|
||||
const mergedProps = getThemeProps({
|
||||
theme,
|
||||
name,
|
||||
props
|
||||
});
|
||||
return mergedProps;
|
||||
}
|
||||
Reference in New Issue
Block a user