tek-wallet 0.0.463 → 0.0.464

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.
@@ -43,22 +43,27 @@ function ActivityItem(props) {
43
43
  return undefined;
44
44
  return (0, parsePropsData_1.default)(data);
45
45
  }, [data]);
46
- var type = activityData === null || activityData === void 0 ? void 0 : activityData.transaction_type;
47
46
  var status = activityData === null || activityData === void 0 ? void 0 : activityData.transaction_status;
48
- var isIncrease = (0, react_1.useMemo)(function () {
49
- return type === type_1.TransactionSlug.Deposit;
47
+ var type = (0, react_1.useMemo)(function () {
48
+ return activityData === null || activityData === void 0 ? void 0 : activityData.transaction_type;
49
+ }, [activityData]);
50
+ var slug = (0, react_1.useMemo)(function () {
51
+ return type === null || type === void 0 ? void 0 : type.slug;
50
52
  }, [type]);
53
+ var isIncrease = (0, react_1.useMemo)(function () {
54
+ return slug === type_1.TransactionSlug.Deposit;
55
+ }, [slug]);
51
56
  var descriptionElement = (0, react_1.useMemo)(function () {
52
- var isReceive = type === type_1.TransactionSlug.Receive || type === type_1.TransactionSlug.Deposit;
57
+ var isReceive = slug === type_1.TransactionSlug.Receive || slug === type_1.TransactionSlug.Deposit;
53
58
  if (isReceive) {
54
59
  return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["From: ", (0, compactWalletAddress_1.default)(activityData === null || activityData === void 0 ? void 0 : activityData.from_address)] });
55
60
  }
56
- var isSend = type === type_1.TransactionSlug.Send || type === type_1.TransactionSlug.Withdrawn;
61
+ var isSend = slug === type_1.TransactionSlug.Send || slug === type_1.TransactionSlug.Withdrawn;
57
62
  if (isSend) {
58
63
  return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["To: ", (0, compactWalletAddress_1.default)(activityData === null || activityData === void 0 ? void 0 : activityData.to_address)] });
59
64
  }
60
65
  return null;
61
- }, [status]);
66
+ }, [slug, activityData === null || activityData === void 0 ? void 0 : activityData.from_address, activityData === null || activityData === void 0 ? void 0 : activityData.to_address]);
62
67
  var getStatusColor = (0, react_1.useCallback)(function () {
63
68
  switch (status) {
64
69
  case type_1.TransactionStatus.Processing:
@@ -81,7 +86,7 @@ function ActivityItem(props) {
81
86
  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.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: {
82
87
  width: "fit-content",
83
88
  height: "fit-content",
84
- }, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: activityData.icon, 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: activityData.transaction_type }), (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: {
89
+ }, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: type === null || type === void 0 ? void 0 : type.icon, 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: {
85
90
  fontSize: theme.typography.fontSize12,
86
91
  textTransform: "capitalize",
87
92
  color: getStatusColor(),
@@ -31,7 +31,7 @@ var useEventHandler = function () {
31
31
  notificationType = "info";
32
32
  }
33
33
  return {
34
- message: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: { textTransform: "capitalize" }, children: type }), " ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: currency }), " is", " ", status] })),
34
+ message: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: { textTransform: "capitalize" }, children: type.name }), " ", (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: currency }), " is", " ", status] })),
35
35
  type: notificationType,
36
36
  id: "".concat(transactionId, "-").concat(status),
37
37
  };
@@ -1,6 +1,3 @@
1
- import { TransactionSlug } from "../../services/axios/get-activities-service/type";
1
+ import { TransactionType } from "../../services/axios/get-activities-service/type";
2
2
  export declare const ACTIVITIES_PAGE_SIZE = 10;
3
- export declare const ACTIVITIES_TYPE_ALL: {
4
- name: string;
5
- slug: TransactionSlug;
6
- };
3
+ export declare const ACTIVITIES_TYPE_ALL: TransactionType;
@@ -4,6 +4,12 @@ exports.ACTIVITIES_TYPE_ALL = exports.ACTIVITIES_PAGE_SIZE = void 0;
4
4
  var type_1 = require("../../services/axios/get-activities-service/type");
5
5
  exports.ACTIVITIES_PAGE_SIZE = 10;
6
6
  exports.ACTIVITIES_TYPE_ALL = {
7
+ id: -1,
8
+ status: "all",
7
9
  name: "All",
8
10
  slug: type_1.TransactionSlug.All,
11
+ description: null,
12
+ icon: "",
13
+ link: "",
14
+ icon_svg: "",
9
15
  };
@@ -17,17 +17,13 @@ export interface Data {
17
17
  transaction_types: TransactionType[];
18
18
  paginated: Paginated;
19
19
  }
20
- export interface TransactionType {
21
- name: string;
22
- slug: TransactionSlug;
23
- }
24
20
  export interface Transaction {
25
21
  id: number;
26
- transaction_type: TransactionSlug;
22
+ transaction_type: TransactionType;
27
23
  from_address: string;
28
24
  to_address: string;
29
25
  network: string;
30
- from_app_slug: null | string;
26
+ from_app_slug: string;
31
27
  currency_slug: string;
32
28
  fee: string;
33
29
  amount: string;
@@ -36,10 +32,19 @@ export interface Transaction {
36
32
  user_updated: string;
37
33
  date_created: string;
38
34
  date_updated: null;
39
- description: null | string;
35
+ description: null;
40
36
  from_locked_balance: null;
41
37
  to_locked_balance: null;
38
+ }
39
+ export interface TransactionType {
40
+ id: number;
41
+ status: string;
42
+ name: string;
43
+ slug: TransactionSlug;
44
+ description: null;
42
45
  icon: string;
46
+ link: string;
47
+ icon_svg: string;
43
48
  }
44
49
  export declare enum TransactionSlug {
45
50
  All = "all",
@@ -1,6 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TransactionStatus = exports.TransactionSlug = void 0;
4
+ // export interface Transaction {
5
+ // id: number;
6
+ // transaction_type: TransactionSlug;
7
+ // from_address: string;
8
+ // to_address: string;
9
+ // network: string;
10
+ // from_app_slug: null | string;
11
+ // currency_slug: string;
12
+ // fee: string;
13
+ // amount: string;
14
+ // transaction_status: TransactionStatus;
15
+ // user_created: string;
16
+ // user_updated: string;
17
+ // date_created: string;
18
+ // date_updated: null;
19
+ // description: null | string;
20
+ // from_locked_balance: null;
21
+ // to_locked_balance: null;
22
+ // icon: string;
23
+ // }
4
24
  var TransactionSlug;
5
25
  (function (TransactionSlug) {
6
26
  TransactionSlug["All"] = "all";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.463",
3
+ "version": "0.0.464",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",