@kimafinance/kima-transaction-widget 1.2.34-beta.1 → 1.2.36-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ThemeOptions } from '../../interface';
3
- declare const TxButton: ({ theme }: {
3
+ interface Props {
4
4
  theme: ThemeOptions;
5
- }) => React.JSX.Element;
5
+ }
6
+ declare const TxButton: ({ theme }: Props) => React.JSX.Element;
6
7
  export default TxButton;
package/dist/index.js CHANGED
@@ -1173,6 +1173,7 @@ var _optionSlice$actions = optionSlice.actions,
1173
1173
  setTronConnectModal = _optionSlice$actions.setTronConnectModal,
1174
1174
  setHelpPopup = _optionSlice$actions.setHelpPopup,
1175
1175
  setHashPopup = _optionSlice$actions.setHashPopup,
1176
+ setPendingTxPopup = _optionSlice$actions.setPendingTxPopup,
1176
1177
  setBankPopup = _optionSlice$actions.setBankPopup,
1177
1178
  setSolanaProvider = _optionSlice$actions.setSolanaProvider,
1178
1179
  setProvider = _optionSlice$actions.setProvider,
@@ -1508,6 +1509,9 @@ var selectKycStatus = function selectKycStatus(state) {
1508
1509
  var selectExpireTime = function selectExpireTime(state) {
1509
1510
  return state.option.expireTime;
1510
1511
  };
1512
+ var selectPendingTxs = function selectPendingTxs(state) {
1513
+ return state.option.pendingTxs;
1514
+ };
1511
1515
 
1512
1516
  var Loading180Ring = function Loading180Ring(_ref) {
1513
1517
  var _ref$width = _ref.width,
@@ -3236,6 +3240,23 @@ var BankInput = function BankInput() {
3236
3240
  })));
3237
3241
  };
3238
3242
 
3243
+ var TxButton = function TxButton(_ref) {
3244
+ var theme = _ref.theme;
3245
+ var dispatch = reactRedux.useDispatch();
3246
+ var handleClick = function handleClick() {
3247
+ dispatch(setPendingTxPopup(true));
3248
+ };
3249
+ var txCount = reactRedux.useSelector(selectPendingTxs);
3250
+ return React__default.createElement("button", {
3251
+ className: "secondary-button tx-button " + theme.colorMode,
3252
+ onClick: handleClick
3253
+ }, txCount, React__default.createElement(Loading180Ring, {
3254
+ height: 16,
3255
+ width: 16,
3256
+ fill: theme.colorMode === 'light' ? 'black' : 'white'
3257
+ }));
3258
+ };
3259
+
3239
3260
  var HelpPopup = function HelpPopup() {
3240
3261
  var dispatch = reactRedux.useDispatch();
3241
3262
  var theme = reactRedux.useSelector(selectTheme);
@@ -8090,6 +8111,7 @@ var TransferWidget = function TransferWidget(_ref) {
8090
8111
  var _useIsWalletReady = useIsWalletReady(),
8091
8112
  isReady = _useIsWalletReady.isReady,
8092
8113
  walletAddress = _useIsWalletReady.walletAddress;
8114
+ var pendingTxs = reactRedux.useSelector(selectPendingTxs);
8093
8115
  var _useAllowance = useAllowance({
8094
8116
  setApproving: setApproving
8095
8117
  }),
@@ -8601,7 +8623,9 @@ var TransferWidget = function TransferWidget(_ref) {
8601
8623
  className: 'title'
8602
8624
  }, React__default.createElement("h3", null, isWizard && wizardStep === 3 || !isWizard && formStep > 0 ? titleOption !== null && titleOption !== void 0 && titleOption.confirmTitle ? titleOption === null || titleOption === void 0 ? void 0 : titleOption.confirmTitle : 'Transfer Details' : titleOption !== null && titleOption !== void 0 && titleOption.initialTitle ? titleOption === null || titleOption === void 0 ? void 0 : titleOption.initialTitle : 'New Transfer')), React__default.createElement("div", {
8603
8625
  className: 'control-buttons'
8604
- }, React__default.createElement(ExternalLink, {
8626
+ }, pendingTxs > 0 ? React__default.createElement(TxButton, {
8627
+ theme: theme
8628
+ }) : null, React__default.createElement(ExternalLink, {
8605
8629
  to: helpURL ? helpURL : 'https://docs.kima.finance/demo'
8606
8630
  }, React__default.createElement("div", {
8607
8631
  className: 'menu-button'
@@ -8685,14 +8709,6 @@ var TransferWidget = function TransferWidget(_ref) {
8685
8709
  background: theme.colorMode === exports.ColorModeOptions.light ? 'white' : (_theme$backgroundColo = theme.backgroundColorDark) != null ? _theme$backgroundColo : '#1b1e25'
8686
8710
  }
8687
8711
  }
8688
- }), React__default.createElement(reactTooltip.Tooltip, {
8689
- id: 'popup-tooltip',
8690
- className: "popup-tooltip " + theme.colorMode,
8691
- content: 'Click to open popup to see pending transactions',
8692
- style: {
8693
- zIndex: 10000
8694
- },
8695
- place: 'bottom'
8696
8712
  }));
8697
8713
  };
8698
8714