tek-wallet 0.0.416 → 0.0.417

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.
@@ -121,6 +121,7 @@ var type_1 = require("../ConfirmLayout/type");
121
121
  var ConfirmByPasscode_1 = __importDefault(require("../ConfirmByPasscode"));
122
122
  var LineValue_1 = __importDefault(require("../LineValue"));
123
123
  var send_external_service_1 = __importDefault(require("../../../services/axios/send-external-service"));
124
+ var useRealtime_1 = __importDefault(require("../../../hooks/useRealtime"));
124
125
  var SendMethods;
125
126
  (function (SendMethods) {
126
127
  SendMethods["SCAN_QR_CODE"] = "scan qr code";
@@ -150,6 +151,7 @@ var AmountError;
150
151
  })(AmountError || (exports.AmountError = AmountError = {}));
151
152
  var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
152
153
  var _a, _b;
154
+ var pushNotification = (0, useRealtime_1.default)().pushNotification;
153
155
  var drawerRef = (0, react_1.useRef)(null);
154
156
  var swiperRef = (0, react_1.useRef)(null);
155
157
  var confirmLayoutDrawerRef = (0, react_1.useRef)(null);
@@ -201,6 +203,13 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
201
203
  return undefined;
202
204
  return +amount - +(estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeInCurrency);
203
205
  }, [estimateFee, amount]);
206
+ var testPushNotification = function () {
207
+ pushNotification({
208
+ message: "Test notification",
209
+ type: "success",
210
+ id: "test-notification",
211
+ });
212
+ };
204
213
  (0, react_1.useEffect)(function () {
205
214
  setTimeout(function () {
206
215
  var _a;
@@ -627,13 +636,13 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
627
636
  : WITHDRAW_STEP_NAME[currentStep], children: (0, jsx_runtime_1.jsx)(CloseModal_1.default, { sx: { marginLeft: "auto" }, onClick: close }) }), children: [(0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperRef, swiperProps: {
628
637
  autoHeight: true,
629
638
  spaceBetween: 32,
630
- }, disableSwipe: 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), { height: "fit-content" }), children: Object.values(SendMethods).map(function (item, index) {
631
- return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [index !== 0 && (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: item, description: item, icon: (0, getIcon_1.default)(item + "_icon"), onClick: function () {
632
- return handleSelectMethod(item);
633
- }, sx: {
634
- my: theme.mixins.customMargin.m12,
635
- } })] }, item));
636
- }) }) }, WithdrawStep.SELECT_METHOD), (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: withdrawToken === null || withdrawToken === void 0 ? void 0 : withdrawToken.map(function (item) {
639
+ }, disableSwipe: true, children: [(0, jsx_runtime_1.jsxs)(react_2.SwiperSlide, { children: [(0, jsx_runtime_1.jsxs)(Button_1.default.Primary, { onClick: testPushNotification, children: [" ", "Push"] }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { height: "fit-content" }), children: Object.values(SendMethods).map(function (item, index) {
640
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [index !== 0 && (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: item, description: item, icon: (0, getIcon_1.default)(item + "_icon"), onClick: function () {
641
+ return handleSelectMethod(item);
642
+ }, sx: {
643
+ my: theme.mixins.customMargin.m12,
644
+ } })] }, item));
645
+ }) })] }, WithdrawStep.SELECT_METHOD), (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: withdrawToken === null || withdrawToken === void 0 ? void 0 : withdrawToken.map(function (item) {
637
646
  var stringifiedTokenData = JSON.stringify(item);
638
647
  if (!item)
639
648
  return null;
@@ -0,0 +1,3 @@
1
+ import { RealtimeProviderDataType } from "../providers/RealtimeProvider/type";
2
+ declare function useRealtime(): RealtimeProviderDataType;
3
+ export default useRealtime;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var react_1 = require("react");
4
+ var RealtimeProvider_1 = require("../providers/RealtimeProvider");
5
+ function useRealtime() {
6
+ try {
7
+ var data = (0, react_1.useContext)(RealtimeProvider_1.RealtimeContext);
8
+ return data;
9
+ }
10
+ catch (error) {
11
+ console.error("🚀 ~ useRealtime ~ error:", error);
12
+ return RealtimeProvider_1.initialRealtime;
13
+ }
14
+ }
15
+ exports.default = useRealtime;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.416",
3
+ "version": "0.0.417",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",