@privy-io/react-auth
Version:
React client for the Privy Auth API
2 lines (1 loc) • 2.52 kB
JavaScript
import{jsxs as t,Fragment as o,jsx as e}from"react/jsx-runtime";import{useRef as r}from"react";import{a as i}from"./Button-CrJpeX0e.mjs";import{F as n}from"./Layouts-Bmf8DxNP.mjs";import{B as a}from"./ModalHeader-YP9pLMEP.mjs";import{t as m}from"./FundWalletMethodHeader-DBV2Rnau.mjs";import{N as s}from"./index-CJMgUOnw.mjs";import{T as l}from"./Title-D0pfZff-.mjs";import{a as c}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{u as p}from"./useGetTokenPrice-Cw9UgOp3.mjs";import{c as d}from"./ethers-DnpKeAXc.mjs";import{F as u,a as h,h as f,c as j,d as g}from"./styles-DY17fuAX.mjs";import"styled-components";import"./useActiveWallet-BdFIc7_K.mjs";import"zustand";import"./context-BOoFAPna.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.mjs";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-3r4yfFNg.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"./useGetSolPrice-Cfm8o9C5.mjs";const v={component:()=>{let{data:v,setModalData:C}=c(),y=v?.funding,D="solana"===y.chainType,k=r(null),{tokenPrice:x}=p(D?"solana":y.chain.id),F=D?void 0:y,T=!(!F?.erc20Address||F?.erc20ContractInfo),A=D?y.isUSDC?"USDC":"SOL":y.erc20Address?y.erc20ContractInfo?.symbol:y.chain.nativeCurrency.symbol||"ETH",I=parseFloat(y.amount),M=!isNaN(I)&&I>0,S=x?d(y.amount,x):void 0;/*#__PURE__*/return t(o,{children:[/*#__PURE__*/e(m,{}),/*#__PURE__*/e(l,{children:"Confirm or edit amount"}),/*#__PURE__*/t(n,{style:{marginTop:"32px"},children:[/*#__PURE__*/e(u,{children:T?/*#__PURE__*/e(s,{size:"50px"}):/*#__PURE__*/t(o,{children:[/*#__PURE__*/t(h,{onClick:()=>k.current?.focus(),children:[/*#__PURE__*/e(f,{ref:k,value:y.amount,onChange:t=>{let o=t.target.value;/^[0-9.]*$/.test(o)&&o.split(".").length-1<=1&&C({...v,funding:{...y,amount:o},solanaFundingData:v?.solanaFundingData?{...v.solanaFundingData,amount:o}:void 0})}}),/*#__PURE__*/e(j,{children:A})]}),!F?.erc20Address&&!(D&&y.isUSDC)&&/*#__PURE__*/e(g,{children:S&&M?`${S} USD`:""})]})}),/*#__PURE__*/e(i,{style:{marginTop:"1rem"},disabled:!M,onClick:y.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/e(a,{})]})}};export{v as FundingAmountEditScreen,v as default};