UNPKG

@web3auth/modal

Version:

Multi chain wallet aggregator for web3Auth

48 lines (45 loc) 1.92 kB
import { useTranslation } from 'react-i18next'; import { CONNECT_WALLET_PAGES } from '../../../constants.js'; import i18nInstance from '../../../localeImport.js'; import { jsxs, jsx } from 'react/jsx-runtime'; function ConnectWalletHeader(props) { const { onBackClick, currentPage, selectedButton } = props; const [t] = useTranslation(undefined, { i18n: i18nInstance }); const handleBack = () => { if (onBackClick) { onBackClick(); } }; return /*#__PURE__*/jsxs("div", { className: "w3a--flex w3a--items-center w3a--justify-between", children: [/*#__PURE__*/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: /*#__PURE__*/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: /*#__PURE__*/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" }) }) }), /*#__PURE__*/jsx("p", { className: "w3a--text-base w3a--font-medium w3a--text-app-gray-900 dark:w3a--text-app-white", children: currentPage === CONNECT_WALLET_PAGES.SELECTED_WALLET ? selectedButton === null || selectedButton === void 0 ? void 0 : selectedButton.displayName : currentPage === CONNECT_WALLET_PAGES.CONNECT_WALLET ? t("modal.connectYourWallet") : currentPage }), /*#__PURE__*/jsx("div", { className: "w3a--z-[-1] w3a--size-5" })] }); } export { ConnectWalletHeader as default };