UNPKG

@privy-io/react-auth

Version:

React client for the Privy Auth API

2 lines (1 loc) 2.35 kB
import{jsx as t,jsxs as e,Fragment as o}from"react/jsx-runtime";import{L as r}from"./Link-DwjLfHwW.mjs";import{T as i,a}from"./TodoList-Dn0Qu-vv.mjs";import{a as l}from"./get-is-unified-wallet-gMDXpX6C.mjs";import{S as n}from"./ScreenLayout-CNho46nP.mjs";import"styled-components";import"lucide-react";import"react";import"viem";import"./context-DRLoVlsO.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"./Button-BCV6mjvS.mjs";import"./useActiveWallet-BeOB3HTh.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BVTcQcmw.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-kObl6ZLS.mjs";import"./Screen-_0H_rCdH.mjs";import"./ModalHeader-BTru6YQw.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"./index-CJMgUOnw.mjs";const s=({walletName:l,installLink:s,title:m,subtitle:c="Follow the instructions below to get started.",onReload:p,onBack:d})=>{let h=m||`Create a ${l} wallet`.replace(/wallet wallet/gi,"wallet");/*#__PURE__*/return t(n,{title:h,subtitle:c,onBack:d,showBack:!0,primaryCta:{label:"Reload the page to use your wallet",onClick:p},helpText:/*#__PURE__*/e(o,{children:[/*#__PURE__*/t("span",{children:"Still not sure? "}),/*#__PURE__*/t(r,{size:"sm",target:"_blank",href:"https://solana.com/docs/intro/wallets",children:"Learn more"})]}),watermark:!0,children:/*#__PURE__*/e(i,{children:[/*#__PURE__*/t(a,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/t("span",{children:"Install the "})," ",/*#__PURE__*/e(r,{href:s,target:"_blank",children:[l," browser extension"]})]})}),/*#__PURE__*/t(a,{children:"Set up your first wallet"}),/*#__PURE__*/t(a,{children:"Store your recovery phrase in a safe place!"})]})})},m={component:()=>{let{navigateBack:e,data:o}=l();if(!o?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:r}=o.installWalletModalData;/*#__PURE__*/return t(s,{walletName:r.name,installLink:r.installLink,onReload:()=>{window.location.reload()},onBack:e})}};export{m as InstallWalletScreen,s as InstallWalletScreenView,m as default};