@privy-io/react-auth
Version:
React client for the Privy Auth API
10 lines (9 loc) • 3.76 kB
JavaScript
"use strict";var e=require("react/jsx-runtime"),r=require("lucide-react"),i=require("styled-components"),t=require("./privy-context-CrM9_s6G.js"),n=require("./ScreenLayout-C4QHZMbl.js"),o=require("./index-DchMyzt9.js");require("@privy-io/are-addresses-equal"),require("react"),require("./context-Cg3IEi80.js"),require("@privy-io/js-sdk-core"),require("tinycolor2"),require("./internal-context-BJv4f_bO.js"),require("ofetch"),require("./ModalHeader-C5Wuo3-1.js"),require("./useActiveWallet-BfMD5hzE.js"),require("zustand"),require("react-device-detect"),require("./use-export-wallet-_EIyxyle.js"),require("./useWallets-dikDynAG.js"),require("viem"),require("eventemitter3"),require("viem/utils"),require("./events-context-Di6--rDg.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./Screen-DWnRbzSA.js"),require("./index-ByFhjjzH.js"),require("uuid"),require("jose"),require("@coinbase/wallet-sdk"),require("@privy-io/ethereum"),require("mipd"),require("@privy-io/popup"),require("./paths-DizMb-lU.js"),require("./usePrivy-C-Rab7yP.js"),require("@scure/base"),require("@headlessui/react"),require("@walletconnect/ethereum-provider"),require("@privy-io/urls"),require("./PrivyPluginContext-DsgaS6n9.js"),require("./getEmbeddedConnectedWallet-pJd-l936.js"),require("js-cookie"),require("./frame-Oz7volks.js"),require("@privy-io/routes"),require("x402/client"),require("@privy-io/api-base"),require("viem/accounts"),require("./use-sign-with-user-signer-Cu_6Bx7m.js");const s=r=>/*#__PURE__*/e.jsx("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"-0.625 12.48 397.647 399.546",width:"2500",height:"674",preserveAspectRatio:"none",...r,children:/*#__PURE__*/e.jsx("g",{children:/*#__PURE__*/e.jsx("path",{fill:"#333745",d:"M 333.9 12.8 L 150.9 12.8 L 150.9 258.4 L 396.5 258.4 L 396.5 76.7 C 396.6 42.2 368.4 12.8 333.9 12.8 Z M 94.7 12.8 L 64 12.8 C 29.5 12.8 0 40.9 0 76.8 L 0 107.5 L 94.7 107.5 L 94.7 12.8 Z M 0 165 L 94.7 165 L 94.7 259.7 L 0 259.7 L 0 165 Z M 301.9 410.6 L 332.6 410.6 C 367.1 410.6 396.6 382.5 396.6 346.6 L 396.6 316 L 301.9 316 L 301.9 410.6 Z M 150.9 316 L 245.6 316 L 245.6 410.7 L 150.9 410.7 L 150.9 316 Z M 0 316 L 0 346.7 C 0 381.2 28.1 410.7 64 410.7 L 94.7 410.7 L 94.7 316 L 0 316 Z"})})}),u=({onContinueWithLedger:i,onContinueWithoutLedger:t,title:u="Phantom supports Ledger",subtitle:a="Are you using a Ledger hardware wallet?\nContinue to sign with Ledger"})=>/*#__PURE__*/e.jsx(n.ScreenLayout,{title:u,subtitle:/*#__PURE__*/e.jsx(d,{children:a}),primaryCta:{label:"Continue with Ledger",onClick:i},secondaryCta:{label:"Continue without Ledger",onClick:t},watermark:!0,children:/*#__PURE__*/e.jsxs(l,{children:[/*#__PURE__*/e.jsx(o.Phantom,{style:{width:"48px",height:"48px"}}),/*#__PURE__*/e.jsx(r.ArrowRightLeft,{strokeWidth:2,color:"var(--privy-color-icon-subtle)",width:22,height:22}),/*#__PURE__*/e.jsx(s,{style:{width:"48px",height:"48px"}})]})});function a(){let{data:r,setModalData:i,navigate:n}=t.usePrivyModal();/*#__PURE__*/return e.jsx(u,{onContinueWithLedger:function(){i({...r,login:{...r?.login,isSigningInWithLedgerSolana:!0}}),n("ConnectionStatusScreen")},onContinueWithoutLedger:function(){i({...r,login:{...r?.login,isSigningInWithLedgerSolana:!1}}),n("ConnectionStatusScreen")}})}const c={component:a};let l=i.styled.div`
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
margin-bottom: var(--screen-space);
`,d=i.styled.span`
white-space: pre-wrap;
`;exports.ConnectLedgerScreen=c,exports.ConnectLedgerScreenComponent=a,exports.ConnectLedgerScreenView=u,exports.default=c;