UNPKG

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

20 lines (16 loc) 768 B
import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider' import { ExpansionType, HiddenUI } from '../types/widget' import { useExpansionRoutes } from './useExpansionRoutes' import { useSwapOnly } from './useSwapOnly' export const useHasChainExpansion = () => { const { hiddenUI, subvariantOptions } = useWidgetConfig() const swapOnly = useSwapOnly() const expansionType = useExpansionRoutes() const withChainExpansion = (expansionType === ExpansionType.FromChain || expansionType === ExpansionType.ToChain) && !(swapOnly && expansionType === ExpansionType.ToChain) && !hiddenUI?.includes(HiddenUI.ChainSelect) && !!subvariantOptions?.wide?.enableChainSidebar return [withChainExpansion, expansionType] as const }