UNPKG

@web3auth/modal

Version:

Multi chain wallet aggregator for web3Auth

51 lines (47 loc) 2.01 kB
'use strict'; var jsxRuntime = require('react/jsx-runtime'); var reactI18next = require('react-i18next'); var constants = require('../../../constants.js'); var localeImport = require('../../../localeImport.js'); function ConnectWalletHeader(props) { const { disableBackButton, onBackClick, currentPage, selectedButton } = props; const [t] = reactI18next.useTranslation(undefined, { i18n: localeImport }); const handleBack = () => { if (onBackClick) { onBackClick(); } }; return jsxRuntime.jsxs("div", { className: "w3a--flex w3a--items-center w3a--justify-between", children: [!disableBackButton ? jsxRuntime.jsx("button", { type: "button", className: "w3a--z-20 w3a--flex w3a--size-5 w3a--cursor-pointer w3a--items-center w3a--justify-center w3a--rounded-full", onClick: handleBack, children: jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", className: "w3a--text-app-gray-500 hover:w3a--text-app-gray-900 dark:w3a--text-app-gray-200 dark:hover:w3a--text-app-white", children: jsxRuntime.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M9.707 16.707a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414l6-6a1 1 0 0 1 1.414 1.414L5.414 9H17a1 1 0 1 1 0 2H5.414l4.293 4.293a1 1 0 0 1 0 1.414", clipRule: "evenodd" }) }) }) : jsxRuntime.jsx("div", {}), jsxRuntime.jsx("p", { className: "w3a--text-base w3a--font-medium w3a--text-app-gray-900 dark:w3a--text-app-white", children: currentPage === constants.CONNECT_WALLET_PAGES.SELECTED_WALLET ? selectedButton === null || selectedButton === void 0 ? void 0 : selectedButton.displayName : currentPage === constants.CONNECT_WALLET_PAGES.CONNECT_WALLET ? t("modal.connectYourWallet") : currentPage }), jsxRuntime.jsx("div", { className: "w3a--z-[-1] w3a--size-5" })] }); } module.exports = ConnectWalletHeader;