@privy-io/react-auth
Version:
React client for the Privy Auth API
2 lines (1 loc) • 2.63 kB
JavaScript
import{jsxs as t,Fragment as e,jsx as o}from"react/jsx-runtime";import{useRef as r}from"react";import{c as i,B as n}from"./ModalHeader-BnVmXtvG.mjs";import{F as s}from"./Layouts-BlFm53ED.mjs";import{t as a}from"./FundWalletMethodHeader-Cb-ACySl.mjs";import{N as m}from"./index-Dq_xe9dz.mjs";import{T as c}from"./Title-BnzYV3Is.mjs";import{a as l}from"./privy-context-DrMxzgOR.mjs";import{u as p}from"./useGetTokenPrice-LPJMl6JV.mjs";import{c as d}from"./ethers-Dnv1tMN3.mjs";import{F as u,a as h,h as j,c as f,d as v}from"./styles-DDaGxKdi.mjs";import"styled-components";import"./context-DLtU3JQy.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./useWallets-BzNCTucF.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@privy-io/are-addresses-equal";import"./useGetSolPrice-DwwjjGbd.mjs";import"./LinkPasskeyScreen-DmtRo8xi.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-D1p_ntex.mjs";import"./Screen-Cycy3IzT.mjs";const y={component:()=>{let{data:y,setModalData:C}=l(),g=y?.funding,x="solana"===g.chainType,k=r(null),{tokenPrice:S}=p(x?"solana":g.chain.id),D=x?void 0:g,F=!(!D?.erc20Address||D?.erc20ContractInfo),T=x?g.isUSDC?"USDC":"SOL":g.erc20Address?g.erc20ContractInfo?.symbol:g.chain.nativeCurrency.symbol||"ETH",L=parseFloat(g.amount),A=!isNaN(L)&&L>0,I=S?d(g.amount,S):void 0;/*#__PURE__*/return t(e,{children:[/*#__PURE__*/o(a,{}),/*#__PURE__*/o(c,{children:"Confirm or edit amount"}),/*#__PURE__*/t(s,{style:{marginTop:"32px"},children:[/*#__PURE__*/o(u,{children:F?/*#__PURE__*/o(m,{size:"50px"}):/*#__PURE__*/t(e,{children:[/*#__PURE__*/t(h,{onClick:()=>k.current?.focus(),children:[/*#__PURE__*/o(j,{ref:k,value:g.amount,onChange:t=>{let e=t.target.value;/^[0-9.]*$/.test(e)&&e.split(".").length-1<=1&&C({...y,funding:{...g,amount:e},solanaFundingData:y?.solanaFundingData?{...y.solanaFundingData,amount:e}:void 0})}}),/*#__PURE__*/o(f,{children:T})]}),!D?.erc20Address&&!(x&&g.isUSDC)&&/*#__PURE__*/o(v,{children:I&&A?`${I} USD`:""})]})}),/*#__PURE__*/o(i,{style:{marginTop:"1rem"},disabled:!A,onClick:g.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/o(n,{})]})}};export{y as FundingAmountEditScreen,y as default};