UNPKG

@turnkey/react-wallet-kit

Version:

The easiest and most powerful way to integrate Turnkey's Embedded Wallets into your React applications.

48 lines (45 loc) 1.62 kB
import { slicedToArray as _slicedToArray, asyncToGenerator as _asyncToGenerator, regenerator as _regenerator } from '../../../_virtual/_rollupPluginBabelHelpers.mjs'; import { jsx } from 'react/jsx-runtime'; import { ActionButton } from '../../design/Buttons.mjs'; import { useState } from 'react'; function WalletAuthButton(props) { var onContinue = props.onContinue; var _useState = useState(false), _useState2 = _slicedToArray(_useState, 2), isLoading = _useState2[0], setIsLoading = _useState2[1]; var handleContinue = /*#__PURE__*/function () { var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { return _regenerator().w(function (_context) { while (1) switch (_context.p = _context.n) { case 0: setIsLoading(true); _context.p = 1; _context.n = 2; return Promise.resolve(onContinue()); case 2: _context.p = 2; setIsLoading(false); return _context.f(2); case 3: return _context.a(2); } }, _callee, null, [[1,, 2, 3]]); })); return function handleContinue() { return _ref.apply(this, arguments); }; }(); return jsx("div", { className: "flex flex-col w-full", children: jsx(ActionButton, { name: "wallet-auth-button", onClick: handleContinue, loading: isLoading, className: "w-full text-inherit bg-button-light dark:bg-button-dark", children: "Continue with wallet" }) }); } export { WalletAuthButton }; //# sourceMappingURL=WalletAuthButton.mjs.map