@privy-io/react-auth
Version:
React client for the Privy Auth API
2 lines (1 loc) • 2.68 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-D8-mhjp4.mjs";import{F as s}from"./Layouts-BlFm53ED.mjs";import{t as a}from"./FundWalletMethodHeader-Cfci4-83.mjs";import{N as m}from"./index-Dq_xe9dz.mjs";import{T as c}from"./Title-BnzYV3Is.mjs";import{a as l}from"./get-is-unified-wallet-Boa8DYrQ.mjs";import{u as p}from"./useGetTokenPrice-BPBpM07F.mjs";import{c as d}from"./ethers-D1WT71Ay.mjs";import{F as u,a as h,h as j,c as f,d as v}from"./styles-BmZHuqSX.mjs";import"styled-components";import"./context-WTldtXS8.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-3RHPIBxJ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-CV4p7L0b.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"eventemitter3";import"viem/utils";import"./useWallets-CR0z5IIt.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.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-OxaghvUl.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-DTmQLGPf.mjs";import"./Screen-Bp-TN9gb.mjs";const y={component:()=>{let{data:y,setModalData:C}=l(),g=y?.funding,k="solana"===g.chainType,x=r(null),{tokenPrice:S}=p(k?"solana":g.chain.id),D=k?void 0:g,F=!(!D?.erc20Address||D?.erc20ContractInfo),T=k?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:()=>x.current?.focus(),children:[/*#__PURE__*/o(j,{ref:x,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&&!(k&&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};