tek-wallet 0.0.661 → 0.0.663

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 (22) hide show
  1. package/dist/components/TekWallet/components/ui/CloseModal/index.js +3 -6
  2. package/dist/components/TekWallet/components/ui/ConfirmByPasscode/index.js +4 -4
  3. package/dist/components/TekWallet/components/ui/HistorySwap/index.d.ts +7 -0
  4. package/dist/components/TekWallet/components/ui/HistorySwap/index.js +19 -4
  5. package/dist/components/TekWallet/components/ui/ModalDateFilter/index.d.ts +3 -4
  6. package/dist/components/TekWallet/components/ui/ModalDateFilter/index.js +11 -107
  7. package/dist/components/TekWallet/components/ui/ReceiveFunction/index.js +1 -1
  8. package/dist/components/TekWallet/components/ui/ReceiveHistory/DetailsReceiveHistory.d.ts +8 -0
  9. package/dist/components/TekWallet/components/ui/ReceiveHistory/DetailsReceiveHistory.js +121 -0
  10. package/dist/components/TekWallet/components/ui/ReceiveHistory/ReceiveCardHistory.d.ts +11 -0
  11. package/dist/components/TekWallet/components/ui/ReceiveHistory/ReceiveCardHistory.js +77 -0
  12. package/dist/components/TekWallet/components/ui/ReceiveHistory/index.js +50 -20
  13. package/dist/components/TekWallet/components/ui/UpdateLockToken/index.js +4 -1
  14. package/dist/components/TekWallet/services/axios/receive_service/type.d.ts +36 -0
  15. package/dist/components/TekWallet/services/axios/receive_service/type.js +2 -0
  16. package/dist/components/TekWallet/theme/mui/theme.d.ts +85 -0
  17. package/dist/components/TekWallet/theme/mui/theme.js +23 -0
  18. package/dist/components/TekWallet/utils/number.extension.d.ts +2 -0
  19. package/dist/components/TekWallet/utils/number.extension.js +9 -0
  20. package/dist/components/TekWallet/utils/safeText.d.ts +2 -1
  21. package/dist/components/TekWallet/utils/safeText.js +7 -1
  22. package/package.json +1 -1
@@ -21,15 +21,12 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  }
22
22
  return t;
23
23
  };
24
- var __importDefault = (this && this.__importDefault) || function (mod) {
25
- return (mod && mod.__esModule) ? mod : { "default": mod };
26
- };
27
24
  Object.defineProperty(exports, "__esModule", { value: true });
28
25
  var jsx_runtime_1 = require("react/jsx-runtime");
29
- var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
30
- var Icon_1 = __importDefault(require("../Icon"));
26
+ var material_1 = require("@mui/material");
27
+ var SvgPath_1 = require("../SvgPath");
31
28
  var CloseModal = function (props) {
32
29
  var rest = __rest(props, []);
33
- return (0, jsx_runtime_1.jsx)(Icon_1.default, __assign({ src: (0, getIcon_1.default)("close_modal"), sx: __assign({ width: "1.5rem", height: "1.5rem" }, props.sx) }, rest));
30
+ return ((0, jsx_runtime_1.jsx)(material_1.SvgIcon, __assign({ sx: { width: 20, height: 20 } }, rest, { children: SvgPath_1.IC_CLOSE })));
34
31
  };
35
32
  exports.default = CloseModal;
@@ -94,7 +94,7 @@ var ThemeProvider_1 = require("../../../providers/ThemeProvider");
94
94
  var LoadingLayout_1 = __importDefault(require("../LoadingLayout"));
95
95
  var DrawerComponent_1 = __importDefault(require("../DrawerComponent"));
96
96
  var authentication_by_passcode_service_1 = __importDefault(require("../../../services/axios/authentication-by-passcode-service"));
97
- var xhub_keyboard_1 = require("xhub-keyboard");
97
+ var expose_1 = require("../../../../../Boilerplate/XHubKeyboard/expose");
98
98
  var handleVerifyPasscode = function (data) { return __awaiter(void 0, void 0, void 0, function () {
99
99
  var response, err_1;
100
100
  return __generator(this, function (_a) {
@@ -192,18 +192,18 @@ var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
192
192
  }
193
193
  });
194
194
  }); };
195
- return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { style: {
195
+ return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: drawerRef, trigger: (0, jsx_runtime_1.jsx)(expose_1.Label, { style: {
196
196
  width: "100%",
197
197
  }, useBrowserInput: false, htmlFor: "confirm-passcode-keyboard", children: props.children }), onOpen: handleOnOpen, onClose: handleOnClose, sx: {
198
198
  width: "100%",
199
199
  maxWidth: "calc(100dvw - 2rem)",
200
200
  display: "flex",
201
- }, children: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id: "confirm-passcode-keyboard", keyboardType: xhub_keyboard_1.KeyboardType.Integer, value: otp, onChange: handleOtpChange, children: (0, jsx_runtime_1.jsx)(LoadingLayout_1.default, { initLoading: false, ref: loadingRef, sx: {
201
+ }, children: (0, jsx_runtime_1.jsx)(expose_1.Keyboard, { id: "confirm-passcode-keyboard", keyboardType: expose_1.KeyboardType.Integer, value: otp, onChange: handleOtpChange, children: (0, jsx_runtime_1.jsx)(LoadingLayout_1.default, { initLoading: false, ref: loadingRef, sx: {
202
202
  backgroundColor: "transparent",
203
203
  width: "100%",
204
204
  }, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "Enter Passcode", onClose: handleClose, sx: {
205
205
  backgroundColor: theme.palette.background.tertiary,
206
- }, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { justifyContent: "center", alignItems: "center", gap: "0.75rem", width: "100%" }), children: [(0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { style: {
206
+ }, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { justifyContent: "center", alignItems: "center", gap: "0.75rem", width: "100%" }), children: [(0, jsx_runtime_1.jsx)(expose_1.Label, { style: {
207
207
  width: "100%",
208
208
  }, useBrowserInput: false, htmlFor: "confirm-passcode-keyboard", children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: otp, onChange: handleOtpChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.CONFIRM_BY_PASSCODE }) }), !!authError && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { alignSelf: "flex-start" }), children: authError }))] }) }) }) }) }));
209
209
  });
@@ -1,3 +1,4 @@
1
+ import { DrawerComponentRef } from "../DrawerComponent";
1
2
  interface HistorySwapProps {
2
3
  onClose?: () => void;
3
4
  open?: boolean;
@@ -5,5 +6,11 @@ interface HistorySwapProps {
5
6
  export interface HistorySwapRef {
6
7
  resetStatus: () => void;
7
8
  }
9
+ export type DrawerRefs = {
10
+ token: DrawerComponentRef;
11
+ status: DrawerComponentRef;
12
+ detail: DrawerComponentRef;
13
+ date: DrawerComponentRef;
14
+ };
8
15
  declare const HistorySwap: (props: HistorySwapProps) => import("react/jsx-runtime").JSX.Element;
9
16
  export default HistorySwap;
@@ -93,6 +93,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
93
93
  };
94
94
  Object.defineProperty(exports, "__esModule", { value: true });
95
95
  var jsx_runtime_1 = require("react/jsx-runtime");
96
+ /* eslint-disable react-hooks/exhaustive-deps */
96
97
  var react_1 = require("react");
97
98
  var ChildPageLayout_1 = __importDefault(require("../../layouts/ChildPageLayout"));
98
99
  var providers_1 = require("../../../providers");
@@ -141,8 +142,12 @@ var HistorySwap = function (props) {
141
142
  var _f = (0, react_1.useState)(undefined), getActivities = _f[0], setGetActivities = _f[1];
142
143
  var _g = (0, react_1.useState)(false), isLoading = _g[0], setLoading = _g[1];
143
144
  var drawerRefs = (0, react_1.useRef)({});
144
- var _h = (0, react_1.useState)(null), valueStartDate = _h[0], setValueStartDate = _h[1];
145
- var _j = (0, react_1.useState)(null), valueEndDate = _j[0], setValueEndDate = _j[1];
145
+ // const [valueStartDate, setValueStartDate] = useState<Dayjs | null>(null);
146
+ // const [valueEndDate, setValueEndDate] = useState<Dayjs | null>(null);
147
+ var _h = (0, react_1.useState)({
148
+ startDate: null,
149
+ endDate: null,
150
+ }), dateFilter = _h[0], setDateFilter = _h[1];
146
151
  var router = (0, useCustomRouter_1.default)();
147
152
  var getTransactionStatuses = function (statuses) {
148
153
  if (statuses.includes("all")) {
@@ -161,7 +166,7 @@ var HistorySwap = function (props) {
161
166
  for (var _i = 0; _i < arguments.length; _i++) {
162
167
  args_1[_i] = arguments[_i];
163
168
  }
164
- return __awaiter(void 0, __spreadArray([], args_1, true), void 0, function (statuses) {
169
+ return __awaiter(void 0, __spreadArray([], args_1, true), void 0, function (statuses, fromDate, toDate) {
165
170
  var transactionStatus, response, error_1;
166
171
  var _a;
167
172
  if (statuses === void 0) { statuses = ["all"]; }
@@ -176,6 +181,8 @@ var HistorySwap = function (props) {
176
181
  return [4 /*yield*/, (0, get_activities_service_1.default)({
177
182
  transaction_types: type_1.TransactionSlug.Swap,
178
183
  transaction_status: transactionStatus,
184
+ from_date: fromDate,
185
+ to_date: toDate,
179
186
  page: 1,
180
187
  take: 10,
181
188
  })];
@@ -202,6 +209,12 @@ var HistorySwap = function (props) {
202
209
  (0, react_1.useEffect)(function () {
203
210
  fetchSwapHistory(selectedStatuses);
204
211
  }, [selectedStatuses]);
212
+ (0, react_1.useEffect)(function () {
213
+ var _a, _b;
214
+ if (!!dateFilter.startDate && !!dateFilter.endDate) {
215
+ fetchSwapHistory(selectedStatuses, (_a = dateFilter.startDate) === null || _a === void 0 ? void 0 : _a.toISOString(), (_b = dateFilter.endDate) === null || _b === void 0 ? void 0 : _b.toISOString());
216
+ }
217
+ }, [dateFilter.startDate, dateFilter.endDate]);
205
218
  var resultData = (0, react_1.useMemo)(function () {
206
219
  var data = getActivities || (transactionDetail === null || transactionDetail === void 0 ? void 0 : transactionDetail.data);
207
220
  if (Array.isArray(data)) {
@@ -372,7 +385,9 @@ var HistorySwap = function (props) {
372
385
  height: "15px",
373
386
  }, onClick: handleCloseDrawer })] }), sx: {
374
387
  backgroundColor: theme.palette.background.tertiary,
375
- }, children: (0, jsx_runtime_1.jsx)(ModalDateFilter_1.default, { valueStartDate: valueStartDate, valueEndDate: valueEndDate, setValueStartDate: setValueStartDate, setValueEndDate: setValueEndDate }) }) })] }) }), resultData && resultData.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
388
+ }, children: (0, jsx_runtime_1.jsx)(ModalDateFilter_1.default, { drawerRefs: drawerRefs.current.date, handleConfirm: function (startDate, endDate) {
389
+ setDateFilter({ startDate: startDate || null, endDate: endDate || null });
390
+ } }) }) })] }) }), resultData && resultData.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
376
391
  width: "100%",
377
392
  opacity: 0.6,
378
393
  backgroundColor: theme.palette.border.accent3,
@@ -1,9 +1,8 @@
1
1
  import { Dayjs } from "dayjs";
2
+ import { DrawerComponentRef } from "../DrawerComponent";
2
3
  interface ModalDateFilterProps {
3
- valueStartDate: Dayjs | null;
4
- valueEndDate: Dayjs | null;
5
- setValueStartDate: (date: Dayjs | null) => void;
6
- setValueEndDate: (date: Dayjs | null) => void;
4
+ handleConfirm: (startDate?: Dayjs | null, endDate?: Dayjs | null) => void;
5
+ drawerRefs?: DrawerComponentRef;
7
6
  }
8
7
  declare const ModalDateFilter: (props: ModalDateFilterProps) => import("react/jsx-runtime").JSX.Element;
9
8
  export default ModalDateFilter;
@@ -44,25 +44,28 @@ var Text_1 = __importDefault(require("../Text"));
44
44
  var DatePicker_1 = __importDefault(require("../DatePicker"));
45
45
  var Row_1 = __importDefault(require("../Row"));
46
46
  var Column_1 = __importDefault(require("../Column"));
47
+ var dayjs_1 = __importDefault(require("dayjs"));
47
48
  var SvgPath_1 = require("../SvgPath");
48
49
  var Button_1 = __importStar(require("../Button"));
49
50
  var ModalDateFilter = function (props) {
50
- var valueStartDate = props.valueStartDate, valueEndDate = props.valueEndDate, setValueStartDate = props.setValueStartDate, setValueEndDate = props.setValueEndDate;
51
+ var drawerRefs = props.drawerRefs, handleConfirm = props.handleConfirm;
52
+ var _a = (0, react_1.useState)(null), valueStartDate = _a[0], setValueStartDate = _a[1];
53
+ var _b = (0, react_1.useState)(null), valueEndDate = _b[0], setValueEndDate = _b[1];
51
54
  var theme = (0, providers_1.useTheme)();
52
- var _a = (0, react_1.useState)(null), errorEndDate = _a[0], setErrorEndDate = _a[1];
55
+ var _c = (0, react_1.useState)(null), errorEndDate = _c[0], setErrorEndDate = _c[1];
53
56
  return ((0, jsx_runtime_1.jsxs)(Column_1.default, { sx: {
54
57
  paddingTop: theme.mixins.customPadding.p2,
55
58
  paddingBottom: theme.mixins.customPadding.p2,
56
59
  }, children: [(0, jsx_runtime_1.jsxs)(Row_1.default, { sx: {
57
60
  gap: theme.mixins.gaps.g8,
58
61
  }, children: [(0, jsx_runtime_1.jsx)(DatePicker_1.default, { onSelect: function (date) {
59
- setValueStartDate(date);
62
+ setValueStartDate((0, dayjs_1.default)(date).startOf("day"));
60
63
  }, value: valueStartDate, disableFuture: true }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
61
64
  color: theme.palette.primary.main,
62
65
  fontWeight: theme.typography.fontWeight600,
63
66
  fontSize: theme.typography.fontSize12,
64
67
  }, children: "to" }), (0, jsx_runtime_1.jsx)(DatePicker_1.default, { onSelect: function (date) {
65
- setValueEndDate(date);
68
+ setValueEndDate((0, dayjs_1.default)(date).endOf("day"));
66
69
  }, value: valueEndDate, disablePastFrom: valueStartDate, onError: function (error) {
67
70
  setErrorEndDate(error);
68
71
  }, disableFuture: true })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
@@ -83,111 +86,12 @@ var ModalDateFilter = function (props) {
83
86
  alignItems: "center",
84
87
  justifyContent: "center",
85
88
  }, onClick: function () {
86
- // setQueryTransferHistory({
87
- // startDate: null,
88
- // endDate: null,
89
- // });
90
89
  setValueStartDate(null);
91
90
  setValueEndDate(null);
92
- // modalBottomSheetRef.current?.close();
91
+ drawerRefs === null || drawerRefs === void 0 ? void 0 : drawerRefs.close();
93
92
  }, children: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 20, height: 20 }, children: SvgPath_1.IC_TRASH }) }), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { className: "w-full", status: !!valueStartDate && !!valueEndDate && !errorEndDate ? Button_1.BUTTON_STATUS.ENABLED : Button_1.BUTTON_STATUS.DISABLED, onClick: function () {
94
- // setQueryTransferHistory({
95
- // startDate: valueStartDate?.toISOString(),
96
- // endDate: valueEndDate?.toISOString(),
97
- // });
98
- // modalBottomSheetRef.current?.close();
99
- // setValueStartDate(valueStartDate);
100
- // setValueEndDate(valueEndDate);
101
- }, children: "Confirm" })] })] })
102
- // <Box>
103
- // <Divider
104
- // sx={{
105
- // backgroundColor: theme.palette.border.accent3,
106
- // width: "100%",
107
- // mt: theme.mixins.customMargin.m12,
108
- // mb: theme.mixins.customMargin.m6,
109
- // }}
110
- // />
111
- // <Text
112
- // sx={{
113
- // color: theme.palette.text.black,
114
- // fontWeight: theme.typography.fontWeight500,
115
- // fontSize: theme.typography.fontSize12,
116
- // }}
117
- // >
118
- // Date Picker
119
- // </Text>
120
- // <Box
121
- // sx={{
122
- // ...theme.mixins.row,
123
- // gap: theme.mixins.gaps.g8,
124
- // mt: theme.mixins.customMargin.m12,
125
- // }}
126
- // >
127
- // <InputBase
128
- // sx={{
129
- // borderRadius: theme.mixins.customRadius.r8,
130
- // border: theme.palette.primary.main,
131
- // padding: theme.mixins.customPadding.p12,
132
- // textAlign: "center",
133
- // backgroundColor: theme.palette.background.white,
134
- // color: theme.palette.primary.main,
135
- // }}
136
- // />
137
- // <Text
138
- // sx={{
139
- // fontWeight: theme.typography.fontWeight600,
140
- // color: theme.palette.text.accent,
141
- // fontSize: theme.typography.fontSize12,
142
- // }}
143
- // >
144
- // to
145
- // </Text>
146
- // <InputBase
147
- // sx={{
148
- // borderRadius: theme.mixins.customRadius.r8,
149
- // border: theme.palette.primary.main,
150
- // padding: theme.mixins.customPadding.p12,
151
- // textAlign: "center",
152
- // backgroundColor: theme.palette.background.white,
153
- // color: theme.palette.primary.main,
154
- // }}
155
- // />
156
- // </Box>
157
- // <Divider
158
- // sx={{
159
- // backgroundColor: theme.palette.border.accent3,
160
- // width: "100%",
161
- // mt: theme.mixins.customMargin.m12,
162
- // mb: theme.mixins.customMargin.m6,
163
- // }}
164
- // />
165
- // {/* <Box
166
- // sx={{
167
- // ...theme.mixins.row,
168
- // gap: theme.mixins.gaps.g8,
169
- // mt: theme.mixins.customMargin.m12,
170
- // }}
171
- // >
172
- // <Button>
173
- // <Icon src={getIcon("")} />
174
- // </Button>
175
- // <Text
176
- // sx={{
177
- // fontWeight: theme.typography.fontWeight600,
178
- // color: theme.palette.text.accent,
179
- // fontSize: theme.typography.fontSize12,
180
- // }}
181
- // >
182
- // to
183
- // </Text>
184
- // <Button sx={{
185
- // backgroundColor:
186
- // }}>
187
- // <Icon src={getIcon("")} />
188
- // </Button>
189
- // </Box> */}
190
- // </Box>
191
- );
93
+ handleConfirm(valueStartDate, valueEndDate);
94
+ drawerRefs === null || drawerRefs === void 0 ? void 0 : drawerRefs.close();
95
+ }, children: "Confirm" })] })] }));
192
96
  };
193
97
  exports.default = ModalDateFilter;
@@ -318,7 +318,7 @@ exports.ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
318
318
  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 () { return handleSelectMethod(item); }, sx: {
319
319
  my: theme.mixins.customMargin.m12,
320
320
  } })] }, item));
321
- }) }) }, ReceiveStep.SELECT_METHOD) }, receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) })) : ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
321
+ }) }) }, ReceiveStep.SELECT_METHOD) }, receiveTokens === null || receiveTokens === void 0 ? void 0 : receiveTokens.length) })) : ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { className: "h-[100dvh]", sx: {
322
322
  padding: theme.mixins.pagePadding,
323
323
  position: "relative",
324
324
  }, header: (0, jsx_runtime_1.jsx)(BackHeader_1.default, { sx: {
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { SwapResponse } from "../../../services/axios/swap-service/type";
3
+ interface DetailsReceiveHistoryProps {
4
+ onClose?: () => void;
5
+ receiveData?: SwapResponse;
6
+ }
7
+ declare const DetailsReceiveHistory: React.FC<DetailsReceiveHistoryProps>;
8
+ export default DetailsReceiveHistory;
@@ -0,0 +1,121 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var jsx_runtime_1 = require("react/jsx-runtime");
18
+ var react_1 = require("react");
19
+ var useWallet_1 = __importDefault(require("../../../hooks/useWallet"));
20
+ var providers_1 = require("../../../providers");
21
+ var ChildPageLayout_1 = __importDefault(require("../../layouts/ChildPageLayout"));
22
+ var Button_1 = __importDefault(require("../Button"));
23
+ var Text_1 = __importDefault(require("../Text"));
24
+ var material_1 = require("@mui/material");
25
+ var Icon_1 = __importDefault(require("../Icon"));
26
+ var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
27
+ var LineValue_1 = __importDefault(require("../LineValue"));
28
+ var formatDate_1 = __importDefault(require("../../../utils/formatDate"));
29
+ var roundToTwoSignificantDecimals_1 = __importDefault(require("../../../utils/roundToTwoSignificantDecimals"));
30
+ var DetailsReceiveHistory = function (_a) {
31
+ var _b, _c, _d;
32
+ var onClose = _a.onClose, swapData = _a.receiveData;
33
+ var transaction = (0, useWallet_1.default)().transaction;
34
+ var theme = (0, providers_1.useTheme)();
35
+ var resultData = transaction || (swapData === null || swapData === void 0 ? void 0 : swapData.data);
36
+ var feeInfo = (0, react_1.useMemo)(function () {
37
+ var _a, _b;
38
+ return ((_b = (_a = resultData === null || resultData === void 0 ? void 0 : resultData.fee_info) === null || _a === void 0 ? void 0 : _a.fee_detail) === null || _b === void 0 ? void 0 : _b.map(function (item) { return item === null || item === void 0 ? void 0 : item.currency; })) || [];
39
+ }, [resultData]);
40
+ var getOutputs = feeInfo === null || feeInfo === void 0 ? void 0 : feeInfo.map(function (item) { return item === null || item === void 0 ? void 0 : item.outputs; });
41
+ var getDetailOutputs = ((_b = getOutputs === null || getOutputs === void 0 ? void 0 : getOutputs[0]) === null || _b === void 0 ? void 0 : _b.map(function (item) { return item; })) || [];
42
+ var getInfoDetailOutputs = (0, react_1.useMemo)(function () {
43
+ return (getDetailOutputs === null || getDetailOutputs === void 0 ? void 0 : getDetailOutputs[0]) || {};
44
+ }, [getDetailOutputs]);
45
+ return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: __assign({ color: theme.palette.text.black }, theme.mixins.pagePadding), footer: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
46
+ px: theme.mixins.customPadding.p12,
47
+ position: "relative",
48
+ bottom: theme.typography.fontSize24,
49
+ }, children: (resultData === null || resultData === void 0 ? void 0 : resultData.transaction_status) == "processing" || (resultData === null || resultData === void 0 ? void 0 : resultData.transaction_status) == "failed" ? ((0, jsx_runtime_1.jsx)(Button_1.default.Primary, { onClick: onClose, sx: __assign(__assign({ gap: theme.mixins.gaps.g4 }, theme.mixins.row), { color: theme.palette.text.secondary, borderRadius: theme.mixins.customRadius.r12, height: "40px" }), fullWidth: true, children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
50
+ fontSize: theme.typography.fontSize12,
51
+ fontWeight: theme.typography.fontWeight600,
52
+ leading: theme.typography.leading160,
53
+ textTransform: "none",
54
+ color: theme.palette.secondary.main,
55
+ }, children: "Close" }) })) : ((resultData === null || resultData === void 0 ? void 0 : resultData.transaction_status) == "success" && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, justifyContent: "center" }), children: [(0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { onClick: onClose, sx: __assign(__assign({ gap: theme.mixins.gaps.g4 }, theme.mixins.row), { borderRadius: theme.mixins.customRadius.r12, borderColor: theme.palette.primary.main, backgroundColor: "transparent", maxWidth: "100%", height: "40px" }), fullWidth: true, children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
56
+ fontSize: theme.typography.fontSize13,
57
+ fontWeight: theme.typography.fontWeight600,
58
+ color: theme.palette.primary.main,
59
+ leading: theme.typography.leading160,
60
+ textTransform: "none",
61
+ }, children: "Close" }) }), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { onClick: onClose, sx: __assign(__assign({ gap: theme.mixins.gaps.g4 }, theme.mixins.row), { color: theme.palette.text.secondary, borderRadius: theme.mixins.customRadius.r12, maxWidth: "100%", height: "40px" }), fullWidth: true, children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
62
+ fontSize: theme.typography.fontSize13,
63
+ fontWeight: theme.typography.fontWeight600,
64
+ leading: theme.typography.leading160,
65
+ textTransform: "none",
66
+ color: theme.palette.secondary.main,
67
+ }, children: "View asset" }) })] }))) }), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({ width: "100%" }, theme.mixins.column), { top: 0, transform: "translateY(30%)", gap: theme.mixins.gaps.g12, backgroundColor: theme.palette.background.tertiary, borderRadius: theme.mixins.customRadius.r16, padding: theme.mixins.customPadding.p16, paddingTop: "80px", alignItems: "flex-start", position: "relative", marginTop: "75px" }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.center), { top: 0, width: "fit-content", height: "fit-content", borderRadius: theme.mixins.customRadius.r12, padding: theme.mixins.customPadding.p8 }), children: (0, jsx_runtime_1.jsx)(Icon_1.default, { width: 100, height: 100, src: (0, getIcon_1.default)((resultData === null || resultData === void 0 ? void 0 : resultData.transaction_status) == "success"
68
+ ? "success"
69
+ : (resultData === null || resultData === void 0 ? void 0 : resultData.transaction_status) == "failed"
70
+ ? "failed"
71
+ : (resultData === null || resultData === void 0 ? void 0 : resultData.transaction_status) == "processing"
72
+ ? "processing"
73
+ : "") }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { mt: theme.mixins.customMargin.m8, textAlign: "center" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
74
+ color: theme.palette.text.accent2,
75
+ fontSize: theme.typography.fontSize14,
76
+ fontWeight: theme.typography.fontWeight400,
77
+ }, children: "Swapping Token" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
78
+ color: (resultData === null || resultData === void 0 ? void 0 : resultData.transaction_status) == "processing"
79
+ ? theme.palette.text.warningStatus
80
+ : (resultData === null || resultData === void 0 ? void 0 : resultData.transaction_status) == "failed"
81
+ ? theme.palette.text.errorStatus
82
+ : (resultData === null || resultData === void 0 ? void 0 : resultData.transaction_status) == "success"
83
+ ? theme.palette.text.alertStatus
84
+ : theme.palette.text.warningStatus,
85
+ fontSize: theme.typography.fontSize24,
86
+ fontWeight: theme.typography.fontWeight600,
87
+ textTransform: "capitalize",
88
+ }, children: resultData === null || resultData === void 0 ? void 0 : resultData.transaction_status }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
89
+ width: "100%",
90
+ color: theme.palette.text.accent,
91
+ mt: theme.mixins.customMargin.m12,
92
+ } }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "space-between", mt: theme.mixins.customMargin.m16 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: (_c = resultData === null || resultData === void 0 ? void 0 : resultData.currency_data) === null || _c === void 0 ? void 0 : _c.link, width: 20, height: 20, className: "rounded-full" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
93
+ fontSize: theme.typography.fontSize14,
94
+ fontWeight: theme.typography.fontWeight700,
95
+ }, children: resultData === null || resultData === void 0 ? void 0 : resultData.amount })] }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("swap_horizontal"), width: 20, height: 20 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: getInfoDetailOutputs === null || getInfoDetailOutputs === void 0 ? void 0 : getInfoDetailOutputs.link, width: 20, height: 20, className: "rounded-full" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
96
+ fontSize: theme.typography.fontSize14,
97
+ fontWeight: theme.typography.fontWeight700,
98
+ }, children: (0, roundToTwoSignificantDecimals_1.default)((resultData === null || resultData === void 0 ? void 0 : resultData.amount) * (getInfoDetailOutputs === null || getInfoDetailOutputs === void 0 ? void 0 : getInfoDetailOutputs.swap_amount)) })] })] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
99
+ width: "100%",
100
+ color: theme.palette.text.accent,
101
+ mt: theme.mixins.customMargin.m12,
102
+ } }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { sx: {
103
+ mt: theme.mixins.customMargin.m16,
104
+ mb: theme.mixins.customMargin.m16,
105
+ }, field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
106
+ fontSize: theme.typography.fontSize12,
107
+ color: theme.palette.text.blackContrast,
108
+ }, children: "Price" }), value: (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: {
109
+ fontSize: theme.typography.fontSize14,
110
+ fontWeight: theme.typography.fontWeight700,
111
+ ml: theme.mixins.customMargin.m8,
112
+ }, children: ["1 ", (_d = resultData === null || resultData === void 0 ? void 0 : resultData.currency_data) === null || _d === void 0 ? void 0 : _d.full_name, " ~ ", getInfoDetailOutputs === null || getInfoDetailOutputs === void 0 ? void 0 : getInfoDetailOutputs.swap_amount, " ", getInfoDetailOutputs === null || getInfoDetailOutputs === void 0 ? void 0 : getInfoDetailOutputs.full_name] }) }), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
113
+ fontSize: theme.typography.fontSize12,
114
+ color: theme.palette.text.blackContrast,
115
+ }, children: "Date time" }), value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
116
+ fontSize: theme.typography.fontSize14,
117
+ fontWeight: theme.typography.fontWeight700,
118
+ ml: theme.mixins.customMargin.m8,
119
+ }, children: (0, formatDate_1.default)(resultData === null || resultData === void 0 ? void 0 : resultData.date_created) }) })] })] }) }));
120
+ };
121
+ exports.default = DetailsReceiveHistory;
@@ -0,0 +1,11 @@
1
+ interface ReceiveCardHistory {
2
+ className?: string;
3
+ amount?: number;
4
+ toAddress?: string;
5
+ date?: string;
6
+ status?: string;
7
+ currencySlug?: string;
8
+ network?: string;
9
+ }
10
+ declare const ReceiveCardHistory: ({ toAddress, date, amount, currencySlug, network, status }: ReceiveCardHistory) => import("react/jsx-runtime").JSX.Element;
11
+ export default ReceiveCardHistory;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var jsx_runtime_1 = require("react/jsx-runtime");
7
+ var providers_1 = require("../../../providers");
8
+ var Text_1 = __importDefault(require("../Text"));
9
+ var Column_1 = __importDefault(require("../Column"));
10
+ var Row_1 = __importDefault(require("../Row"));
11
+ var InlineTitleValue_1 = __importDefault(require("../InlineTitleValue"));
12
+ var CopyTextComponent_1 = __importDefault(require("../CopyTextComponent"));
13
+ var safeText_1 = require("../../../utils/safeText");
14
+ var number_extension_1 = require("../../../utils/number.extension");
15
+ var material_1 = require("@mui/material");
16
+ var SvgPath_1 = require("../SvgPath");
17
+ var formatDate_1 = require("../../../utils/formatDate");
18
+ var ReceiveCardHistory = function (_a) {
19
+ var toAddress = _a.toAddress, date = _a.date, amount = _a.amount, currencySlug = _a.currencySlug, network = _a.network, status = _a.status;
20
+ var theme = (0, providers_1.useTheme)();
21
+ var getStatusColor = function (status) {
22
+ switch (status) {
23
+ case "success":
24
+ return theme.palette.success.main;
25
+ case "failed":
26
+ return theme.palette.error.main;
27
+ case "processing":
28
+ return theme.palette.warning.main;
29
+ default:
30
+ return theme.palette.text.accent2;
31
+ }
32
+ };
33
+ return ((0, jsx_runtime_1.jsxs)(Column_1.default, { sx: {
34
+ gap: theme.mixins.gaps.g2,
35
+ }, children: [(0, jsx_runtime_1.jsx)(Row_1.default, { sx: { justifyContent: "space-between" }, children: (0, jsx_runtime_1.jsxs)(Column_1.default, { sx: { gap: theme.mixins.gaps.g1 }, children: [(0, jsx_runtime_1.jsxs)(Text_1.default, { sx: {
36
+ fontWeight: 700,
37
+ fontSize: "1rem",
38
+ }, children: [(0, number_extension_1.formatCurrencyNumber)(Number(amount !== null && amount !== void 0 ? amount : 0)), " ", currencySlug === null || currencySlug === void 0 ? void 0 : currencySlug.toUpperCase()] }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
39
+ backgroundColor: getStatusColor(status !== null && status !== void 0 ? status : ""),
40
+ borderRadius: theme.mixins.customRadius.r8,
41
+ padding: theme.mixins.customPadding.p4,
42
+ width: "fit-content",
43
+ display: "flex",
44
+ alignItems: "center",
45
+ justifyContent: "center",
46
+ }, children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: { color: theme.palette.text.white, fontWeight: 500, fontSize: "0.625rem" }, children: (0, safeText_1.firstLetterToUpperCase)(status !== null && status !== void 0 ? status : "unknown") }) })] }) }), (0, jsx_runtime_1.jsxs)(Column_1.default, { sx: { gap: theme.mixins.gaps.g2, paddingTop: theme.mixins.customPadding.p4 }, children: [(0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "To address:", titleStyle: {
47
+ fontWeight: 500,
48
+ fontSize: "0.813rem",
49
+ color: theme.palette.text.accent2,
50
+ }, value: (0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: (0, safeText_1.safeText)(toAddress !== null && toAddress !== void 0 ? toAddress : "", {
51
+ isShort: true,
52
+ }), children: (0, jsx_runtime_1.jsxs)(Row_1.default, { sx: {
53
+ gap: theme.mixins.gaps.g1,
54
+ justifyContent: "space-between",
55
+ width: "100%",
56
+ }, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
57
+ whiteSpace: "nowrap",
58
+ fontWeight: 500,
59
+ fontSize: "0.813rem",
60
+ }, children: (0, safeText_1.safeText)(toAddress !== null && toAddress !== void 0 ? toAddress : "", {
61
+ isShort: true,
62
+ }) }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { width: 16, height: 16 }, children: SvgPath_1.IC_COPY })] }) }) }), (0, jsx_runtime_1.jsx)(InlineTitleValue_1.default, { title: "Network:", titleStyle: {
63
+ color: theme.palette.text.accent2,
64
+ fontWeight: 500,
65
+ fontSize: "0.813rem",
66
+ }, value: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
67
+ color: theme.palette.text.accent2,
68
+ whiteSpace: "nowrap",
69
+ fontWeight: 500,
70
+ fontSize: "0.813rem",
71
+ }, children: network === null || network === void 0 ? void 0 : network.toUpperCase() }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
72
+ color: theme.palette.text.accent2,
73
+ fontWeight: 500,
74
+ fontSize: "0.813rem",
75
+ }, children: (0, formatDate_1.customFormatDate)(date !== null && date !== void 0 ? date : "", { format: formatDate_1.DateFormat.MMM_DD_YYYY_HH_MM_SS }) })] })] }));
76
+ };
77
+ exports.default = ReceiveCardHistory;
@@ -93,6 +93,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
93
93
  };
94
94
  Object.defineProperty(exports, "__esModule", { value: true });
95
95
  var jsx_runtime_1 = require("react/jsx-runtime");
96
+ /* eslint-disable react-hooks/exhaustive-deps */
96
97
  var react_1 = require("react");
97
98
  var ChildPageLayout_1 = __importDefault(require("../../layouts/ChildPageLayout"));
98
99
  var providers_1 = require("../../../providers");
@@ -104,8 +105,6 @@ var DrawerComponent_1 = __importStar(require("../DrawerComponent"));
104
105
  var Text_1 = __importDefault(require("../Text"));
105
106
  var ModalLayout_1 = __importDefault(require("../ModalLayout"));
106
107
  var CloseModal_1 = __importDefault(require("../CloseModal"));
107
- var CardHistorySwap_1 = __importDefault(require("../CardHistorySwap"));
108
- var DetailSwapResult_1 = __importDefault(require("../DetailSwapResult"));
109
108
  var ModalStatusFilter_1 = __importDefault(require("../ModalStatusFilter"));
110
109
  var ModalDateFilter_1 = __importDefault(require("../ModalDateFilter"));
111
110
  var useCustomRouter_1 = __importDefault(require("../../../hooks/useCustomRouter"));
@@ -115,6 +114,10 @@ var navigation_1 = require("next/navigation");
115
114
  var get_activities_service_1 = __importDefault(require("../../../services/axios/get-activities-service"));
116
115
  var type_1 = require("../../../services/axios/get-activities-service/type");
117
116
  var ItemHistorySkeleton_1 = require("../ItemHistorySkeleton");
117
+ var dayjs_1 = __importDefault(require("dayjs"));
118
+ var ReceiveCardHistory_1 = __importDefault(require("./ReceiveCardHistory"));
119
+ var DetailsReceiveHistory_1 = __importDefault(require("./DetailsReceiveHistory"));
120
+ var utc_1 = __importDefault(require("dayjs/plugin/utc"));
118
121
  var historyHistoryStatus = [
119
122
  {
120
123
  title: "Success",
@@ -138,12 +141,15 @@ var HistoryReceive = function (props) {
138
141
  var searchParams = (0, navigation_1.useSearchParams)();
139
142
  var currentId = searchParams.get("current_id");
140
143
  var _e = (0, react_1.useState)(false), hasOpenedDetail = _e[0], setHasOpenedDetail = _e[1];
141
- var _f = (0, react_1.useState)(null), valueStartDate = _f[0], setValueStartDate = _f[1];
142
- var _g = (0, react_1.useState)(null), valueEndDate = _g[0], setValueEndDate = _g[1];
143
- var _h = (0, react_1.useState)(undefined), getActivities = _h[0], setGetActivities = _h[1];
144
- var _j = (0, react_1.useState)(false), isLoading = _j[0], setLoading = _j[1];
144
+ var _f = (0, react_1.useState)({
145
+ startDate: null,
146
+ endDate: null,
147
+ }), dateFilter = _f[0], setDateFilter = _f[1];
148
+ var _g = (0, react_1.useState)(undefined), getActivities = _g[0], setGetActivities = _g[1];
149
+ var _h = (0, react_1.useState)(false), isLoading = _h[0], setLoading = _h[1];
145
150
  var drawerRefs = (0, react_1.useRef)({});
146
151
  var router = (0, useCustomRouter_1.default)();
152
+ dayjs_1.default.extend(utc_1.default);
147
153
  var getTransactionStatuses = function (statuses) {
148
154
  if (statuses.includes("all")) {
149
155
  return undefined;
@@ -161,7 +167,7 @@ var HistoryReceive = function (props) {
161
167
  for (var _i = 0; _i < arguments.length; _i++) {
162
168
  args_1[_i] = arguments[_i];
163
169
  }
164
- return __awaiter(void 0, __spreadArray([], args_1, true), void 0, function (statuses) {
170
+ return __awaiter(void 0, __spreadArray([], args_1, true), void 0, function (statuses, fromDate, toDate) {
165
171
  var transactionStatus, response, error_1;
166
172
  var _a;
167
173
  if (statuses === void 0) { statuses = ["all"]; }
@@ -176,8 +182,8 @@ var HistoryReceive = function (props) {
176
182
  return [4 /*yield*/, (0, get_activities_service_1.default)({
177
183
  transaction_types: type_1.TransactionSlug.Receive,
178
184
  transaction_status: transactionStatus,
179
- from_date: valueStartDate === null || valueStartDate === void 0 ? void 0 : valueStartDate.toISOString(),
180
- to_date: valueEndDate === null || valueEndDate === void 0 ? void 0 : valueEndDate.toISOString(),
185
+ from_date: fromDate,
186
+ to_date: toDate,
181
187
  page: 1,
182
188
  take: 10,
183
189
  })];
@@ -204,9 +210,23 @@ var HistoryReceive = function (props) {
204
210
  (0, react_1.useEffect)(function () {
205
211
  fetchReceiveHistory(selectedStatuses);
206
212
  }, [selectedStatuses]);
213
+ (0, react_1.useEffect)(function () {
214
+ var _a, _b;
215
+ if (!!dateFilter.startDate && !!dateFilter.endDate) {
216
+ fetchReceiveHistory(selectedStatuses, (_a = dateFilter.startDate) === null || _a === void 0 ? void 0 : _a.toISOString(), (_b = dateFilter.endDate) === null || _b === void 0 ? void 0 : _b.toISOString());
217
+ }
218
+ }, [dateFilter.startDate, dateFilter.endDate]);
207
219
  var resultData = (0, react_1.useMemo)(function () {
208
220
  var data = getActivities || (transactionDetail === null || transactionDetail === void 0 ? void 0 : transactionDetail.data);
209
221
  if (Array.isArray(data)) {
222
+ data.push({
223
+ id: "1",
224
+ to_address: "0x1234567890",
225
+ date_created: "2021-01-01",
226
+ amount: 100,
227
+ currency_slug: "ETH",
228
+ transaction_status: "success",
229
+ });
210
230
  return data;
211
231
  }
212
232
  if (data && typeof data === "object") {
@@ -340,7 +360,9 @@ var HistoryReceive = function (props) {
340
360
  (_a = drawerRefs.current.detail) === null || _a === void 0 ? void 0 : _a.close();
341
361
  }
342
362
  }, [currentId, hasOpenedDetail, selectedItem, transactionDetail, drawerRefs.current.detail]);
343
- return ((0, jsx_runtime_1.jsxs)(ChildPageLayout_1.default, { header: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
363
+ return ((0, jsx_runtime_1.jsxs)(ChildPageLayout_1.default, { sx: {
364
+ width: "100dvw",
365
+ }, header: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
344
366
  padding: theme.mixins.customPadding.p10,
345
367
  }, children: (0, jsx_runtime_1.jsx)(BackHeader_1.default, { overrideBack: props.onClose, center: "Top up history" }) }), children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { px: theme.mixins.customPadding.p16,
346
368
  // pt: theme.mixins.customPadding.p16,
@@ -374,29 +396,37 @@ var HistoryReceive = function (props) {
374
396
  height: "15px",
375
397
  }, onClick: handleCloseDrawer })] }), sx: {
376
398
  backgroundColor: theme.palette.background.tertiary,
377
- }, children: (0, jsx_runtime_1.jsx)(ModalDateFilter_1.default, { valueStartDate: valueStartDate, valueEndDate: valueEndDate, setValueStartDate: setValueStartDate, setValueEndDate: setValueEndDate }) }) })] }) }), resultData && resultData.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
399
+ }, children: (0, jsx_runtime_1.jsx)(ModalDateFilter_1.default, { handleConfirm: function (startDate, endDate) {
400
+ setDateFilter({
401
+ startDate: dayjs_1.default.utc(startDate).startOf("day"),
402
+ endDate: dayjs_1.default.utc(endDate).endOf("day"),
403
+ });
404
+ }, drawerRefs: drawerRefs.current.date }) }) })] }) }), resultData && resultData.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
378
405
  width: "100%",
379
406
  opacity: 0.6,
380
407
  backgroundColor: theme.palette.border.accent3,
408
+ mb: theme.mixins.customMargin.m16,
381
409
  } })), isLoading && ((0, jsx_runtime_1.jsx)(material_1.Box, { className: "px-4 py-2 space-y-3", children: resultData.map(function (_, index) { return ((0, jsx_runtime_1.jsx)(ItemHistorySkeleton_1.ItemHistorySkeletonShimmer, {}, index)); }) })), !isLoading && resultData && resultData.length > 0 ? ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { overflow: "hidden" }), children: [(0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: function (ref) {
382
410
  drawerRefs.current.detail = ref !== null && ref !== void 0 ? ref : undefined;
383
411
  }, sx: {
384
412
  width: "100%",
385
413
  }, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, onClose: handleOnClose, children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: {
386
414
  padding: 0,
387
- }, children: selectedItem && ((0, jsx_runtime_1.jsx)(DetailSwapResult_1.default, { onClose: handleCloseDetailDrawer, swapData: {
415
+ }, children: selectedItem && ((0, jsx_runtime_1.jsx)(DetailsReceiveHistory_1.default, { onClose: handleCloseDetailDrawer, receiveData: {
388
416
  data: selectedItem,
389
417
  timestamp: selectedItem.date_created,
390
418
  success: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.transaction_status,
391
419
  message: "",
392
- } }, "detail-".concat(currentId))) }) }, "drawer-".concat(currentId)), resultData.map(function (item) {
393
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
394
- return ((0, jsx_runtime_1.jsx)(material_1.Box, { onClick: function () {
395
- handleTransactionClick(item.id);
396
- }, sx: {
397
- mt: theme.mixins.customMargin.m8,
398
- }, children: (0, jsx_runtime_1.jsx)(CardHistorySwap_1.default, { amount: item.amount, status: item.transaction_status, fromCurrency: (_a = item.currency_data) === null || _a === void 0 ? void 0 : _a.full_name, toCurrency: (_f = (_e = (_d = (_c = (_b = item.fee_info) === null || _b === void 0 ? void 0 : _b.fee_detail) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.currency) === null || _e === void 0 ? void 0 : _e.outputs[0]) === null || _f === void 0 ? void 0 : _f.full_name, swapAmount: (_l = (_k = (_j = (_h = (_g = item.fee_info) === null || _g === void 0 ? void 0 : _g.fee_detail) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.currency) === null || _k === void 0 ? void 0 : _k.outputs[0]) === null || _l === void 0 ? void 0 : _l.swap_amount, date: item.date_created, description: item.description }, item.id) }, item.id));
399
- })] })) : (resultData.length == 0 &&
420
+ } }, "detail-".concat(currentId))) }) }, "drawer-".concat(currentId)), resultData.map(function (item) { return ((0, jsx_runtime_1.jsxs)(material_1.Box, { onClick: function () {
421
+ handleTransactionClick(item.id);
422
+ }, sx: {
423
+ px: theme.mixins.customPadding.p16,
424
+ }, children: [(0, jsx_runtime_1.jsx)(ReceiveCardHistory_1.default, { toAddress: item.to_address, date: item.date_created, amount: item.amount, currencySlug: item.currency_slug, network: item.network, status: item.transaction_status }, item.id), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
425
+ width: "100%",
426
+ opacity: 0.6,
427
+ backgroundColor: theme.palette.border.accent3,
428
+ my: theme.mixins.customMargin.m16,
429
+ } })] }, item.id)); })] })) : (resultData.length == 0 &&
400
430
  !isLoading && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign(__assign({}, theme.mixins.center), { padding: theme.mixins.customPadding.p24 }), theme.mixins.column), { gap: theme.mixins.gaps.g4, textAlign: "center" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("result"), width: 62, height: 62, sx: {
401
431
  mx: "auto",
402
432
  mb: theme.mixins.customMargin.m12,
@@ -192,6 +192,9 @@ exports.UpdateLockToken = (0, react_1.forwardRef)(function (props, ref) {
192
192
  throw new Error("Please connect your wallet");
193
193
  (_a = confirmLayoutDrawerRef.current) === null || _a === void 0 ? void 0 : _a.open();
194
194
  };
195
+ (0, react_1.useEffect)(function () {
196
+ validateAmount(props.lockData);
197
+ }, [props.lockData, validateAmount]);
195
198
  var handleClose = function () {
196
199
  var _a;
197
200
  if (!isInitPasscode)
@@ -204,7 +207,7 @@ exports.UpdateLockToken = (0, react_1.forwardRef)(function (props, ref) {
204
207
  }); });
205
208
  (0, react_1.useEffect)(function () {
206
209
  validateAmount(props.lockData);
207
- }, [props.lockData, validateAmount]);
210
+ }, [validateAmount]);
208
211
  (0, react_1.useEffect)(function () {
209
212
  if (!!lockedTokens || !isInitPasscode)
210
213
  return;
@@ -0,0 +1,36 @@
1
+ import { FeesDataType } from "../get-est-fee-service/type";
2
+ export interface ReceiveBody {
3
+ amount?: string;
4
+ currency_slug?: string;
5
+ to_currency_slug?: string;
6
+ passcode?: string;
7
+ network?: string;
8
+ }
9
+ export interface ReceiveResponse {
10
+ success?: boolean;
11
+ message?: string;
12
+ data?: ReceiveDataTransaction;
13
+ timestamp?: string;
14
+ }
15
+ export interface ReceiveDataTransaction {
16
+ id?: number;
17
+ transaction_type?: string;
18
+ from_address?: string;
19
+ to_address?: null;
20
+ network?: string;
21
+ currency_slug?: string;
22
+ fee?: string;
23
+ amount?: string;
24
+ transaction_status?: string;
25
+ user_created?: string;
26
+ user_updated?: string;
27
+ date_created?: string;
28
+ date_updated?: null;
29
+ description?: null;
30
+ from_locked_balance?: null;
31
+ to_locked_balance?: null;
32
+ from_app_slug?: string;
33
+ feeInfo?: FeesDataType;
34
+ fee_info?: FeesDataType;
35
+ to_currency_slug?: string;
36
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -8,6 +8,22 @@ declare const theme: {
8
8
  main: string;
9
9
  contrastText: string;
10
10
  };
11
+ success: {
12
+ main: string;
13
+ contrastText: string;
14
+ };
15
+ error: {
16
+ main: string;
17
+ contrastText: string;
18
+ };
19
+ warning: {
20
+ main: string;
21
+ contrastText: string;
22
+ };
23
+ info: {
24
+ main: string;
25
+ contrastText: string;
26
+ };
11
27
  background: {
12
28
  white: string;
13
29
  white80: string;
@@ -45,6 +61,10 @@ declare const theme: {
45
61
  accent: string;
46
62
  accent3: string;
47
63
  tertiary: string;
64
+ success: string;
65
+ error: string;
66
+ info: string;
67
+ warning: string;
48
68
  };
49
69
  text: {
50
70
  white: string;
@@ -198,6 +218,71 @@ declare const theme: {
198
218
  g32: string;
199
219
  g40: string;
200
220
  };
221
+ background: {
222
+ white: string;
223
+ white80: string;
224
+ white64: string;
225
+ white24: string;
226
+ white16: string;
227
+ black: string;
228
+ black64: string;
229
+ black24: string;
230
+ black16: string;
231
+ primary: string;
232
+ primary16: string;
233
+ secondary: string;
234
+ secondary16: string;
235
+ error: string;
236
+ error16: string;
237
+ tertiary: string;
238
+ accent3: string;
239
+ successStatus: string;
240
+ infoStatus: string;
241
+ errorStatus: string;
242
+ };
243
+ border: {
244
+ primary: string;
245
+ white: string;
246
+ white64: string;
247
+ white24: string;
248
+ white16: string;
249
+ black: string;
250
+ black64: string;
251
+ black24: string;
252
+ black16: string;
253
+ secondary: string;
254
+ secondary16: string;
255
+ accent: string;
256
+ accent3: string;
257
+ tertiary: string;
258
+ success: string;
259
+ error: string;
260
+ info: string;
261
+ warning: string;
262
+ };
263
+ text: {
264
+ white: string;
265
+ white80: string;
266
+ white64: string;
267
+ white24: string;
268
+ black: string;
269
+ black80: string;
270
+ black64: string;
271
+ black24: string;
272
+ blackContrast: string;
273
+ primary: string;
274
+ secondary: string;
275
+ accent: string;
276
+ accent2: string;
277
+ successStatus: string;
278
+ errorStatus: string;
279
+ loadingStatus: string;
280
+ increase: string;
281
+ decrease: string;
282
+ warningStatus: string;
283
+ alertStatus: string;
284
+ tertiary: string;
285
+ };
201
286
  row: {
202
287
  display: string;
203
288
  alignItems: string;
@@ -64,6 +64,10 @@ var border = {
64
64
  accent: "#A3A3A3",
65
65
  accent3: "#E5E6E6",
66
66
  tertiary: "#ECF4E9",
67
+ success: "#1EA031",
68
+ error: "#FF434E",
69
+ info: "#29C8F0",
70
+ warning: "#FFA500",
67
71
  };
68
72
  var text = {
69
73
  white: "#ffffff",
@@ -188,6 +192,22 @@ var theme = {
188
192
  main: "#C5E99F",
189
193
  contrastText: "#000000",
190
194
  },
195
+ success: {
196
+ main: "#1EA031",
197
+ contrastText: "#000000",
198
+ },
199
+ error: {
200
+ main: "#FF434E",
201
+ contrastText: "#000000",
202
+ },
203
+ warning: {
204
+ main: "#FFA500",
205
+ contrastText: "#000000",
206
+ },
207
+ info: {
208
+ main: "#29C8F0",
209
+ contrastText: "#000000",
210
+ },
191
211
  background: background,
192
212
  border: border,
193
213
  text: text,
@@ -235,6 +255,9 @@ var theme = {
235
255
  customMargin: customMargin,
236
256
  customRadius: customRadius,
237
257
  gaps: gaps,
258
+ background: background,
259
+ border: border,
260
+ text: text,
238
261
  row: {
239
262
  display: "flex",
240
263
  alignItems: "center",
@@ -0,0 +1,2 @@
1
+ declare function formatCurrencyNumber(value: number): string;
2
+ export { formatCurrencyNumber };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatCurrencyNumber = formatCurrencyNumber;
4
+ function formatCurrencyNumber(value) {
5
+ return value.toLocaleString("en-US", {
6
+ minimumFractionDigits: 2,
7
+ maximumFractionDigits: 2,
8
+ });
9
+ }
@@ -3,4 +3,5 @@ declare const safeText: (text: string | undefined, options?: {
3
3
  defaultValue?: string | undefined;
4
4
  }) => string;
5
5
  declare const safeDateTimeText: (text: string | undefined, defaultValue?: string | undefined) => string;
6
- export { safeText, safeDateTimeText };
6
+ declare const firstLetterToUpperCase: (text: string | undefined) => string;
7
+ export { safeText, safeDateTimeText, firstLetterToUpperCase };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.safeDateTimeText = exports.safeText = void 0;
3
+ exports.firstLetterToUpperCase = exports.safeDateTimeText = exports.safeText = void 0;
4
4
  var safeText = function (text, options) {
5
5
  var _a = options !== null && options !== void 0 ? options : {}, isShort = _a.isShort, defaultValue = _a.defaultValue;
6
6
  if (!text)
@@ -20,3 +20,9 @@ var safeDateTimeText = function (text, defaultValue) {
20
20
  return new Date(text).toLocaleString();
21
21
  };
22
22
  exports.safeDateTimeText = safeDateTimeText;
23
+ var firstLetterToUpperCase = function (text) {
24
+ if (!text)
25
+ return "-";
26
+ return text.charAt(0).toUpperCase() + text.slice(1);
27
+ };
28
+ exports.firstLetterToUpperCase = firstLetterToUpperCase;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.661",
3
+ "version": "0.0.663",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",