tek-wallet 0.0.755 → 0.0.756
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.
- package/dist/components/TekWallet/components/ui/ActivitiesTypeSlice/index.d.ts +3 -0
- package/dist/components/TekWallet/components/ui/ActivitiesTypeSlice/index.js +7 -7
- package/dist/components/TekWallet/components/ui/ActivityDetail/index.js +5 -5
- package/dist/components/TekWallet/components/ui/ActivityItem/index.js +9 -4
- package/dist/components/TekWallet/components/ui/AmountGroupAndChart/index.js +103 -101
- package/dist/components/TekWallet/components/ui/AnalyticGroup/index.d.ts +2 -1
- package/dist/components/TekWallet/components/ui/AnalyticGroup/index.js +47 -32
- package/dist/components/TekWallet/components/ui/FiatDeposit/index.js +5 -3
- package/dist/components/TekWallet/components/ui/HistorySwap/index.js +1 -2
- package/dist/components/TekWallet/components/ui/NeonLineChart/index.d.ts +6 -5
- package/dist/components/TekWallet/components/ui/NeonLineChart/index.js +2 -2
- package/dist/components/TekWallet/components/ui/ReceiveHistory/index.js +1 -2
- package/dist/components/TekWallet/components/ui/SmartList/index.d.ts +0 -1
- package/dist/components/TekWallet/components/ui/SmartList/index.js +5 -4
- package/dist/components/TekWallet/components/ui/SvgPath/index.d.ts +1 -0
- package/dist/components/TekWallet/components/ui/SvgPath/index.js +3 -2
- package/dist/components/TekWallet/components/ui/SwapToken/index.js +0 -5
- package/dist/components/TekWallet/components/ui/SwapToken copy/index.d.ts +32 -0
- package/dist/components/TekWallet/components/ui/SwapToken copy/index.js +293 -0
- package/dist/components/TekWallet/components/ui/SwiperControlled/index.js +5 -1
- package/dist/components/TekWallet/components/ui/TimeFilter/index.d.ts +4 -3
- package/dist/components/TekWallet/components/ui/TimeFilter/index.js +27 -30
- package/dist/components/TekWallet/components/ui/TokenItem/index.js +11 -6
- package/dist/components/TekWallet/components/ui/TokensBoard/index.js +1 -3
- package/dist/components/TekWallet/components/views/ActivityView/index.d.ts +10 -0
- package/dist/components/TekWallet/components/views/ActivityView/index.js +64 -0
- package/dist/components/TekWallet/components/views/AssetView/index.js +69 -6
- package/dist/components/TekWallet/components/views/TekWalletView/index.js +1 -1
- package/dist/components/TekWallet/components/views/TekWalletView/routes.d.ts +5 -4
- package/dist/components/TekWallet/components/views/TekWalletView/routes.js +11 -5
- package/dist/components/TekWallet/const/app.config.d.ts +1 -0
- package/dist/components/TekWallet/const/app.config.js +4 -0
- package/dist/components/TekWallet/index.d.ts +1 -1
- package/dist/components/TekWallet/index.js +1 -1
- package/dist/components/TekWallet/providers/ActivitiesProvider/const.d.ts +1 -1
- package/dist/components/TekWallet/providers/ActivitiesProvider/const.js +1 -1
- package/dist/components/TekWallet/providers/ActivitiesProvider/functions/sortActivity.d.ts +3 -0
- package/dist/components/TekWallet/providers/ActivitiesProvider/functions/sortActivity.js +8 -0
- package/dist/components/TekWallet/providers/ActivitiesProvider/index.js +55 -51
- package/dist/components/TekWallet/providers/ActivitiesProvider/type.d.ts +1 -1
- package/dist/components/TekWallet/providers/WalletDataProvider/index.js +2 -0
- package/dist/components/TekWallet/providers/WalletDataProviderNoImport/index.js +41 -6
- package/dist/components/TekWallet/services/axios/get-activities-service/index.js +0 -3
- package/dist/components/TekWallet/services/axios/get-activities-service/type.d.ts +4 -4
- package/dist/components/TekWallet/services/axios/get-balance-analytic/index.d.ts +3 -0
- package/dist/components/TekWallet/services/axios/get-balance-analytic/index.js +56 -0
- package/dist/components/TekWallet/services/axios/get-balance-analytic/type.d.ts +18 -0
- package/dist/components/TekWallet/services/axios/get-balance-analytic/type.js +2 -0
- package/dist/components/TekWallet/store/balance/index.d.ts +15 -0
- package/dist/components/TekWallet/store/balance/index.js +24 -0
- package/dist/components/TekWallet/store/balance/type.d.ts +9 -0
- package/dist/components/TekWallet/store/balance/type.js +2 -0
- package/dist/components/TekWallet/store/createStorage.d.ts +3 -0
- package/dist/components/TekWallet/store/createStorage.js +17 -0
- package/dist/components/TekWallet/store/user/index.d.ts +15 -0
- package/dist/components/TekWallet/store/user/index.js +52 -0
- package/dist/components/TekWallet/store/user/type.d.ts +38 -0
- package/dist/components/TekWallet/store/user/type.js +9 -0
- package/dist/components/TekWallet/types/expose-type.d.ts +3 -0
- package/package.json +3 -2
- package/dist/components/TekWallet/components/ui/Activities/index.d.ts +0 -12
- package/dist/components/TekWallet/components/ui/Activities/index.js +0 -117
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { SxProps } from "@mui/material";
|
|
1
2
|
import { TransactionType } from "../../../services/axios/get-activities-service/type";
|
|
2
3
|
export interface ActivitiesTypeSlicePropsType {
|
|
3
4
|
type: TransactionType;
|
|
4
5
|
isActive?: boolean;
|
|
6
|
+
limitItems?: number;
|
|
7
|
+
sx?: SxProps;
|
|
5
8
|
}
|
|
6
9
|
export declare enum Status {
|
|
7
10
|
Loading = "loading",
|
|
@@ -28,7 +28,6 @@ var DrawerComponent_1 = __importDefault(require("../DrawerComponent"));
|
|
|
28
28
|
var ModalLayout_1 = __importDefault(require("../ModalLayout"));
|
|
29
29
|
var ActivityDetail_1 = __importDefault(require("../ActivityDetail"));
|
|
30
30
|
var SmartList_1 = __importDefault(require("../SmartList"));
|
|
31
|
-
var type_1 = require("../../../providers/ActivitiesProvider/type");
|
|
32
31
|
var Status;
|
|
33
32
|
(function (Status) {
|
|
34
33
|
Status["Loading"] = "loading";
|
|
@@ -37,11 +36,11 @@ var Status;
|
|
|
37
36
|
})(Status || (exports.Status = Status = {}));
|
|
38
37
|
var prefix = "activities_";
|
|
39
38
|
function ActivitiesTypeSlice(props) {
|
|
40
|
-
var _a, _b;
|
|
39
|
+
var _a, _b, _c;
|
|
41
40
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
42
|
-
var
|
|
43
|
-
var type = props.type, isActive = props.isActive;
|
|
44
|
-
var
|
|
41
|
+
var _d = (0, useActivities_1.default)(), activities = _d.activities, loadActivities = _d.loadActivities, loadOutActivityType = _d.loadOutActivityType;
|
|
42
|
+
var type = props.type, isActive = props.isActive, limitItems = props.limitItems, sx = props.sx;
|
|
43
|
+
var _e = (0, react_1.useState)(undefined), detailActivity = _e[0], setDetailActivity = _e[1];
|
|
45
44
|
var detailDrawerRef = (0, react_1.useRef)(null);
|
|
46
45
|
var activitiesByType = (0, react_1.useMemo)(function () {
|
|
47
46
|
if (!(type === null || type === void 0 ? void 0 : type.slug))
|
|
@@ -73,11 +72,12 @@ function ActivitiesTypeSlice(props) {
|
|
|
73
72
|
var loadMore = (0, react_1.useCallback)(function () {
|
|
74
73
|
loadActivities(type.slug);
|
|
75
74
|
}, [loadActivities, type.slug]);
|
|
76
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { width: "100%", height: "100%", display: "flex" }, children: [status === Status.Loading && (0, jsx_runtime_1.jsx)(WaitingData_1.default, { sx: {
|
|
75
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ width: "100%", height: "100%", display: "flex", paddingTop: theme.mixins.customPadding.p8, px: theme.mixins.customPadding.p16 }, sx), children: [status === Status.Loading && (0, jsx_runtime_1.jsx)(WaitingData_1.default, { sx: { marginBottom: "auto" } }), status === Status.Empty && ((0, jsx_runtime_1.jsx)(EmptyData_1.default, { sx: { marginBottom: "auto", marginTop: "4rem" }, icon: (0, getIcon_1.default)(prefix + "empty_" + type.slug), description: "No ".concat((_a = type.name) === null || _a === void 0 ? void 0 : _a.toLowerCase(), " activity") })), status === Status.Filled && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SmartList_1.default, { loadMoreData: loadMore, hasMore: !loadOutActivityType[type.slug] &&
|
|
76
|
+
((activitiesByType === null || activitiesByType === void 0 ? void 0 : activitiesByType.length) || 0) < (limitItems || Infinity), loadingComponent: (0, jsx_runtime_1.jsx)(WaitingData_1.default, { numberOfSkeleton: 3, sx: { marginTop: theme.mixins.customMargin.m12 } }), sx: {}, children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: (_b = activitiesByType === null || activitiesByType === void 0 ? void 0 : activitiesByType.slice(0, limitItems)) === null || _b === void 0 ? void 0 : _b.map(function (activity, index) {
|
|
77
77
|
if (!activity)
|
|
78
78
|
return null;
|
|
79
79
|
var dataAsJson = JSON.stringify(activity);
|
|
80
80
|
return ((0, jsx_runtime_1.jsx)(ActivityItem_1.default, { onClick: function () { return openDetail(activity); }, data: dataAsJson }, index));
|
|
81
|
-
}) }) }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: detailDrawerRef, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: closeDetail, title: (
|
|
81
|
+
}) }) }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: detailDrawerRef, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: closeDetail, title: (_c = detailActivity === null || detailActivity === void 0 ? void 0 : detailActivity.transaction_type) === null || _c === void 0 ? void 0 : _c.name, children: (0, jsx_runtime_1.jsx)(ActivityDetail_1.default, { activityData: detailActivity }) }) })] }))] }));
|
|
82
82
|
}
|
|
83
83
|
exports.default = ActivitiesTypeSlice;
|
|
@@ -72,19 +72,19 @@ function ActivityDetail(props) {
|
|
|
72
72
|
var getAmountColor = (0, react_1.useCallback)(function () {
|
|
73
73
|
if (isIncrease)
|
|
74
74
|
return theme.palette.text.successStatus;
|
|
75
|
-
return theme.palette.text.
|
|
75
|
+
return theme.palette.text.black;
|
|
76
76
|
}, [isIncrease, theme]);
|
|
77
77
|
if (!activityData)
|
|
78
78
|
return null;
|
|
79
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g16, alignItems: "center" }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(
|
|
79
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g16, alignItems: "center" }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: currency === null || currency === void 0 ? void 0 : currency.link, width: 64, sx: {
|
|
80
80
|
borderRadius: theme.mixins.customRadius.full,
|
|
81
81
|
border: isSwap ? "0.25rem white solid" : "none",
|
|
82
|
-
ml: "-0.5rem",
|
|
82
|
+
// ml: "-0.5rem",
|
|
83
83
|
} }), (swapToCurrency === null || swapToCurrency === void 0 ? void 0 : swapToCurrency.link) && ((0, jsx_runtime_1.jsx)(Icon_1.default, { src: swapToCurrency === null || swapToCurrency === void 0 ? void 0 : swapToCurrency.link, width: 64, sx: {
|
|
84
84
|
borderRadius: theme.mixins.customRadius.full,
|
|
85
85
|
border: isSwap ? "0.25rem white solid" : "none",
|
|
86
|
-
ml: "-
|
|
87
|
-
} }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g4, alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.
|
|
86
|
+
ml: "-1rem",
|
|
87
|
+
} }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g4, alignItems: "center" }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.column), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeight700, fontSize: theme.typography.fontSize24, color: getAmountColor() }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: " ".concat(currency === null || currency === void 0 ? void 0 : currency.name) }) }), isSwap && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeight700, fontSize: theme.typography.fontSize24, color: theme.palette.text.successStatus }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: "+", value: swapToCurrency === null || swapToCurrency === void 0 ? void 0 : swapToCurrency.swap_total_amount, unit: " ".concat(swapToCurrency === null || swapToCurrency === void 0 ? void 0 : swapToCurrency.name) }) }))] }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: (0, formatDate_1.default)(activityData.date_created) }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 16 })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
88
88
|
fontSize: theme.typography.fontSize12,
|
|
89
89
|
textTransform: "capitalize",
|
|
90
90
|
color: getStatusColor(),
|
|
@@ -88,17 +88,22 @@ function ActivityItem(props) {
|
|
|
88
88
|
var getAmountColor = (0, react_1.useCallback)(function () {
|
|
89
89
|
if (isIncrease)
|
|
90
90
|
return theme.palette.text.successStatus;
|
|
91
|
-
return theme.palette.text.
|
|
91
|
+
return theme.palette.text.black;
|
|
92
92
|
}, [isIncrease, theme]);
|
|
93
93
|
if (!activityData)
|
|
94
94
|
return null;
|
|
95
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, __assign({ sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, backgroundColor: theme.palette.background.
|
|
95
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, __assign({ sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, backgroundColor: theme.palette.background.tertiary, borderRadius: theme.mixins.customRadius.r16, p: theme.mixins.customPadding.p12, flexGrow: "unset", boxShadow: theme.shadows[1] }), sx) }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
96
96
|
width: "fit-content",
|
|
97
97
|
height: "fit-content",
|
|
98
|
-
}, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: type === null || type === void 0 ? void 0 : type.link, width: 24 }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g2 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityTitle, children: type === null || type === void 0 ? void 0 : type.name }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityDescription, children: descriptionElement }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 12 })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
98
|
+
}, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: type === null || type === void 0 ? void 0 : type.link, width: 24, sx: { borderRadius: theme.mixins.customRadius.full } }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g2 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityTitle, children: type === null || type === void 0 ? void 0 : type.name }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityDescription, children: descriptionElement }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 12 })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
99
99
|
fontSize: theme.typography.fontSize12,
|
|
100
100
|
textTransform: "capitalize",
|
|
101
101
|
color: getStatusColor(),
|
|
102
|
-
}, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g2, width: "fit-content", alignItems: "flex-end", ml: "auto" }), children: [slug === type_1.TransactionSlug.SWAP && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.
|
|
102
|
+
}, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g2, width: "fit-content", alignItems: "flex-end", ml: "auto" }), children: [slug === type_1.TransactionSlug.SWAP && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeight700, fontSize: theme.typography.fontSize13, color: theme.palette.text.successStatus, textAlign: "right" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: "+", value: swapToCurrency === null || swapToCurrency === void 0 ? void 0 : swapToCurrency.swap_total_amount, unit: " ".concat(swapToCurrency === null || swapToCurrency === void 0 ? void 0 : swapToCurrency.name) }) })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
103
|
+
fontSize: theme.typography.fontSize13,
|
|
104
|
+
fontWeight: theme.typography.fontWeight700,
|
|
105
|
+
color: getAmountColor(),
|
|
106
|
+
textAlign: "right",
|
|
107
|
+
}, children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: " ".concat(currency === null || currency === void 0 ? void 0 : currency.name) }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { textAlign: "right" }), children: (0, formatDate_1.default)(activityData.date_created) })] })] })));
|
|
103
108
|
}
|
|
104
109
|
exports.default = ActivityItem;
|
|
@@ -16,123 +16,125 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
18
|
var react_1 = require("react");
|
|
19
|
-
var framer_motion_1 = require("framer-motion");
|
|
20
19
|
var AnalyticGroup_1 = __importDefault(require("../AnalyticGroup"));
|
|
21
20
|
var TimeFilter_1 = __importDefault(require("../TimeFilter"));
|
|
22
|
-
var TimeFilter_2 = require("../TimeFilter");
|
|
23
21
|
var DelayMounted_1 = __importDefault(require("../DelayMounted"));
|
|
24
22
|
var material_1 = require("@mui/material");
|
|
25
23
|
var ThemeProvider_1 = require("../../../providers/ThemeProvider");
|
|
26
24
|
var NeonLineChart_1 = __importDefault(require("../NeonLineChart"));
|
|
27
|
-
var ContentHiddenProvider_1 = require("../../../providers/ContentHiddenProvider");
|
|
28
25
|
var SvgPath_1 = require("../SvgPath");
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
visible: { opacity: 1, display: "block" },
|
|
76
|
-
};
|
|
26
|
+
var user_1 = __importDefault(require("../../../store/user"));
|
|
27
|
+
var balance_1 = __importDefault(require("../../../store/balance"));
|
|
28
|
+
var useWallet_1 = __importDefault(require("../../../hooks/useWallet"));
|
|
29
|
+
// const fakeSeries = [
|
|
30
|
+
// {
|
|
31
|
+
// name: "All",
|
|
32
|
+
// data: [
|
|
33
|
+
// 1003785.6864951615, 1003795.988344575, 1003827.99766239, 1003899.7426850981,
|
|
34
|
+
// 1003891.7710159089, 1003810.6439517767, 1003780.7195320514, 1003797.9506016063,
|
|
35
|
+
// 1003781.455378438, 1003782.0072632281, 1003715.167883104, 1003724.9791682598,
|
|
36
|
+
// 1003716.6018329085, 1003711.3282671372, 1003686.1868489254, 1003625.4795220237,
|
|
37
|
+
// 1003584.3334449014, 1003498.9139435134, 1003310.7825506503, 1003339.72584186,
|
|
38
|
+
// 1003334.3069939599, 1003364.3540547496, 1003394.4011155394, 1003398.386950134,
|
|
39
|
+
// 1003233.005474726, 1003185.2981006557, 1003165.7981714085,
|
|
40
|
+
// ],
|
|
41
|
+
// },
|
|
42
|
+
// ];
|
|
43
|
+
// const labels = [
|
|
44
|
+
// "2025-03-04T08:10:17.311Z",
|
|
45
|
+
// "2025-03-04T12:10:18.859Z",
|
|
46
|
+
// "2025-03-04T16:10:19.118Z",
|
|
47
|
+
// "2025-03-04T20:10:18.246Z",
|
|
48
|
+
// "2025-03-05T00:10:18.371Z",
|
|
49
|
+
// "2025-03-05T10:12:40.882Z",
|
|
50
|
+
// "2025-03-05T14:12:42.832Z",
|
|
51
|
+
// "2025-03-05T18:12:41.114Z",
|
|
52
|
+
// "2025-03-05T22:12:40.544Z",
|
|
53
|
+
// "2025-03-06T02:12:40.718Z",
|
|
54
|
+
// "2025-03-08T10:35:52.596Z",
|
|
55
|
+
// "2025-03-08T14:35:52.979Z",
|
|
56
|
+
// "2025-03-08T16:01:31.209Z",
|
|
57
|
+
// "2025-03-08T18:35:52.824Z",
|
|
58
|
+
// "2025-03-08T22:35:52.901Z",
|
|
59
|
+
// "2025-03-09T06:35:53.327Z",
|
|
60
|
+
// "2025-03-09T10:35:52.682Z",
|
|
61
|
+
// "2025-03-09T14:35:53.001Z",
|
|
62
|
+
// "2025-03-09T18:35:52.886Z",
|
|
63
|
+
// "2025-03-09T22:35:52.880Z",
|
|
64
|
+
// "2025-03-10T03:43:34.153Z",
|
|
65
|
+
// "2025-03-10T06:35:52.944Z",
|
|
66
|
+
// "2025-03-10T10:35:52.253Z",
|
|
67
|
+
// "2025-03-10T14:35:52.727Z",
|
|
68
|
+
// "2025-03-10T18:35:52.865Z",
|
|
69
|
+
// "2025-03-10T22:35:53.563Z",
|
|
70
|
+
// "2025-03-11T04:16:45.409Z",
|
|
71
|
+
// ];
|
|
77
72
|
var AmountGroupAndChart = function (props) {
|
|
73
|
+
var defaultTimeRange = (0, user_1.default)(function (state) { return state.settings.balance.timeRangeTracking; });
|
|
78
74
|
var _a = (0, react_1.useState)(false), expandAreaChart = _a[0], setExpandAreaChart = _a[1];
|
|
79
75
|
var _b = (0, react_1.useState)(), timeRangeData = _b[0], setTimeRangeData = _b[1];
|
|
80
|
-
var isHidden = (0, ContentHiddenProvider_1.useContentHidden)().isHidden;
|
|
81
76
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
77
|
+
var isShowBalance = (0, user_1.default)(function (state) { return state.settings.balance.isShowBalance; });
|
|
78
|
+
var analytic = (0, balance_1.default)(function (state) { return state.analytic; });
|
|
79
|
+
var setTimeRangeTracking = (0, user_1.default)(function (state) { return state.setTimeRangeTracking; });
|
|
80
|
+
var updateBalanceAnalytic = (0, useWallet_1.default)().updateBalanceAnalytic;
|
|
81
|
+
var series = (0, react_1.useMemo)(function () {
|
|
82
|
+
var _a;
|
|
83
|
+
return (_a = analytic === null || analytic === void 0 ? void 0 : analytic.data) === null || _a === void 0 ? void 0 : _a.map(function (item) { return ({
|
|
84
|
+
name: item.name,
|
|
85
|
+
data: item.values,
|
|
86
|
+
}); });
|
|
87
|
+
}, [analytic]);
|
|
82
88
|
var handleChangeTimeRange = function (data) {
|
|
83
89
|
setTimeRangeData(data);
|
|
90
|
+
setTimeRangeTracking(data.type);
|
|
91
|
+
updateBalanceAnalytic(data.type);
|
|
84
92
|
};
|
|
85
93
|
var toggleExpand = function () {
|
|
86
94
|
setExpandAreaChart(function (prev) { return !prev; });
|
|
87
95
|
};
|
|
88
|
-
return ((0, jsx_runtime_1.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
? "rotate(180deg) translateX(900%) translateY(120%)"
|
|
132
|
-
: "translateX(-50%) translateY(100%)",
|
|
133
|
-
zIndex: 20,
|
|
134
|
-
width: 20,
|
|
135
|
-
height: 20,
|
|
136
|
-
}, children: SvgPath_1.IC_EXPANDER_ARROW })] })] }) }));
|
|
96
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ width: "100%", height: "fit-content", position: "relative" }, props.sx), children: [(0, jsx_runtime_1.jsx)(AnalyticGroup_1.default, { sx: { position: "relative" }, timeRange: timeRangeData === null || timeRangeData === void 0 ? void 0 : timeRangeData.type }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
97
|
+
width: "100%",
|
|
98
|
+
position: "relative",
|
|
99
|
+
transition: "all 500ms ease-in-out",
|
|
100
|
+
top: expandAreaChart ? "0px" : "-30px",
|
|
101
|
+
aspectRatio: expandAreaChart ? "1.6" : 6.2,
|
|
102
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
103
|
+
position: "absolute",
|
|
104
|
+
top: 0,
|
|
105
|
+
right: 0,
|
|
106
|
+
left: 0,
|
|
107
|
+
bottom: 0,
|
|
108
|
+
transition: "all 500ms ease-in-out",
|
|
109
|
+
transform: !expandAreaChart ? "scale(0.5)" : "scale(1)",
|
|
110
|
+
transformOrigin: "top left",
|
|
111
|
+
}, children: (0, jsx_runtime_1.jsx)(DelayMounted_1.default, { delay: 800, children: (0, jsx_runtime_1.jsx)(NeonLineChart_1.default, { showMinMaxValues: expandAreaChart && isShowBalance, series: series, categories: analytic === null || analytic === void 0 ? void 0 : analytic.labels, sx: {
|
|
112
|
+
width: "100%",
|
|
113
|
+
height: "fit-content",
|
|
114
|
+
transition: "all 500ms ease-in-out",
|
|
115
|
+
my: theme.mixins.customMargin.m3,
|
|
116
|
+
}, children: (0, jsx_runtime_1.jsx)(DelayMounted_1.default, { delay: 800, children: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { onClick: toggleExpand, sx: {
|
|
117
|
+
position: "absolute",
|
|
118
|
+
right: 0,
|
|
119
|
+
bottom: 0,
|
|
120
|
+
width: 20,
|
|
121
|
+
height: 20,
|
|
122
|
+
cursor: "pointer",
|
|
123
|
+
zIndex: 9999,
|
|
124
|
+
transition: "all 500ms ease-in-out",
|
|
125
|
+
transform: !expandAreaChart
|
|
126
|
+
? "scale(2) translate(50%, -50%)"
|
|
127
|
+
: "scale(1) translate(50%, -50%)",
|
|
128
|
+
}, children: SvgPath_1.IC_EXPANDER_ARROW }) }) }) }) }), (0, jsx_runtime_1.jsx)(TimeFilter_1.default, { hideAll: true, initialValue: defaultTimeRange, onChange: handleChangeTimeRange, sx: {
|
|
129
|
+
position: "absolute",
|
|
130
|
+
bottom: 0,
|
|
131
|
+
left: 0,
|
|
132
|
+
right: 0,
|
|
133
|
+
opacity: expandAreaChart ? 1 : 0,
|
|
134
|
+
transform: expandAreaChart ? "scale(1)" : "scale(0)",
|
|
135
|
+
transition: expandAreaChart
|
|
136
|
+
? "opacity 300ms ease-in-out 500ms, transform 0ms ease-in-out 0ms"
|
|
137
|
+
: "opacity 200ms ease-in-out 0ms, transform 0ms ease-in-out 200ms",
|
|
138
|
+
} })] })] }));
|
|
137
139
|
};
|
|
138
140
|
exports.default = AmountGroupAndChart;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GeneralProps } from "../../../types/ui";
|
|
2
|
+
import { TimeFilterType } from "../TimeFilter";
|
|
2
3
|
interface AnalyticGroupProps extends GeneralProps {
|
|
3
|
-
timeRange?:
|
|
4
|
+
timeRange?: TimeFilterType;
|
|
4
5
|
}
|
|
5
6
|
declare const AnalyticGroup: (props: AnalyticGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export default AnalyticGroup;
|
|
@@ -19,61 +19,76 @@ var Text_1 = __importDefault(require("../Text"));
|
|
|
19
19
|
var Formatter_1 = __importDefault(require("../Formatter"));
|
|
20
20
|
var material_1 = require("@mui/material");
|
|
21
21
|
var providers_1 = require("../../../providers");
|
|
22
|
-
var ContentHiddenProvider_1 = require("../../../providers/ContentHiddenProvider");
|
|
23
22
|
var SvgPath_1 = require("../SvgPath");
|
|
23
|
+
var TimeFilter_1 = require("../TimeFilter");
|
|
24
|
+
var user_1 = __importDefault(require("../../../store/user"));
|
|
25
|
+
var balance_1 = __importDefault(require("../../../store/balance"));
|
|
24
26
|
var AnalyticGroup = function (props) {
|
|
27
|
+
var sx = props.sx;
|
|
25
28
|
var theme = (0, providers_1.useTheme)();
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { justifyContent: "space-between" }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6, position: "relative"
|
|
29
|
+
var isShowBalance = (0, user_1.default)(function (state) { return state.settings.balance.isShowBalance; });
|
|
30
|
+
var toggleShowBalance = (0, user_1.default)(function (state) { return state.toggleShowBalance; });
|
|
31
|
+
var totalBalanceInUSD = (0, balance_1.default)(function (state) { return state.totalBalanceInUSD; });
|
|
32
|
+
var analytic = (0, balance_1.default)(function (state) { return state.analytic; });
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign({}, theme.mixins.row), { justifyContent: "space-between", alignItems: "flex-start" }), sx), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6, position: "relative" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
31
34
|
fontSize: theme.typography.fontSize15,
|
|
32
35
|
fontWeight: theme.typography.fontWeight500,
|
|
33
36
|
color: theme.palette.text.accent2,
|
|
34
|
-
}, children: "Total Amount" }), (0, jsx_runtime_1.
|
|
37
|
+
}, children: "Total Amount" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { onClick: toggleShowBalance, sx: {
|
|
38
|
+
position: "relative",
|
|
39
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { cursor: "pointer", width: 20, height: 20 }, children: SvgPath_1.IC_NO_SEE }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
40
|
+
position: "absolute",
|
|
41
|
+
left: "50%",
|
|
42
|
+
width: "2px",
|
|
43
|
+
top: "50%",
|
|
44
|
+
height: !isShowBalance ? "80%" : "0px",
|
|
45
|
+
transition: "height 0.2s ease-in-out",
|
|
46
|
+
backgroundColor: theme.palette.text.accent2,
|
|
47
|
+
transform: "translate(calc(-50% + 1px), calc(-50% + 1px)) rotate(45deg)",
|
|
48
|
+
transformOrigin: "center center",
|
|
49
|
+
} })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
35
50
|
display: "flex",
|
|
36
51
|
flexDirection: "column",
|
|
37
52
|
alignItems: "flex-end",
|
|
38
53
|
gap: theme.mixins.gaps.g6,
|
|
39
54
|
fontSize: theme.typography.fontSize12,
|
|
40
|
-
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign(__assign({}, theme.mixins.row), theme.mixins.value), { fontSize: theme.typography.fontSize20, gap: theme.mixins.gaps.
|
|
55
|
+
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign(__assign({}, theme.mixins.row), theme.mixins.value), { alignItems: "baseline", fontSize: theme.typography.fontSize20, gap: theme.mixins.gaps.g2 }), children: isShowBalance ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Formatter_1.default, { sx: { fontWeight: theme.typography.fontWeight700 }, value: totalBalanceInUSD, unit: "USD", hideUnitOutSide: true }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g2 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
41
56
|
fontWeight: theme.typography.fontWeight400,
|
|
42
57
|
fontSize: "0.8em",
|
|
43
|
-
}, children: "
|
|
58
|
+
}, children: "USD" }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { cursor: "pointer", width: 8, height: 8 }, children: SvgPath_1.ARROW_DROP_DOWN })] })] })) : ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
44
59
|
fontSize: theme.typography.fontSize24,
|
|
45
60
|
fontWeight: theme.typography.fontWeight700,
|
|
46
61
|
color: theme.palette.text.black,
|
|
47
|
-
}, children: "
|
|
48
|
-
fontWeight: theme.typography.fontWeight600,
|
|
49
|
-
leading: theme.typography.leading140,
|
|
50
|
-
fontSize: theme.typography.fontSize12,
|
|
51
|
-
textTransform: "capitalize",
|
|
52
|
-
color: theme.palette.text.accent,
|
|
53
|
-
}, children: props.timeRange }), !isHidden ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { cursor: "pointer", width: 8, height: 8 }, children: SvgPath_1.ARROW_DROP_UP }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: theme.palette.text.alertStatus, fontSize: theme.typography.fontSize12, fontWeight: theme.typography.fontWeight600, borderBottom: "1px dashed currentColor" }), children: "5.63 (+3,22%)" })] })) : ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
54
|
-
fontSize: theme.typography.fontSize12,
|
|
62
|
+
}, children: "******" })) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [!!props.timeRange && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
55
63
|
fontWeight: theme.typography.fontWeight600,
|
|
56
|
-
color: theme.palette.text.accent2,
|
|
57
|
-
display: theme.mixins.row,
|
|
58
|
-
}, children: "****" }))] }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
|
|
59
|
-
width: "110%",
|
|
60
|
-
borderColor: "".concat(theme.palette.border.accent),
|
|
61
|
-
opacity: 0.2,
|
|
62
|
-
marginTop: theme.mixins.customMargin.m4,
|
|
63
|
-
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
64
|
-
fontWeight: theme.typography.fontWeight500,
|
|
65
64
|
leading: theme.typography.leading140,
|
|
66
65
|
fontSize: theme.typography.fontSize12,
|
|
67
66
|
textTransform: "capitalize",
|
|
68
67
|
color: theme.palette.text.accent,
|
|
69
|
-
}, children:
|
|
68
|
+
}, children: TimeFilter_1.TIME_FILTER_LABEL[props.timeRange] })), !!(analytic === null || analytic === void 0 ? void 0 : analytic.pnl) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isShowBalance && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { cursor: "pointer", width: 8, height: 8 }, children: SvgPath_1.ARROW_DROP_UP }), (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { color: theme.palette.text.alertStatus, fontSize: theme.typography.fontSize12, fontWeight: theme.typography.fontWeight600, borderBottom: "1px dashed currentColor" }), children: [(0, jsx_runtime_1.jsx)("span", { children: (analytic === null || analytic === void 0 ? void 0 : analytic.pnl) > 0 ? "+" : "" }), " ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: analytic === null || analytic === void 0 ? void 0 : analytic.pnl }), " ", "(", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: analytic === null || analytic === void 0 ? void 0 : analytic.pnl_percent, unit: "%" }), ")"] })] })), !isShowBalance && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
70
69
|
fontSize: theme.typography.fontSize12,
|
|
71
70
|
fontWeight: theme.typography.fontWeight600,
|
|
72
71
|
color: theme.palette.text.accent2,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
display: theme.mixins.row,
|
|
73
|
+
}, children: "******" }))] }))] }), false && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Divider, { sx: {
|
|
74
|
+
width: "110%",
|
|
75
|
+
borderColor: "".concat(theme.palette.border.accent),
|
|
76
|
+
opacity: 0.2,
|
|
77
|
+
marginTop: theme.mixins.customMargin.m4,
|
|
78
|
+
} }), isShowBalance && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
79
|
+
fontWeight: theme.typography.fontWeight500,
|
|
80
|
+
leading: theme.typography.leading140,
|
|
81
|
+
fontSize: theme.typography.fontSize12,
|
|
82
|
+
textTransform: "capitalize",
|
|
83
|
+
color: theme.palette.text.accent,
|
|
84
|
+
}, children: "Profit" }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
85
|
+
fontSize: theme.typography.fontSize12,
|
|
86
|
+
fontWeight: theme.typography.fontWeight600,
|
|
87
|
+
color: theme.palette.text.accent2,
|
|
88
|
+
}, children: "\u2248 250k XP" }) }) }), (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { sx: { cursor: "pointer", width: 14, height: 14 }, children: SvgPath_1.IC_INFORMATION })] })), !isShowBalance && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
|
|
89
|
+
fontSize: theme.typography.fontSize12,
|
|
90
|
+
fontWeight: theme.typography.fontWeight600,
|
|
91
|
+
color: theme.palette.text.accent2,
|
|
92
|
+
}, children: "******" }))] }))] })] }));
|
|
78
93
|
};
|
|
79
94
|
exports.default = AnalyticGroup;
|
|
@@ -92,7 +92,7 @@ function FiatDeposit(_a) {
|
|
|
92
92
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
93
93
|
var children = _a.children;
|
|
94
94
|
var amountInputRef = (0, react_1.useRef)(null);
|
|
95
|
-
var _m = (0, useWallet_1.default)(), masterWallet = _m.masterWallet, transaction = _m.transaction,
|
|
95
|
+
var _m = (0, useWallet_1.default)(), masterWallet = _m.masterWallet, transaction = _m.transaction, receiveExternalTokens = _m.receiveExternalTokens, tokens = _m.tokens, pushNotification = _m.pushNotification;
|
|
96
96
|
var _o = (0, react_1.useState)(false), open = _o[0], setOpen = _o[1];
|
|
97
97
|
var _p = (0, react_1.useState)(false), openQR = _p[0], setOpenQR = _p[1];
|
|
98
98
|
var _q = (0, react_1.useState)(false), openShare = _q[0], setOpenShare = _q[1];
|
|
@@ -177,7 +177,7 @@ function FiatDeposit(_a) {
|
|
|
177
177
|
(0, react_1.useEffect)(function () {
|
|
178
178
|
if ((transaction === null || transaction === void 0 ? void 0 : transaction.transaction_status) === "success" &&
|
|
179
179
|
(transaction === null || transaction === void 0 ? void 0 : transaction.transaction_type) === type_1.TransactionSlug.DEPOSIT) {
|
|
180
|
-
updateActivities();
|
|
180
|
+
// updateActivities();
|
|
181
181
|
setOpen(false);
|
|
182
182
|
setOpenQR(false);
|
|
183
183
|
setOpenShare(false);
|
|
@@ -221,7 +221,9 @@ function FiatDeposit(_a) {
|
|
|
221
221
|
container: {
|
|
222
222
|
border: "1px solid ".concat(error ? theme_1.default.palette.error.main : theme_1.default.palette.primary.main),
|
|
223
223
|
},
|
|
224
|
-
}, rightElement: (0, jsx_runtime_1.jsxs)(material_1.Stack, { flexDirection: "row", alignItems: "center", gap: "4px", flexShrink: 0, pl: "1rem", children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { alt: "", width: 16, height: 16,
|
|
224
|
+
}, rightElement: (0, jsx_runtime_1.jsxs)(material_1.Stack, { flexDirection: "row", alignItems: "center", gap: "4px", flexShrink: 0, pl: "1rem", children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { alt: "", width: 16, height: 16, sx: {
|
|
225
|
+
borderRadius: "999px",
|
|
226
|
+
}, src: (_d = (_c = tokens === null || tokens === void 0 ? void 0 : tokens.find(function (item) { return item.currency_slug.toLocaleLowerCase() === "vnd"; })) === null || _c === void 0 ? void 0 : _c.currency.link) !== null && _d !== void 0 ? _d : "/" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, style_1.title03), color: (_e = palette_1.palette.accent2) === null || _e === void 0 ? void 0 : _e.main, children: "VND" })] }) }) }), error && ((0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, style_1.content02), display: "flex", alignItems: "center", gap: "4px", className: "text-error", children: [(0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: (0, jsx_runtime_1.jsx)("path", { d: "M7 5.25V7.4375M12.25 7C12.25 7.68944 12.1142 8.37213 11.8504 9.00909C11.5865 9.64605 11.1998 10.2248 10.7123 10.7123C10.2248 11.1998 9.64605 11.5865 9.00909 11.8504C8.37213 12.1142 7.68944 12.25 7 12.25C6.31056 12.25 5.62787 12.1142 4.99091 11.8504C4.35395 11.5865 3.7752 11.1998 3.28769 10.7123C2.80018 10.2248 2.41347 9.64605 2.14963 9.00909C1.8858 8.37213 1.75 7.68944 1.75 7C1.75 5.60761 2.30312 4.27226 3.28769 3.28769C4.27226 2.30312 5.60761 1.75 7 1.75C8.39239 1.75 9.72774 2.30312 10.7123 3.28769C11.6969 4.27226 12.25 5.60761 12.25 7ZM7 9.1875H7.00467V9.19217H7V9.1875Z", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }) }), error] }))] }) }), (0, jsx_runtime_1.jsx)(material_1.Stack, { pt: "12px", id: "input-amount-action", children: (0, jsx_runtime_1.jsx)(material_1.Box, { px: "1rem", pb: "1.5rem", children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { loading: loading, disabled: loading || !!error, onClick: handleClick, fullWidth: true, children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, style_1.button), children: "Continue" }) }) }) })] }) })] }), (0, jsx_runtime_1.jsxs)(material_1.Drawer, { classes: { paper: "w-full" }, open: openQR, onClose: function () { return setOpenQR(false); }, anchor: "right", keepMounted: false, onClick: function (e) { return e.stopPropagation(); }, children: [(0, jsx_runtime_1.jsx)(Header, { handleBack: function () {
|
|
225
227
|
setOpen(false);
|
|
226
228
|
setOpenQR(false);
|
|
227
229
|
setInputAmount("");
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { GeneralProps } from "../../../types/ui";
|
|
2
|
+
export type SeriesType = Array<{
|
|
3
|
+
name: string;
|
|
4
|
+
data: number[];
|
|
5
|
+
}>;
|
|
2
6
|
export interface NeonLineChartPropsTypes extends GeneralProps {
|
|
3
7
|
categories?: string[];
|
|
4
|
-
series?:
|
|
5
|
-
name: string;
|
|
6
|
-
data: any[];
|
|
7
|
-
}>;
|
|
8
|
+
series?: SeriesType;
|
|
8
9
|
showMinMaxValues?: boolean;
|
|
9
10
|
}
|
|
10
|
-
declare function NeonLineChart({ series, categories, showMinMaxValues, sx, }: NeonLineChartPropsTypes): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function NeonLineChart({ series, categories, showMinMaxValues, children, sx, }: NeonLineChartPropsTypes): import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
declare const _default: import("react").MemoExoticComponent<typeof NeonLineChart>;
|
|
12
13
|
export default _default;
|
|
@@ -27,7 +27,7 @@ var ThemeProvider_1 = require("../../../providers/ThemeProvider");
|
|
|
27
27
|
var formatDate_1 = __importDefault(require("../../../utils/formatDate"));
|
|
28
28
|
function NeonLineChart(_a) {
|
|
29
29
|
var _b, _c, _d, _e;
|
|
30
|
-
var series = _a.series, categories = _a.categories, _f = _a.showMinMaxValues, showMinMaxValues = _f === void 0 ? false : _f, sx = _a.sx;
|
|
30
|
+
var series = _a.series, categories = _a.categories, _f = _a.showMinMaxValues, showMinMaxValues = _f === void 0 ? false : _f, children = _a.children, sx = _a.sx;
|
|
31
31
|
var chartComponentRef = (0, react_1.useRef)(null);
|
|
32
32
|
var formatValue = (0, useFormatter_1.default)().formatValue;
|
|
33
33
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
@@ -175,6 +175,6 @@ function NeonLineChart(_a) {
|
|
|
175
175
|
duration: 0.4,
|
|
176
176
|
ease: "easeInOut",
|
|
177
177
|
delay: 0.4,
|
|
178
|
-
}, children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: minValue }) }) })] })), (0, jsx_runtime_1.jsx)(highcharts_react_official_1.default, { highcharts: highcharts_1.default, options: options, ref: chartComponentRef })] }));
|
|
178
|
+
}, children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: minValue }) }) })] })), (0, jsx_runtime_1.jsx)(highcharts_react_official_1.default, { highcharts: highcharts_1.default, options: options, ref: chartComponentRef }), children] }));
|
|
179
179
|
}
|
|
180
180
|
exports.default = (0, react_1.memo)(NeonLineChart);
|