tek-wallet 0.0.144 → 0.0.146

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.
@@ -61,34 +61,30 @@ var DepositFunction = (0, react_1.forwardRef)(function (props, ref) {
61
61
  var _a;
62
62
  (_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
63
63
  };
64
+ (0, react_1.useImperativeHandle)(ref, function () { return ({
65
+ open: open,
66
+ close: close,
67
+ }); });
64
68
  var handleBack = function () {
65
69
  var _a;
66
70
  (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.prev();
67
71
  setCurrentStep(currentStep - 1);
68
72
  };
69
- (0, react_1.useImperativeHandle)(ref, function () { return ({
70
- open: open,
71
- close: close,
72
- }); });
73
- var handleSelectToken = function (token) {
73
+ var nextStep = function () {
74
74
  var _a;
75
+ (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.next();
76
+ setCurrentStep(function (prev) { return prev + 1; });
77
+ };
78
+ var handleSelectToken = function (token) {
75
79
  setSelectedToken(token);
76
80
  if (!!token) {
77
- (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.next();
81
+ nextStep();
78
82
  }
79
83
  };
80
- 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, { title: (0, jsx_runtime_1.jsx)(BackHeader_1.default, { overrideBack: handleBack, hideBack: currentStep === DepositStep.SELECT_TOKEN, children: (0, jsx_runtime_1.jsx)(ModalTitle_1.default, { children: DEPOSIT_STEP_NAME[currentStep] }) }), onClose: close, children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperRef, children: [(0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
81
- display: "flex",
82
- flexDirection: "column",
83
- gap: theme.mixins.gaps.g16,
84
- }, children: tokens === null || tokens === void 0 ? void 0 : tokens.map(function (item) {
84
+ 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, { title: (0, jsx_runtime_1.jsx)(BackHeader_1.default, { overrideBack: handleBack, hideBack: currentStep === DepositStep.SELECT_TOKEN, children: (0, jsx_runtime_1.jsx)(ModalTitle_1.default, { children: DEPOSIT_STEP_NAME[currentStep] }) }), onClose: close, children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperRef, swiperProps: { autoHeight: true }, 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) {
85
85
  var stringifiedTokenData = JSON.stringify(__assign(__assign({}, item), { name: "Fake", fullname: "Fake fullname" }));
86
86
  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));
87
- }) }) }, DepositStep.SELECT_TOKEN), (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
88
- display: "flex",
89
- alignItems: "center",
90
- gap: theme.mixins.gaps.g12,
91
- }, children: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(function (item) {
87
+ }) }) }, 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) {
92
88
  return ((0, jsx_runtime_1.jsx)(NetworkSelection_1.default, { networkData: JSON.stringify({
93
89
  name: "network ".concat(item),
94
90
  icon: "https://via.placeholder.com/150",
@@ -6,6 +6,7 @@ interface SwiperControlledProps extends GeneralProps {
6
6
  tabsClassName?: string;
7
7
  swiperProps?: SwiperProps;
8
8
  disableSwipe?: boolean;
9
+ swiperStyle?: Record<string, string | number>;
9
10
  }
10
11
  export interface SwiperControlledRef {
11
12
  slideTo: (index: number) => void;
@@ -53,10 +53,7 @@ var SwiperControlled = (0, react_2.forwardRef)(function (props, ref) {
53
53
  setActiveTab(value);
54
54
  (_b = (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideTo(value);
55
55
  };
56
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ width: "100%", display: "flex", flexDirection: "column" }, props.sx), children: [props.tabs && ((0, jsx_runtime_1.jsxs)(material_1.Tabs, { value: activeTab, onChange: handleTabChange, children: __spreadArray([], props.tabs, true) })), (0, jsx_runtime_1.jsx)(react_1.Swiper, __assign({}, props.swiperProps, { onSlideChange: handleSlideChange, ref: swiperRef, initialSlide: activeTab, style: {
57
- width: "100%",
58
- flex: 1,
59
- }, allowTouchMove: !props.disableSwipe, children: props.children }))] }));
56
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ width: "100%", display: "flex", flexDirection: "column" }, props.sx), children: [props.tabs && ((0, jsx_runtime_1.jsxs)(material_1.Tabs, { value: activeTab, onChange: handleTabChange, children: __spreadArray([], props.tabs, true) })), (0, jsx_runtime_1.jsx)(react_1.Swiper, __assign({}, props.swiperProps, { onSlideChange: handleSlideChange, ref: swiperRef, initialSlide: activeTab, style: __assign({ width: "100%" }, props.swiperStyle), allowTouchMove: !props.disableSwipe, children: props.children }))] }));
60
57
  });
61
58
  SwiperControlled.displayName = "SwiperControlled";
62
59
  exports.default = SwiperControlled;
@@ -136,7 +136,9 @@ var CreateWalletView = function (props) {
136
136
  }, handleCreateWalletError);
137
137
  }
138
138
  };
139
- return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { ref: childPageLayoutRef, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { overrideBack: handleBack, title: "Passcode" }), children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: __assign({ display: "flex", flexDirection: "column", gap: "1rem", height: "100%" }, props.sx), children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperControlledRef, disableSwipe: true, sx: { height: "100%" }, children: [(0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
139
+ return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { ref: childPageLayoutRef, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { overrideBack: handleBack, title: "Passcode" }), children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: __assign({ display: "flex", flexDirection: "column", gap: "1rem", height: "100%" }, props.sx), children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperControlledRef, disableSwipe: true, sx: { height: "100%" }, swiperStyle: {
140
+ flex: 1,
141
+ }, children: [(0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
140
142
  display: "flex",
141
143
  flexDirection: "column",
142
144
  justifyContent: "center",
@@ -143,7 +143,9 @@ var GetSeedPhraseWalletView = function (props) {
143
143
  }, handleCreateWalletError);
144
144
  }
145
145
  };
146
- return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { ref: childPageLayoutRef, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { overrideBack: handleBack, title: "Backup Wallet" }), children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: __assign({ display: "flex", flexDirection: "column", gap: "1rem", height: "100%" }, props.sx), children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperControlledRef, disableSwipe: true, sx: { height: "100%" }, children: [(0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
146
+ return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { ref: childPageLayoutRef, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { overrideBack: handleBack, title: "Backup Wallet" }), children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: __assign({ display: "flex", flexDirection: "column", gap: "1rem", height: "100%" }, props.sx), children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperControlledRef, disableSwipe: true, sx: { height: "100%" }, swiperStyle: {
147
+ flex: 1,
148
+ }, children: [(0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
147
149
  display: "flex",
148
150
  flexDirection: "column",
149
151
  justifyContent: "center",
@@ -107,7 +107,9 @@ var ImportWalletView = function (props) {
107
107
  }
108
108
  });
109
109
  }); };
110
- return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { ref: childPageLayoutRef, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { overrideBack: props.onBack, title: "Import wallet" }), children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: __assign({ display: "flex", flexDirection: "column", gap: "1rem", height: "100%" }, props.sx), children: (0, jsx_runtime_1.jsx)(SwiperControlled_1.default, { ref: swiperControlledRef, disableSwipe: true, sx: { height: "100%" }, children: (0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
110
+ return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { ref: childPageLayoutRef, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { overrideBack: props.onBack, title: "Import wallet" }), children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: __assign({ display: "flex", flexDirection: "column", gap: "1rem", height: "100%" }, props.sx), children: (0, jsx_runtime_1.jsx)(SwiperControlled_1.default, { ref: swiperControlledRef, disableSwipe: true, sx: { height: "100%" }, swiperStyle: {
111
+ flex: 1,
112
+ }, children: (0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
111
113
  display: "flex",
112
114
  flexDirection: "column",
113
115
  alignItems: "center",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.144",
3
+ "version": "0.0.146",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",