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.

22 lines 1.16 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { forwardRef, useImperativeHandle, useRef, useState } from 'react'; import { BottomSheet } from '../BottomSheet/BottomSheet.js'; import { TokenDetailsSheetContent } from './TokenDetailsSheetContent.js'; export const TokenDetailsSheet = forwardRef(({ chainId }, ref) => { const bottomSheetRef = useRef(null); const [tokenAddress, setTokenAddress] = useState(undefined); const [withoutContractAddress, setWithoutContractAddress] = useState(false); useImperativeHandle(ref, () => ({ isOpen: () => bottomSheetRef.current?.isOpen(), open: (address, noContractAddress) => { setTokenAddress(address); setWithoutContractAddress(noContractAddress); bottomSheetRef.current?.open(); }, close: () => { bottomSheetRef.current?.close(); }, }), []); return (_jsx(BottomSheet, { ref: bottomSheetRef, children: _jsx(TokenDetailsSheetContent, { ref: ref, tokenAddress: tokenAddress, withoutContractAddress: withoutContractAddress, chainId: chainId }) })); }); //# sourceMappingURL=TokenDetailsSheet.js.map