@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
3 lines (2 loc) • 1.04 kB
JavaScript
import{a as p}from"./chunk-ZNE6V7ED.js";import{a as l}from"./chunk-QFG5WK6W.js";import{a as s}from"./chunk-IH3L5EEJ.js";import{a as d}from"./chunk-KE2WE66O.js";import{g as a,h as S}from"./chunk-C32UB6VS.js";import{m as i}from"./chunk-HBP5N4FR.js";i();S();import o,{useState as x}from"react";var H=({token:g,callbackRoute:m,children:u,onModalOpens:e,onModalCloses:n,loginButtonText:L="Ledger",buttonClassName:f="dapp-ledger-login-button",className:h="dapp-ledger-login",modalClassName:c,wrapContentInsideModal:T=!0,hideButtonWhenModalOpens:b=!1,onLoginRedirect:B,disabled:C})=>{let N=d(),[t,r]=x(!1),{handleShowModal:y,handleHideModal:w}=s();function I(){if(N)throw new Error(a);r(!0),y(),e==null||e()}function R(){r(!1),w(),n==null||n()}return o.createElement(o.Fragment,null,(!b||!t)&&o.createElement(l,{onLogin:I,className:h,btnClassName:f,text:L,disabled:C},u),t&&o.createElement(p,{className:c,callbackRoute:m,token:g,wrapContentInsideModal:T,onClose:R,onLoginRedirect:B}))};export{H as a};
//# sourceMappingURL=chunk-Z6EEROFL.js.map