Liquidity Modal

Usage

import {
  LiquidityModal,
  ElementsProvider,
  WalletType,
  Tabs,
  TabsConfig
} from '@leapwallet/elements'
import { useState } from 'react'

import '@leapwallet/elements/styles.css'

const YourDapp = () => {
  const [isOpen, setIsOpen] = useState(false)
  
  // trigger the dApp's connect wallet flow
  const connectWallet = () => {}
  
  // set this to the currently connected wallet
  const connectedWalletType = WalletType.LEAP
  
  return (
    <div className="leap-ui">
      <button onClick={() => setIsOpen(true)}>
        Open Liquidity Modal
      </button>
      <ElementsProvider
        connectWallet={connectWallet}
        connectedWalletType={connectedWalletType}
      >
        <LiquidityModal />
      </WalletClientContextProvider>
    </div>
  )
}

Props

isOpen (required)

A state variable for the open state of the modal

setIsOpen (required)

A function to change the open state of the modal.

All props of the LiquidityView component are supported in LiquidityModal

Last updated