tek-wallet 0.0.476 → 0.0.478

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.
@@ -23,7 +23,6 @@ var react_2 = require("react");
23
23
  var Formatter_1 = __importDefault(require("../Formatter"));
24
24
  var Text_1 = __importDefault(require("../Text"));
25
25
  var formatDate_1 = __importDefault(require("../../../utils/formatDate"));
26
- var LineValue_1 = __importDefault(require("../LineValue"));
27
26
  function ActivityDetail(props) {
28
27
  var _a;
29
28
  var theme = (0, material_1.useTheme)();
@@ -63,10 +62,10 @@ function ActivityDetail(props) {
63
62
  }, [isIncrease, theme]);
64
63
  if (!activityData)
65
64
  return null;
66
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g16 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: (_a = activityData.transaction_type) === null || _a === void 0 ? void 0 : _a.link, width: 64 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, color: getAmountColor() }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: activityData.currency_slug }) }), (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: {
65
+ 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.jsx)(Icon_1.default, { src: (_a = activityData.transaction_type) === null || _a === void 0 ? void 0 : _a.link, width: 64 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, color: getAmountColor() }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: activityData.currency_slug }) }), (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: {
67
66
  fontSize: theme.typography.fontSize12,
68
67
  textTransform: "capitalize",
69
68
  color: getStatusColor(),
70
- }, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.paper), { p: theme.mixins.gaps.g12 }), children: [isReceive && (0, jsx_runtime_1.jsx)(LineValue_1.default, { sx: { flexWrap: "wrap" }, field: "From", value: activityData === null || activityData === void 0 ? void 0 : activityData.from_address }), isSend && (0, jsx_runtime_1.jsx)(LineValue_1.default, { sx: { flexWrap: "wrap" }, field: "To", value: activityData === null || activityData === void 0 ? void 0 : activityData.to_address })] })] }));
69
+ }, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.paper), { p: theme.mixins.gaps.g12, width: "100%" }), children: [isReceive && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.column), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "From" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: activityData === null || activityData === void 0 ? void 0 : activityData.from_address })] })), isSend && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.column), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "To" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: activityData === null || activityData === void 0 ? void 0 : activityData.to_address })] }))] })] }));
71
70
  }
72
71
  exports.default = ActivityDetail;
@@ -39,10 +39,11 @@ var DrawerComponent_1 = __importDefault(require("../DrawerComponent"));
39
39
  var ActivityDetail_1 = __importDefault(require("../ActivityDetail"));
40
40
  var ModalLayout_1 = __importDefault(require("../ModalLayout"));
41
41
  function ActivityItem(props) {
42
+ var _a;
42
43
  var sx = props.sx, data = props.data, rest = __rest(props, ["sx", "data"]);
43
44
  var theme = (0, material_1.useTheme)();
44
45
  var detailDrawerRef = (0, react_1.useRef)(null);
45
- var _a = (0, react_1.useState)(false), isOpenDetail = _a[0], setIsOpenDetail = _a[1];
46
+ var _b = (0, react_1.useState)(false), isOpenDetail = _b[0], setIsOpenDetail = _b[1];
46
47
  var activityData = (0, react_1.useMemo)(function () {
47
48
  if (!data)
48
49
  return undefined;
@@ -106,13 +107,13 @@ function ActivityItem(props) {
106
107
  }, [isIncrease, theme]);
107
108
  if (!activityData)
108
109
  return null;
109
- return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, __assign({ onClick: openDetail, sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, backgroundColor: theme.palette.background.white16, 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: {
110
- width: "fit-content",
111
- height: "fit-content",
112
- }, 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" }), 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: 16 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
113
- fontSize: theme.typography.fontSize12,
114
- textTransform: "capitalize",
115
- color: getStatusColor(),
116
- }, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", alignItems: "flex-end", ml: "auto" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, color: getAmountColor(), textAlign: "right" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: activityData.currency_slug }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { textAlign: "right" }), children: (0, formatDate_1.default)(activityData.date_created) })] }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: detailDrawerRef, onClose: onCloseDetail, children: isOpenDetail && ((0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: closeDetail, title: "Detail", children: (0, jsx_runtime_1.jsx)(ActivityDetail_1.default, { activityData: activityData }) })) })] })));
110
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.ListItemButton, __assign({ onClick: openDetail, sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, backgroundColor: theme.palette.background.white16, 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: {
111
+ width: "fit-content",
112
+ height: "fit-content",
113
+ }, 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" }), 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: 16 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
114
+ fontSize: theme.typography.fontSize12,
115
+ textTransform: "capitalize",
116
+ color: getStatusColor(),
117
+ }, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", alignItems: "flex-end", ml: "auto" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, color: getAmountColor(), textAlign: "right" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: activityData.currency_slug }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { textAlign: "right" }), children: (0, formatDate_1.default)(activityData.date_created) })] })] })), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: detailDrawerRef, onClose: onCloseDetail, children: isOpenDetail && ((0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: closeDetail, title: (_a = activityData.transaction_type) === null || _a === void 0 ? void 0 : _a.name, children: (0, jsx_runtime_1.jsx)(ActivityDetail_1.default, { activityData: activityData }) })) })] }));
117
118
  }
118
119
  exports.default = ActivityItem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.476",
3
+ "version": "0.0.478",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",