tek-wallet 0.0.188 → 0.0.189

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.
@@ -35,6 +35,7 @@ var Share_1 = __importDefault(require("../Share"));
35
35
  var NetworkSelection_1 = __importDefault(require("../NetworkSelection"));
36
36
  var TokenSelection_1 = __importDefault(require("../TokenSelection"));
37
37
  var CloseModal_1 = __importDefault(require("../CloseModal"));
38
+ var useDepositData_1 = __importDefault(require("../../../hooks/useDepositData"));
38
39
  var DepositStep;
39
40
  (function (DepositStep) {
40
41
  DepositStep[DepositStep["SELECT_TOKEN"] = 1] = "SELECT_TOKEN";
@@ -53,7 +54,8 @@ var DepositFunction = (0, react_1.forwardRef)(function (props, ref) {
53
54
  var _a = (0, react_1.useState)(DepositStep.SELECT_TOKEN), currentStep = _a[0], setCurrentStep = _a[1];
54
55
  var _b = (0, react_1.useState)(), selectedToken = _b[0], setSelectedToken = _b[1];
55
56
  var _c = (0, react_1.useState)(), selectedNetwork = _c[0], setSelectedNetwork = _c[1];
56
- var tokens = (0, useWalletData_1.default)().tokens;
57
+ var _d = (0, useWalletData_1.default)(), tokens = _d.tokens, isAuthenticated = _d.isAuthenticated;
58
+ var _e = (0, useDepositData_1.default)(), depositTokens = _e.depositTokens, updateDepositToken = _e.updateDepositToken;
57
59
  var open = function () {
58
60
  var _a;
59
61
  (_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.open();
@@ -87,20 +89,24 @@ var DepositFunction = (0, react_1.forwardRef)(function (props, ref) {
87
89
  setSelectedNetwork(network);
88
90
  nextStep();
89
91
  };
92
+ (0, react_1.useEffect)(function () {
93
+ if (isAuthenticated && !depositTokens) {
94
+ updateDepositToken();
95
+ }
96
+ }, [isAuthenticated, depositTokens]);
90
97
  return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: props.onClose, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { overrideHeader: (0, jsx_runtime_1.jsx)(BackHeader_1.default, { sx: {
91
98
  width: "100%",
92
99
  paddingBottom: theme.mixins.customPadding.p16,
93
100
  display: "flex",
94
101
  alignItems: "center",
95
- my: theme.mixins.customPadding.p24,
96
102
  }, overrideBack: handleBack, hideBack: currentStep === DepositStep.SELECT_TOKEN, center: DEPOSIT_STEP_NAME[currentStep], children: (0, jsx_runtime_1.jsx)(CloseModal_1.default, { sx: { marginLeft: "auto" }, onClick: props.onClose }) }), onClose: close, children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperRef, swiperProps: { autoHeight: true, spaceBetween: 32 }, children: [(0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, height: "fit-content" }), children: tokens === null || tokens === void 0 ? void 0 : tokens.map(function (item) {
97
103
  var stringifiedTokenData = JSON.stringify(__assign(__assign({}, item), { name: "Fake", fullname: "Fake fullname" }));
98
104
  return ((0, jsx_runtime_1.jsx)(TokenSelection_1.default, { onClick: handleSelectToken, tokenData: stringifiedTokenData, active: (selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.id) != "kf" }, item.id));
99
- }) }) }, DepositStep.SELECT_TOKEN), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(function (item) {
105
+ }) }) }, DepositStep.SELECT_TOKEN), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: depositTokens === null || depositTokens === void 0 ? void 0 : depositTokens.map(function (item) {
100
106
  return ((0, jsx_runtime_1.jsx)(NetworkSelection_1.default, { onClick: handleSelectNetwork, networkData: JSON.stringify({
101
- name: "network ".concat(item),
107
+ name: "network ".concat(item.id),
102
108
  icon: "https://via.placeholder.com/150",
103
- }) }, item));
109
+ }) }, item.id));
104
110
  }) }) }, DepositStep.SELECT_NETWORK), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
105
111
  display: "flex",
106
112
  flexDirection: "column",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.188",
3
+ "version": "0.0.189",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",