@web3auth/modal
Version:
Multi chain wallet aggregator for web3Auth
57 lines (54 loc) • 1.42 kB
JavaScript
import { BUTTON_TYPE } from './Button.type.js';
import SocialLoginButton from './ButtonSocial/ButtonSocial.js';
import ButtonWallet from './ButtonWallet/ButtonWallet.js';
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
function Button(props) {
const {
type,
props: buttonProps
} = props;
const SocialButtonProps = buttonProps;
const WalletButtonProps = buttonProps;
const {
text,
showIcon,
showText,
method,
isDark,
isPrimaryBtn,
onClick,
children,
btnStyle,
buttonRadius
} = SocialButtonProps;
const {
label,
onClick: walletOnClick,
button,
deviceDetails,
walletConnectUri,
buttonRadius: walletButtonRadius
} = WalletButtonProps;
return /*#__PURE__*/jsxs(Fragment, {
children: [type === BUTTON_TYPE.SOCIAL && /*#__PURE__*/jsx(SocialLoginButton, {
text: text,
showIcon: showIcon,
showText: showText,
method: method,
isDark: isDark,
isPrimaryBtn: isPrimaryBtn,
onClick: onClick,
btnStyle: btnStyle,
buttonRadius: buttonRadius,
children: children
}), type === BUTTON_TYPE.WALLET && /*#__PURE__*/jsx(ButtonWallet, {
label: label,
walletConnectUri: walletConnectUri,
onClick: walletOnClick,
button: button,
deviceDetails: deviceDetails,
buttonRadius: walletButtonRadius
})]
});
}
export { Button as default };