@lifi/widget
Version:
LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.
19 lines (15 loc) • 509 B
text/typescript
import type { WidgetTheme, WidgetThemeComponents } from '../types/widget.js'
type ComponentName = keyof WidgetThemeComponents
export const getStyleOverrides = (
componentName: ComponentName,
styleOverrideProp: string,
theme: WidgetTheme,
ownerState?: any
) => {
const component = theme.components?.[componentName]
const property = (component?.styleOverrides as any)?.[styleOverrideProp]
if (typeof property === 'function') {
return property({ theme, ownerState })
}
return property
}