tek-wallet 0.0.815 → 0.0.823

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.
Files changed (114) hide show
  1. package/dist/components/TekWallet/components/ui/AssetsBoard/index.d.ts +2 -0
  2. package/dist/components/TekWallet/components/ui/AssetsBoard/index.js +61 -0
  3. package/dist/components/TekWallet/components/ui/ChangePasscode/index.js +1 -1
  4. package/dist/components/TekWallet/components/ui/ConfirmByPasscode/index.js +3 -3
  5. package/dist/components/TekWallet/components/ui/ConfirmSendExternal/index.d.ts +2 -2
  6. package/dist/components/TekWallet/components/ui/ConfirmSendExternal/index.js +1 -1
  7. package/dist/components/TekWallet/components/ui/ConfirmSendNft/Result.d.ts +10 -0
  8. package/dist/components/TekWallet/components/ui/ConfirmSendNft/Result.js +87 -0
  9. package/dist/components/TekWallet/components/ui/ConfirmSendNft/index.d.ts +17 -0
  10. package/dist/components/TekWallet/components/ui/ConfirmSendNft/index.js +133 -0
  11. package/dist/components/TekWallet/components/ui/ConfirmSwapToken/index.d.ts +1 -1
  12. package/dist/components/TekWallet/components/ui/ConfirmSwapToken/index.js +1 -1
  13. package/dist/components/TekWallet/components/ui/DrawerComponent/index.d.ts +1 -1
  14. package/dist/components/TekWallet/components/ui/DrawerComponent/index.js +2 -1
  15. package/dist/components/TekWallet/components/ui/Input/ClearInput.d.ts +5 -0
  16. package/dist/components/TekWallet/components/ui/{WithdrawFunction/components/tutorial.js → Input/ClearInput.js} +5 -9
  17. package/dist/components/TekWallet/components/ui/Input/PasteInput.d.ts +5 -0
  18. package/dist/components/TekWallet/components/ui/{WithdrawFunction/components/transferHistory.js → Input/PasteInput.js} +5 -9
  19. package/dist/components/TekWallet/components/ui/Input/QrScan.d.ts +5 -0
  20. package/dist/components/TekWallet/components/ui/Input/QrScan.js +31 -0
  21. package/dist/components/TekWallet/components/ui/Input/index.d.ts +12 -10
  22. package/dist/components/TekWallet/components/ui/Input/index.js +120 -19
  23. package/dist/components/TekWallet/components/ui/Input/index_bk.d.ts +10 -0
  24. package/dist/components/TekWallet/components/ui/Input/index_bk.js +46 -0
  25. package/dist/components/TekWallet/components/ui/NftDetail/index.d.ts +6 -0
  26. package/dist/components/TekWallet/components/ui/NftDetail/index.js +47 -0
  27. package/dist/components/TekWallet/components/ui/NftItem/index.d.ts +8 -0
  28. package/dist/components/TekWallet/components/ui/NftItem/index.js +74 -0
  29. package/dist/components/TekWallet/components/ui/NftsBoard/index.d.ts +2 -0
  30. package/dist/components/TekWallet/components/ui/NftsBoard/index.js +118 -0
  31. package/dist/components/TekWallet/components/ui/QrCodeReader/index.d.ts +2 -1
  32. package/dist/components/TekWallet/components/ui/QrCodeReader/index.js +11 -4
  33. package/dist/components/TekWallet/components/ui/ReceiveDirectly/index.js +1 -1
  34. package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +2 -2
  35. package/dist/components/TekWallet/components/ui/ReceiveHistory/index.js +1 -1
  36. package/dist/components/TekWallet/components/ui/TokensBoard/index.js +21 -44
  37. package/dist/components/TekWallet/components/views/AssetView/index.js +2 -2
  38. package/dist/components/TekWallet/components/views/NftDetailView/LoadingView.d.ts +2 -0
  39. package/dist/components/TekWallet/components/views/NftDetailView/LoadingView.js +29 -0
  40. package/dist/components/TekWallet/components/views/NftDetailView/index.d.ts +8 -0
  41. package/dist/components/TekWallet/components/views/NftDetailView/index.js +20 -0
  42. package/dist/components/TekWallet/components/views/SendExternalView/components/Form.js +54 -77
  43. package/dist/components/TekWallet/components/views/SendExternalView/index.js +1 -1
  44. package/dist/components/TekWallet/components/views/SendInternalView/components/Form.js +24 -68
  45. package/dist/components/TekWallet/components/views/SendNftView/components/Form.d.ts +12 -0
  46. package/dist/components/TekWallet/components/views/SendNftView/components/Form.js +222 -0
  47. package/dist/components/TekWallet/components/views/SendNftView/index.d.ts +2 -0
  48. package/dist/components/TekWallet/components/views/SendNftView/index.js +32 -0
  49. package/dist/components/TekWallet/components/views/SwapView/index.js +1 -1
  50. package/dist/components/TekWallet/components/views/TekWalletView/index.d.ts +1 -0
  51. package/dist/components/TekWallet/components/views/TekWalletView/index.js +5 -0
  52. package/dist/components/TekWallet/hooks/data/useNfts/api.d.ts +5 -0
  53. package/dist/components/TekWallet/hooks/data/useNfts/api.js +83 -0
  54. package/dist/components/TekWallet/hooks/data/useNfts/index.d.ts +213 -0
  55. package/dist/components/TekWallet/hooks/data/useNfts/index.js +55 -0
  56. package/dist/components/TekWallet/hooks/data/useNfts/nftQueryKey.d.ts +5 -0
  57. package/dist/components/TekWallet/hooks/data/useNfts/nftQueryKey.js +18 -0
  58. package/dist/components/TekWallet/hooks/data/useNfts/service.type.d.ts +84 -0
  59. package/dist/components/TekWallet/hooks/data/useNfts/service.type.js +10 -0
  60. package/dist/components/TekWallet/hooks/data/useNfts/state.type.d.ts +4 -0
  61. package/dist/components/TekWallet/hooks/data/useNfts/state.type.js +2 -0
  62. package/dist/components/TekWallet/hooks/data/useNfts/useNft.d.ts +22 -0
  63. package/dist/components/TekWallet/hooks/data/useNfts/useNft.js +213 -0
  64. package/dist/components/TekWallet/hooks/data/useVouchers/service.type.d.ts +22 -0
  65. package/dist/components/TekWallet/hooks/data/useVouchers/service.type.js +14 -0
  66. package/dist/components/TekWallet/hooks/store/useQueryKeys/index.d.ts +3 -0
  67. package/dist/components/TekWallet/hooks/store/useQueryKeys/index.js +86 -0
  68. package/dist/components/TekWallet/hooks/store/useQueryKeys/type.d.ts +27 -0
  69. package/dist/components/TekWallet/hooks/store/useQueryKeys/type.js +29 -0
  70. package/dist/components/TekWallet/hooks/store/useQueryKeys/useQueryKeyDependence.d.ts +11 -0
  71. package/dist/components/TekWallet/hooks/store/useQueryKeys/useQueryKeyDependence.js +35 -0
  72. package/dist/components/TekWallet/hooks/store/useQueryKeys/useQueryKeyDependenceOnAccount.d.ts +6 -0
  73. package/dist/components/TekWallet/hooks/store/useQueryKeys/useQueryKeyDependenceOnAccount.js +25 -0
  74. package/dist/components/TekWallet/hooks/useCustomRouter.js +7 -3
  75. package/dist/components/TekWallet/hooks/utils/useEditPageQuery.d.ts +9 -0
  76. package/dist/components/TekWallet/hooks/utils/useEditPageQuery.js +86 -0
  77. package/dist/components/TekWallet/hooks/utils/useEditSinglePageQuery.d.ts +4 -0
  78. package/dist/components/TekWallet/hooks/utils/useEditSinglePageQuery.js +75 -0
  79. package/dist/components/TekWallet/index.d.ts +1 -0
  80. package/dist/components/TekWallet/index.js +1 -0
  81. package/dist/components/TekWallet/providers/TanstackReactQuery/index.d.ts +4 -0
  82. package/dist/components/TekWallet/providers/TanstackReactQuery/index.js +33 -0
  83. package/dist/components/TekWallet/providers/TanstackReactQuery/query.config.d.ts +2 -0
  84. package/dist/components/TekWallet/providers/TanstackReactQuery/query.config.js +18 -0
  85. package/dist/components/TekWallet/providers/TekWalletProvider/index.d.ts +1 -0
  86. package/dist/components/TekWallet/providers/TekWalletProvider/index.js +3 -1
  87. package/dist/components/TekWallet/services/axios/clients/userClientRequest.d.ts +2 -2
  88. package/dist/components/TekWallet/services/axios/clients/userClientRequest.js +3 -3
  89. package/dist/components/TekWallet/services/axios/type.d.ts +11 -0
  90. package/dist/components/TekWallet/theme/mui/components/index.d.ts +1 -15
  91. package/dist/components/TekWallet/theme/mui/components/overrides/Button.d.ts +1 -15
  92. package/dist/components/TekWallet/theme/mui/components/overrides/Button.js +3 -8
  93. package/dist/components/TekWallet/theme/mui/palette.d.ts +10 -4
  94. package/dist/components/TekWallet/theme/mui/palette.js +6 -1
  95. package/dist/components/TekWallet/utils/getContractColor.d.ts +1 -1
  96. package/package.json +5 -2
  97. package/dist/components/TekWallet/components/ui/WithdrawFunction/components/selectToken.d.ts +0 -13
  98. package/dist/components/TekWallet/components/ui/WithdrawFunction/components/selectToken.js +0 -48
  99. package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sendForm.d.ts +0 -29
  100. package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sendForm.js +0 -235
  101. package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sortByBalance.d.ts +0 -7
  102. package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sortByBalance.js +0 -45
  103. package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sortByToken.d.ts +0 -7
  104. package/dist/components/TekWallet/components/ui/WithdrawFunction/components/sortByToken.js +0 -45
  105. package/dist/components/TekWallet/components/ui/WithdrawFunction/components/summary/infoSummary.d.ts +0 -14
  106. package/dist/components/TekWallet/components/ui/WithdrawFunction/components/summary/infoSummary.js +0 -111
  107. package/dist/components/TekWallet/components/ui/WithdrawFunction/components/transferHistory.d.ts +0 -5
  108. package/dist/components/TekWallet/components/ui/WithdrawFunction/components/tutorial.d.ts +0 -5
  109. package/dist/components/TekWallet/components/ui/WithdrawFunction/index.d.ts +0 -38
  110. package/dist/components/TekWallet/components/ui/WithdrawFunction/index.js +0 -570
  111. package/dist/components/TekWallet/components/views/SendInternalView/components/AmountForm.d.ts +0 -11
  112. package/dist/components/TekWallet/components/views/SendInternalView/components/AmountForm.js +0 -382
  113. package/dist/components/TekWallet/utils/sort.utils.d.ts +0 -3
  114. package/dist/components/TekWallet/utils/sort.utils.js +0 -24
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
  var __assign = (this && this.__assign) || function () {
3
4
  __assign = Object.assign || function(t) {
4
5
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -10,6 +11,42 @@ var __assign = (this && this.__assign) || function () {
10
11
  };
11
12
  return __assign.apply(this, arguments);
12
13
  };
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ var __generator = (this && this.__generator) || function (thisArg, body) {
24
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
25
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26
+ function verb(n) { return function (v) { return step([n, v]); }; }
27
+ function step(op) {
28
+ if (f) throw new TypeError("Generator is already executing.");
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
31
+ if (y = 0, t) op = [op[0] & 2, t.value];
32
+ switch (op[0]) {
33
+ case 0: case 1: t = op; break;
34
+ case 4: _.label++; return { value: op[1], done: false };
35
+ case 5: _.label++; y = op[1]; op = [0]; continue;
36
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
37
+ default:
38
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
39
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
40
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
41
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
42
+ if (t[2]) _.ops.pop();
43
+ _.trys.pop(); continue;
44
+ }
45
+ op = body.call(thisArg, _);
46
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
47
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
48
+ }
49
+ };
13
50
  var __rest = (this && this.__rest) || function (s, e) {
14
51
  var t = {};
15
52
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -21,26 +58,90 @@ var __rest = (this && this.__rest) || function (s, e) {
21
58
  }
22
59
  return t;
23
60
  };
61
+ var __importDefault = (this && this.__importDefault) || function (mod) {
62
+ return (mod && mod.__esModule) ? mod : { "default": mod };
63
+ };
24
64
  Object.defineProperty(exports, "__esModule", { value: true });
25
65
  var jsx_runtime_1 = require("react/jsx-runtime");
26
66
  var material_1 = require("@mui/material");
67
+ var ClearInput_1 = __importDefault(require("./ClearInput"));
27
68
  var react_1 = require("react");
28
- var mui_1 = require("../../../theme/mui");
29
- var Input = (0, react_1.forwardRef)(function (props, inputRef) {
30
- var inputRest = props.inputRest, leftPart = props.leftPart, rightPart = props.rightPart, sx = props.sx, inputSx = props.inputSx, rest = __rest(props, ["inputRest", "leftPart", "rightPart", "sx", "inputSx"]);
31
- var theme = (0, mui_1.useTheme)();
32
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ ref: inputRef, sx: __assign(__assign(__assign({}, theme.styleMixins.row), { gap: theme.styleMixins.gaps.g12, borderRadius: 1, paddingX: theme.styleMixins.customPadding.p16, border: "1px solid ".concat(theme.palette.divider), backgroundColor: theme.palette.background.default, color: theme.palette.text.primary, backdropFilter: "blur(10px)" }), sx) }, rest, { children: [leftPart, (0, jsx_runtime_1.jsx)(material_1.TextField, __assign({ autoComplete: "off", hiddenLabel: true, sx: __assign({ backgroundColor: "transparent", border: "none", outline: "none", flex: 1, height: "fit-content", "& .MuiInputBase-input": {
33
- border: "none",
34
- outline: "none",
35
- color: theme.palette.text.primary,
36
- fontSize: theme.typography.fontSize13,
37
- lineHeight: theme.typography.leading140,
38
- fontWeight: theme.typography.fontWeight400,
39
- padding: "".concat(theme.styleMixins.customPadding.p12, " ").concat(0, "px"),
40
- // height: "fit-content",
41
- }, "& fieldset": { border: "none" }, "& .MuiInputBase-input::placeholder": {
42
- fontSize: theme.typography.fontSize13,
43
- } }, inputSx) }, inputRest)), rightPart] })));
44
- });
45
- Input.displayName = "Input";
46
- exports.default = Input;
69
+ var PasteInput_1 = __importDefault(require("./PasteInput"));
70
+ var QrScan_1 = __importDefault(require("./QrScan"));
71
+ // import ScanQR from "@/components/Molecules/ScanQR";
72
+ var lodash_1 = __importDefault(require("lodash"));
73
+ var cn_1 = require("../../../utils/cn");
74
+ var QrCodeReader_1 = __importDefault(require("../QrCodeReader"));
75
+ function TextField(props) {
76
+ var _this = this;
77
+ var className = props.className, value = props.value, canClear = props.canClear, canPaste = props.canPaste, canScan = props.canScan, onChange = props.onChange, slotProps = props.slotProps, sx = props.sx, sanitizeScanText = props.sanitizeScanText, rest = __rest(props, ["className", "value", "canClear", "canPaste", "canScan", "onChange", "slotProps", "sx", "sanitizeScanText"]);
78
+ var textFieldRef = (0, react_1.useRef)(null);
79
+ var input = (slotProps || {}).input;
80
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
81
+ var readOnly = (input || {}).readOnly;
82
+ var theme = (0, material_1.useTheme)();
83
+ var emitChange = (0, react_1.useCallback)(function (result) {
84
+ var _a, _b;
85
+ var input = (_a = textFieldRef.current) === null || _a === void 0 ? void 0 : _a.querySelector("input");
86
+ if (input) {
87
+ var nativeInputValueSetter = (_b = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")) === null || _b === void 0 ? void 0 : _b.set;
88
+ nativeInputValueSetter === null || nativeInputValueSetter === void 0 ? void 0 : nativeInputValueSetter.call(input, result);
89
+ var event_1 = new Event("input", { bubbles: true });
90
+ input.dispatchEvent(event_1);
91
+ }
92
+ }, []);
93
+ var handlePaste = (0, react_1.useCallback)(function () { return __awaiter(_this, void 0, void 0, function () {
94
+ var input, clipboardData, nativeInputValueSetter, event_2;
95
+ var _a, _b;
96
+ return __generator(this, function (_c) {
97
+ switch (_c.label) {
98
+ case 0:
99
+ input = (_a = textFieldRef.current) === null || _a === void 0 ? void 0 : _a.querySelector("input");
100
+ if (!input) return [3 /*break*/, 2];
101
+ return [4 /*yield*/, navigator.clipboard.readText()];
102
+ case 1:
103
+ clipboardData = _c.sent();
104
+ nativeInputValueSetter = (_b = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")) === null || _b === void 0 ? void 0 : _b.set;
105
+ nativeInputValueSetter === null || nativeInputValueSetter === void 0 ? void 0 : nativeInputValueSetter.call(input, clipboardData);
106
+ event_2 = new Event("input", { bubbles: true });
107
+ input.dispatchEvent(event_2);
108
+ _c.label = 2;
109
+ case 2: return [2 /*return*/];
110
+ }
111
+ });
112
+ }); }, []);
113
+ var handleScanResult = (0, react_1.useCallback)(function (result) {
114
+ if (sanitizeScanText) {
115
+ result = sanitizeScanText(result);
116
+ }
117
+ emitChange(result);
118
+ }, [sanitizeScanText, emitChange]);
119
+ var slotPropsMerge = (0, react_1.useMemo)(function () {
120
+ return lodash_1.default.merge({
121
+ input: {
122
+ endAdornment: ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: "flex", alignItems: "center", gap: 0, color: "primary.main" }, children: [canClear && !!value && !readOnly && ((0, jsx_runtime_1.jsx)(ClearInput_1.default, { onClick: function () { return emitChange(""); }, sx: { width: 24, height: 24 } })), canScan && !value && !readOnly && ((0, jsx_runtime_1.jsx)(QrCodeReader_1.default, { onScan: handleScanResult, children: (0, jsx_runtime_1.jsx)(QrScan_1.default, { sx: { width: 24, height: 24 } }) })), canPaste && !value && !readOnly && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [canScan && ((0, jsx_runtime_1.jsx)(material_1.Divider, { orientation: "vertical", flexItem: true, sx: { mx: 1.5, my: 0.5 } })), (0, jsx_runtime_1.jsx)(PasteInput_1.default, { onClick: handlePaste, sx: { width: 24, height: 24 } })] }))] })),
123
+ sx: {
124
+ caretColor: theme.palette.primary.main,
125
+ "&::selection": {
126
+ backgroundColor: (0, material_1.alpha)(theme.palette.primary.main, 0.3),
127
+ },
128
+ },
129
+ },
130
+ }, slotProps);
131
+ }, [
132
+ canClear,
133
+ value,
134
+ readOnly,
135
+ canScan,
136
+ emitChange,
137
+ canPaste,
138
+ handlePaste,
139
+ theme.palette.primary.main,
140
+ slotProps,
141
+ handleScanResult,
142
+ ]);
143
+ return ((0, jsx_runtime_1.jsx)(material_1.TextField, __assign({ ref: textFieldRef, className: (0, cn_1.cn)(className), value: value || "", onChange: onChange }, rest, { slotProps: slotPropsMerge, sx: __assign({ "& .MuiInputBase-input": {
144
+ pr: 2,
145
+ }, height: "fit-content" }, sx) })));
146
+ }
147
+ exports.default = TextField;
@@ -0,0 +1,10 @@
1
+ import { TextFieldProps, BoxProps, SxProps } from "@mui/material";
2
+ interface InputProps extends BoxProps {
3
+ inputRest?: TextFieldProps;
4
+ leftPart?: React.ReactNode;
5
+ rightPart?: React.ReactNode;
6
+ inputSx?: SxProps;
7
+ }
8
+ export type InputRef = HTMLInputElement;
9
+ declare const Input: import("react").ForwardRefExoticComponent<Omit<InputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
10
+ export default Input;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ var jsx_runtime_1 = require("react/jsx-runtime");
26
+ var material_1 = require("@mui/material");
27
+ var react_1 = require("react");
28
+ var mui_1 = require("../../../theme/mui");
29
+ var Input = (0, react_1.forwardRef)(function (props, inputRef) {
30
+ var inputRest = props.inputRest, leftPart = props.leftPart, rightPart = props.rightPart, sx = props.sx, inputSx = props.inputSx, rest = __rest(props, ["inputRest", "leftPart", "rightPart", "sx", "inputSx"]);
31
+ var theme = (0, mui_1.useTheme)();
32
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ ref: inputRef, sx: __assign(__assign(__assign({}, theme.styleMixins.row), { gap: theme.styleMixins.gaps.g12, borderRadius: 1, paddingX: theme.styleMixins.customPadding.p16, border: "1px solid ".concat(theme.palette.divider), backgroundColor: theme.palette.background.default, color: theme.palette.text.primary, backdropFilter: "blur(10px)" }), sx) }, rest, { children: [leftPart, (0, jsx_runtime_1.jsx)(material_1.TextField, __assign({ autoComplete: "off", hiddenLabel: true, sx: __assign({ backgroundColor: "transparent", border: "none", outline: "none", flex: 1, height: "fit-content", "& .MuiInputBase-input": {
33
+ border: "none",
34
+ outline: "none",
35
+ color: theme.palette.text.primary,
36
+ fontSize: theme.typography.fontSize13,
37
+ lineHeight: theme.typography.leading140,
38
+ fontWeight: theme.typography.fontWeight400,
39
+ padding: "".concat(theme.styleMixins.customPadding.p12, " ").concat(0, "px"),
40
+ // height: "fit-content",
41
+ }, "& fieldset": { border: "none" }, "& .MuiInputBase-input::placeholder": {
42
+ fontSize: theme.typography.fontSize13,
43
+ } }, inputSx) }, inputRest)), rightPart] })));
44
+ });
45
+ Input.displayName = "Input";
46
+ exports.default = Input;
@@ -0,0 +1,6 @@
1
+ import { BoxProps } from "@mui/material";
2
+ interface NftDetailProps extends BoxProps {
3
+ id?: string;
4
+ }
5
+ declare function NftDetail(props: NftDetailProps): import("react/jsx-runtime").JSX.Element;
6
+ export default NftDetail;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ var jsx_runtime_1 = require("react/jsx-runtime");
29
+ var material_1 = require("@mui/material");
30
+ var Text_1 = __importDefault(require("../Text"));
31
+ var formatDate_1 = __importDefault(require("../../../utils/formatDate"));
32
+ var mui_1 = require("../../../theme/mui");
33
+ var useNft_1 = __importDefault(require("../../../hooks/data/useNfts/useNft"));
34
+ var Button_1 = __importDefault(require("../Button"));
35
+ function NftDetail(props) {
36
+ var theme = (0, mui_1.useTheme)();
37
+ var id = props.id, sx = props.sx, rest = __rest(props, ["id", "sx"]);
38
+ var _a = (0, useNft_1.default)(id), voucher = _a.metadataAttributes, isMinting = _a.isMinting, voucherUnit = _a.voucherUnit, voucherValue = _a.voucherValue, handleClickButton = _a.handleClickButton, buttonLabel = _a.buttonLabel;
39
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ sx: __assign(__assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g16, alignItems: "center" }), sx) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g8, alignItems: "center" }), children: [(0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.bigValue), { textTransform: "none", fontSize: "2.25rem", color: theme.palette.tertiary.main }), children: [voucherValue, voucherUnit] }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.activityTitle), { textTransform: "none", fontSize: theme.typography.fontSize24 }), children: voucher === null || voucher === void 0 ? void 0 : voucher.title }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.activityDescription), { textTransform: "none", fontSize: theme.typography.fontSize14 }), children: voucher === null || voucher === void 0 ? void 0 : voucher.description }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
40
+ display: "flex",
41
+ flexDirection: "row",
42
+ alignItems: "center",
43
+ mt: "auto",
44
+ gap: theme.styleMixins.gaps.g4,
45
+ }, children: (voucher === null || voucher === void 0 ? void 0 : voucher.expire) && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.activityDescription), { textTransform: "none", py: 1, px: 2, borderRadius: Infinity, color: theme.palette.tertiary.main, backgroundColor: "color-mix(in srgb, currentcolor 10%, transparent)", fontSize: theme.typography.fontSize13 }), children: ["Exp ", (0, formatDate_1.default)(voucher === null || voucher === void 0 ? void 0 : voucher.expire)] })) })] }), (0, jsx_runtime_1.jsx)(Button_1.default, { sx: { mt: "auto" }, onClick: handleClickButton, loading: isMinting, fullWidth: true, children: buttonLabel })] })));
46
+ }
47
+ exports.default = NftDetail;
@@ -0,0 +1,8 @@
1
+ import { BoxProps } from "@mui/material";
2
+ interface NftItemProps extends BoxProps {
3
+ id?: string;
4
+ noAction?: boolean;
5
+ useSnapshot?: boolean;
6
+ }
7
+ declare function NftItem(props: NftItemProps): import("react/jsx-runtime").JSX.Element;
8
+ export default NftItem;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ var jsx_runtime_1 = require("react/jsx-runtime");
29
+ var material_1 = require("@mui/material");
30
+ var mui_1 = require("../../../theme/mui");
31
+ var Text_1 = __importDefault(require("../Text"));
32
+ var useNft_1 = __importDefault(require("../../../hooks/data/useNfts/useNft"));
33
+ var Button_1 = __importDefault(require("../Button"));
34
+ var useFormatter_1 = __importDefault(require("../../../hooks/useFormatter"));
35
+ var react_1 = require("react");
36
+ var useCustomRouter_1 = __importDefault(require("../../../hooks/useCustomRouter"));
37
+ function NftItem(props) {
38
+ var sx = props.sx, id = props.id, _a = props.noAction, noAction = _a === void 0 ? false : _a, _b = props.useSnapshot, useSnapshot = _b === void 0 ? false : _b, rest = __rest(props, ["sx", "id", "noAction", "useSnapshot"]);
39
+ var theme = (0, mui_1.useTheme)();
40
+ var formatDate = (0, useFormatter_1.default)().formatDate;
41
+ var _c = (0, useNft_1.default)(id, useSnapshot), voucher = _c.metadataAttributes, isMinting = _c.isMinting, voucherUnit = _c.voucherUnit, voucherValue = _c.voucherValue, handleClickButton = _c.handleClickButton, buttonLabel = _c.buttonLabel; // in this phase we use nft metadata for voucher data
42
+ var router = (0, useCustomRouter_1.default)();
43
+ (0, react_1.useEffect)(function () {
44
+ if (!id)
45
+ return;
46
+ router.prefetch("?detail=".concat(id));
47
+ }, [id, router]);
48
+ var handleClick = (0, react_1.useCallback)(function () {
49
+ router.push("?detail=".concat(id));
50
+ }, [id, router]);
51
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ onClick: noAction ? undefined : handleClick, sx: __assign(__assign(__assign({}, theme.styleMixins.row), { backgroundColor: theme.palette.background.tertiary, borderRadius: theme.styleMixins.customRadius.r16, backdropFilter: "blur(12px)", cursor: noAction ? "not-allowed" : "pointer", display: "grid", pointerEvents: noAction ? "none" : "auto", gridTemplateColumns: "0.3346303502fr 1px 1fr" }), sx) }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
52
+ width: "100%",
53
+ aspectRatio: "1/1",
54
+ display: "flex",
55
+ flexDirection: "column",
56
+ justifyContent: "center",
57
+ alignItems: "center",
58
+ }, children: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.bigValue), { textTransform: "none", color: "text.primary" }), children: [voucherValue, voucherUnit] }) }), (0, jsx_runtime_1.jsx)(material_1.Divider, { orientation: "vertical", flexItem: true, sx: { borderStyle: "dashed" } }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
59
+ width: "100%",
60
+ display: "flex",
61
+ flexDirection: "column",
62
+ height: "100%",
63
+ pr: 3,
64
+ pl: theme.spacing(4),
65
+ py: 2,
66
+ }, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.activityTitle), { textTransform: "none" }), children: voucher === null || voucher === void 0 ? void 0 : voucher.title }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.activityDescription), { textTransform: "none" }), children: voucher === null || voucher === void 0 ? void 0 : voucher.description }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
67
+ display: "flex",
68
+ flexDirection: "row",
69
+ alignItems: "center",
70
+ mt: "auto",
71
+ gap: theme.styleMixins.gaps.g4,
72
+ }, children: [(voucher === null || voucher === void 0 ? void 0 : voucher.expire) && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.styleMixins.activityDescription), { textTransform: "none" }), children: ["Exp ", formatDate(voucher === null || voucher === void 0 ? void 0 : voucher.expire)] })), !noAction && ((0, jsx_runtime_1.jsx)(Button_1.default, { size: "small", sx: { ml: "auto" }, onClick: handleClickButton, loading: isMinting, children: buttonLabel }))] })] })] })));
73
+ }
74
+ exports.default = NftItem;
@@ -0,0 +1,2 @@
1
+ export declare const NftsBoard: () => import("react/jsx-runtime").JSX.Element;
2
+ export default NftsBoard;
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ "use client";
3
+ var __assign = (this && this.__assign) || function () {
4
+ __assign = Object.assign || function(t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
+ t[p] = s[p];
9
+ }
10
+ return t;
11
+ };
12
+ return __assign.apply(this, arguments);
13
+ };
14
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ var desc = Object.getOwnPropertyDescriptor(m, k);
17
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
+ desc = { enumerable: true, get: function() { return m[k]; } };
19
+ }
20
+ Object.defineProperty(o, k2, desc);
21
+ }) : (function(o, m, k, k2) {
22
+ if (k2 === undefined) k2 = k;
23
+ o[k2] = m[k];
24
+ }));
25
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
27
+ }) : function(o, v) {
28
+ o["default"] = v;
29
+ });
30
+ var __importStar = (this && this.__importStar) || (function () {
31
+ var ownKeys = function(o) {
32
+ ownKeys = Object.getOwnPropertyNames || function (o) {
33
+ var ar = [];
34
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
35
+ return ar;
36
+ };
37
+ return ownKeys(o);
38
+ };
39
+ return function (mod) {
40
+ if (mod && mod.__esModule) return mod;
41
+ var result = {};
42
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
43
+ __setModuleDefault(result, mod);
44
+ return result;
45
+ };
46
+ })();
47
+ var __importDefault = (this && this.__importDefault) || function (mod) {
48
+ return (mod && mod.__esModule) ? mod : { "default": mod };
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.NftsBoard = void 0;
52
+ var jsx_runtime_1 = require("react/jsx-runtime");
53
+ var material_1 = require("@mui/material");
54
+ var mui_1 = require("../../../theme/mui");
55
+ var NftItem_1 = __importDefault(require("../NftItem"));
56
+ var SmartList_1 = __importDefault(require("../SmartList"));
57
+ var WaitingData_1 = __importDefault(require("../WaitingData"));
58
+ var EmptyData_1 = __importDefault(require("../EmptyData"));
59
+ var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
60
+ var useNfts_1 = __importDefault(require("../../../hooks/data/useNfts"));
61
+ var navigation_1 = require("next/navigation");
62
+ var react_1 = require("react");
63
+ var DrawerComponent_1 = __importStar(require("../DrawerComponent"));
64
+ var NftDetailView_1 = __importDefault(require("../../views/NftDetailView"));
65
+ var useCustomRouter_1 = __importDefault(require("../../../hooks/useCustomRouter"));
66
+ var NftsBoard = function () {
67
+ var searchParams = (0, navigation_1.useSearchParams)();
68
+ var pathname = (0, navigation_1.usePathname)();
69
+ var detailNftId = searchParams.get("detail") || undefined;
70
+ var drawerNftDetailRef = (0, react_1.useRef)(null);
71
+ var theme = (0, mui_1.useTheme)();
72
+ var router = (0, useCustomRouter_1.default)();
73
+ var _a = (0, useNfts_1.default)(), nfts = _a.nfts, isLoadingNfts = _a.isLoading, hasNextPageNfts = _a.hasNextPage, fetchNextPageNfts = _a.fetchNextPage, refetchNfts = _a.refetch;
74
+ var isEmpty = nfts && nfts.length === 0;
75
+ var openDetailNft = (0, react_1.useCallback)(function () {
76
+ var _a;
77
+ (_a = drawerNftDetailRef.current) === null || _a === void 0 ? void 0 : _a.open();
78
+ }, []);
79
+ var closeDetailNft = (0, react_1.useCallback)(function () {
80
+ var _a;
81
+ (_a = drawerNftDetailRef.current) === null || _a === void 0 ? void 0 : _a.close();
82
+ }, []);
83
+ var onCloseDetailNft = (0, react_1.useCallback)(function () {
84
+ router.push(pathname);
85
+ }, [pathname, router]);
86
+ var detailNft = (0, react_1.useMemo)(function () {
87
+ if (!detailNftId)
88
+ return undefined;
89
+ var nft = nfts === null || nfts === void 0 ? void 0 : nfts.find(function (item) { return (item === null || item === void 0 ? void 0 : item.id) === detailNftId; });
90
+ return nft;
91
+ }, [detailNftId, nfts]);
92
+ (0, react_1.useEffect)(function () {
93
+ if (!!detailNft) {
94
+ openDetailNft();
95
+ }
96
+ else {
97
+ closeDetailNft();
98
+ }
99
+ }, [detailNft, openDetailNft, closeDetailNft]);
100
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g12, mt: theme.styleMixins.customMargin.m8, pt: theme.styleMixins.customPadding.p8, minHeight: !nfts ? "20rem" : "unset" }), children: [!nfts && isLoadingNfts && (0, jsx_runtime_1.jsx)(WaitingData_1.default, { sx: { margin: "auto" } }), isEmpty && ((0, jsx_runtime_1.jsx)(EmptyData_1.default, { sx: { margin: "auto", mt: 4 }, icon: (0, getIcon_1.default)("activities_empty_all"), description: "You haven't any NFT yet" })), !!nfts && !isEmpty && ((0, jsx_runtime_1.jsx)(SmartList_1.default, { loadMoreData: fetchNextPageNfts, hasMore: !!hasNextPageNfts && !isLoadingNfts, loadingComponent: (0, jsx_runtime_1.jsx)(WaitingData_1.default, { numberOfSkeleton: 2, sx: {
101
+ marginTop: theme.styleMixins.customMargin.m12,
102
+ } }), pullToRefreshProps: {
103
+ isPullable: true,
104
+ onRefresh: refetchNfts,
105
+ }, sx: {
106
+ px: 0,
107
+ }, children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
108
+ display: "grid",
109
+ gridTemplateColumns: "1fr",
110
+ gap: theme.styleMixins.gaps.g12,
111
+ }, children: nfts.map(function (item) {
112
+ if (!item)
113
+ return null;
114
+ return (0, jsx_runtime_1.jsx)(NftItem_1.default, { id: item.id }, item.id);
115
+ }) }) })), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerNftDetailRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, onClose: onCloseDetailNft, children: (0, jsx_runtime_1.jsx)(NftDetailView_1.default, { id: detailNftId }) })] }));
116
+ };
117
+ exports.NftsBoard = NftsBoard;
118
+ exports.default = exports.NftsBoard;
@@ -1,7 +1,8 @@
1
1
  import { BoxProps } from "@mui/material";
2
2
  import { IDetectedBarcode } from "@yudiel/react-qr-scanner";
3
3
  interface QrCodeReaderProps extends BoxProps {
4
- onResult: (result: IDetectedBarcode[]) => void;
4
+ onResult?: (result: IDetectedBarcode[]) => void;
5
+ onScan?: (result: string) => void;
5
6
  }
6
7
  export interface QrCodeReaderRef {
7
8
  open: () => void;
@@ -55,7 +55,7 @@ var STYLES = {
55
55
  nodeSize: "10%",
56
56
  };
57
57
  var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
58
- var sx = props.sx, className = props.className, children = props.children, onResult = props.onResult;
58
+ var sx = props.sx, className = props.className, children = props.children, onResult = props.onResult, onScan = props.onScan;
59
59
  var qrReaderContainer = (0, react_1.useRef)(null);
60
60
  var drawerRef = (0, react_1.useRef)(null);
61
61
  var _a = (0, react_1.useState)(false), isOpen = _a[0], setIsOpen = _a[1];
@@ -124,6 +124,13 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
124
124
  styleTag.remove();
125
125
  };
126
126
  }, []);
127
+ var handleScan = (0, react_1.useCallback)(function (result) {
128
+ var _a;
129
+ onResult === null || onResult === void 0 ? void 0 : onResult(result);
130
+ var text = (_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a.rawValue;
131
+ onScan === null || onScan === void 0 ? void 0 : onScan(text);
132
+ close();
133
+ }, [onResult, onScan]);
127
134
  var _d = (0, providers_1.useWalletSetup)(), topOffset = _d.topOffset, overrideQRScanMethod = _d.overrideQRScanMethod;
128
135
  if (!!overrideQRScanMethod) {
129
136
  var handleOverrideQRScanMethod = function () { return __awaiter(void 0, void 0, void 0, function () {
@@ -149,7 +156,7 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
149
156
  },
150
157
  cornerPoints: [],
151
158
  };
152
- onResult([fakeIDetectedBarcode]);
159
+ handleScan([fakeIDetectedBarcode]);
153
160
  return [3 /*break*/, 3];
154
161
  case 2:
155
162
  error_1 = _a.sent();
@@ -161,7 +168,7 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
161
168
  }); };
162
169
  return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: sx, className: className, onClick: handleOverrideQRScanMethod, ref: boxRef, children: children }));
163
170
  }
164
- return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { trigger: children, ref: drawerRef, onDone: onClose, onOpen: onOpen, sx: sx, className: className, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
171
+ return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { trigger: children, ref: drawerRef, onClose: onClose, onOpen: onOpen, sx: sx, className: className, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
165
172
  backgroundColor: "transparent !important",
166
173
  }, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { hideBack: true, title: "Scan QR code", sx: {
167
174
  position: "absolute",
@@ -254,7 +261,7 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
254
261
  height: "100%",
255
262
  objectFit: "cover",
256
263
  },
257
- }, onScan: onResult })] })] })) }) }) }));
264
+ }, onScan: handleScan })] })] })) }) }) }));
258
265
  });
259
266
  QrCodeReader.displayName = "QrCodeReader";
260
267
  exports.default = QrCodeReader;
@@ -318,7 +318,7 @@ exports.ReceiveDirectly = (0, react_1.forwardRef)(function (_a, ref) {
318
318
  mt: theme.styleMixins.customMargin.m12,
319
319
  } }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.styleMixins.valueDescription), children: warningMessage })] }))] }) }) }));
320
320
  };
321
- return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, sx: props.sx, onDone: handleClose, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "Receive ".concat((selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) || "Token"), onClose: close, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { footer: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
321
+ return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, sx: props.sx, onClose: handleClose, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "Receive ".concat((selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name) || "Token"), onClose: close, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { footer: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
322
322
  maxHeight: currentStep === ReceiveDirectlyStep.SHOW_QR_CODE ? "120px" : 0,
323
323
  overflow: "hidden",
324
324
  transition: currentStep === ReceiveDirectlyStep.SHOW_QR_CODE
@@ -438,7 +438,7 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (_a, ref) {
438
438
  var handleClearSearch = function () {
439
439
  setSearchValue("");
440
440
  };
441
- return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onDone: handleOnClose, sx: props.sx, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: RECEIVE_STEP_NAME[ReceiveStep.SELECT_METHOD], onClose: close, children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: stepDrawerRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, sx: {
441
+ return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: props.children, onOpen: props.onOpen, onClose: handleOnClose, sx: props.sx, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: RECEIVE_STEP_NAME[ReceiveStep.SELECT_METHOD], onClose: close, children: (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: stepDrawerRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, sx: {
442
442
  width: "100%",
443
443
  }, trigger: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.styleMixins.column), { gap: theme.styleMixins.gaps.g12, height: "fit-content", width: "100%" }), children: [functionsList.includes(ReceiveMethods.RECEIVE_INTERNAL) && ((0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Top up via internal transfer", description: "Receive crypto from other Ting users", icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { iconKey: "IC_RECEIVE_INTERNAL", width: 24 }), onClick: function () { return handleSelectMethod(ReceiveMethods.RECEIVE_INTERNAL); }, recommended: true })), functionsList.includes(ReceiveMethods.RECEIVE_EXTERNAL) && ((0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Top up via blockchain", description: "Deposit using a Web3 or an Exchange wallet", icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { iconKey: "IC_RECEIVE_EXTERNAL", width: 24 }), onClick: function () { return handleSelectMethod(ReceiveMethods.RECEIVE_EXTERNAL); }, recommended: true })), functionsList.includes(ReceiveMethods.RECEIVE_FIAT) && ((0, jsx_runtime_1.jsx)(FiatDeposit_1.default, { children: (0, jsx_runtime_1.jsx)(ListItemCustom_1.default, { title: "Fiat-Gateway", description: "Experimental deposit via bank transfer", icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { iconKey: "IC_RECEIVE_EXTERNAL", width: 24 }), recommended: false, onClick: function () { return handleSelectMethod(ReceiveMethods.RECEIVE_FIAT); } }) }))] }), children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
444
444
  position: "relative",
@@ -530,7 +530,7 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (_a, ref) {
530
530
  width: "100%",
531
531
  display: "flex",
532
532
  justifyContent: "center",
533
- }, onOpen: handleAmountModalOpen, onDone: onCloseAmountModal, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { htmlFor: keyboardId, children: (0, jsx_runtime_1.jsxs)(Button_1.default.Text, { sx: {
533
+ }, onOpen: handleAmountModalOpen, onClose: onCloseAmountModal, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { htmlFor: keyboardId, children: (0, jsx_runtime_1.jsxs)(Button_1.default.Text, { sx: {
534
534
  fontSize: theme.typography.fontSize14,
535
535
  textTransform: "none",
536
536
  fontWeight: theme.typography.fontWeight500,
@@ -411,7 +411,7 @@ var ReceiveHistory = function (props) {
411
411
  drawerRefs.current.detail = ref !== null && ref !== void 0 ? ref : undefined;
412
412
  }, sx: {
413
413
  width: "100%",
414
- }, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, onDone: handleOnClose, children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: {
414
+ }, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, onClose: handleOnClose, children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: {
415
415
  padding: 0,
416
416
  width: "100dvw",
417
417
  }, children: selectedItem && ((0, jsx_runtime_1.jsx)(ReceiveHistoryDetails_1.default, { onClose: handleCloseDetailDrawer, receiveData: {