@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.
14 lines (11 loc) • 493 B
text/typescript
import type { Theme } from '@mui/material'
import { useMediaQuery } from '@mui/material'
import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
const defaultExpandableWidth = 852
export const useWideVariant = () => {
const { variant, useRecommendedRoute } = useWidgetConfig()
const expandableAllowed = useMediaQuery((theme: Theme) =>
theme.breakpoints.up(defaultExpandableWidth)
)
return variant === 'wide' && expandableAllowed && !useRecommendedRoute
}