@chlp-tech/rpa-ui 0.0.17-beta-1 → 0.0.17-beta-2

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.
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { useMemo } from "react";
2
2
  import styles from "./index.module.less";
3
3
  import Process from "./imgs/process.svg";
4
4
  import Wait from "./imgs/wait.svg";
@@ -7,84 +7,96 @@ import Fail from "./imgs/fail.svg";
7
7
  import Publish from "./imgs/publish.svg";
8
8
  import Pause from "./imgs/pause.svg";
9
9
  import Delete from "./imgs/delete.svg";
10
- import i18next from "i18next";
11
- var statusTag = {
12
- 0: {
13
- bgColor: '#ECEFF4',
14
- textColor: '#3F5270',
15
- text: i18next.t('草稿', {
16
- ns: 'publish'
17
- }),
18
- icon: Process
19
- },
20
- 1: {
21
- bgColor: '#FFF5E9',
22
- textColor: '#FF8800',
23
- text: "待发布",
24
- // text: i18next.t('待发布', { ns: 'publish' }),
25
- icon: Wait
26
- },
27
- 2: {
28
- bgColor: '#E0FFDD',
29
- textColor: '#3BC92B',
30
- text: i18next.t('发布成功', {
31
- ns: 'publish'
32
- }),
33
- icon: Success
34
- },
35
- 3: {
36
- bgColor: '#FEECEC',
37
- textColor: '#FA4441',
38
- text: i18next.t('发布异常', {
39
- ns: 'publish'
40
- }),
41
- icon: Fail
42
- },
43
- 4: {
44
- bgColor: '#E9F1FF',
45
- textColor: '#004FD3',
46
- text: i18next.t('发布中', {
47
- ns: 'publish'
48
- }),
49
- icon: Publish
50
- },
51
- 5: {
52
- bgColor: '#E9F1FF',
53
- textColor: '#004FD3',
54
- text: i18next.t('排队中', {
55
- ns: 'publish'
56
- }),
57
- icon: Publish
58
- },
59
- 6: {
60
- bgColor: '#ECEFF4',
61
- textColor: '#3F5270',
62
- text: i18next.t('已暂停', {
63
- ns: 'publish'
64
- }),
65
- icon: Pause
66
- },
67
- 7: {
68
- bgColor: '#E9F1FF',
69
- textColor: '#004FD3',
70
- text: i18next.t('审核中', {
71
- ns: 'publish'
72
- }),
73
- icon: Publish
74
- },
75
- 8: {
76
- bgColor: '#ECEFF4',
77
- textColor: '#3F5270',
78
- text: i18next.t('已删除', {
79
- ns: 'publish'
80
- }),
81
- icon: Delete
82
- }
10
+ import { useTranslation } from "react-i18next";
11
+ var useStatusHelper = function useStatusHelper() {
12
+ var _useTranslation = useTranslation(),
13
+ t = _useTranslation.t;
14
+ var statusTag = useMemo(function () {
15
+ return {
16
+ 0: {
17
+ bgColor: '#ECEFF4',
18
+ textColor: '#3F5270',
19
+ text: t('草稿', {
20
+ ns: 'publish'
21
+ }),
22
+ icon: Process
23
+ },
24
+ 1: {
25
+ bgColor: '#FFF5E9',
26
+ textColor: '#FF8800',
27
+ text: t('待发布', {
28
+ ns: 'publish'
29
+ }),
30
+ icon: Wait
31
+ },
32
+ 2: {
33
+ bgColor: '#E0FFDD',
34
+ textColor: '#3BC92B',
35
+ text: t('发布成功', {
36
+ ns: 'publish'
37
+ }),
38
+ icon: Success
39
+ },
40
+ 3: {
41
+ bgColor: '#FEECEC',
42
+ textColor: '#FA4441',
43
+ text: t('发布异常', {
44
+ ns: 'publish'
45
+ }),
46
+ icon: Fail
47
+ },
48
+ 4: {
49
+ bgColor: '#E9F1FF',
50
+ textColor: '#004FD3',
51
+ text: t('发布中', {
52
+ ns: 'publish'
53
+ }),
54
+ icon: Publish
55
+ },
56
+ 5: {
57
+ bgColor: '#E9F1FF',
58
+ textColor: '#004FD3',
59
+ text: t('排队中', {
60
+ ns: 'publish'
61
+ }),
62
+ icon: Publish
63
+ },
64
+ 6: {
65
+ bgColor: '#ECEFF4',
66
+ textColor: '#3F5270',
67
+ text: t('已暂停', {
68
+ ns: 'publish'
69
+ }),
70
+ icon: Pause
71
+ },
72
+ 7: {
73
+ bgColor: '#E9F1FF',
74
+ textColor: '#004FD3',
75
+ text: t('审核中', {
76
+ ns: 'publish'
77
+ }),
78
+ icon: Publish
79
+ },
80
+ 8: {
81
+ bgColor: '#ECEFF4',
82
+ textColor: '#3F5270',
83
+ text: t('已删除', {
84
+ ns: 'publish'
85
+ }),
86
+ icon: Delete
87
+ }
88
+ };
89
+ }, []);
90
+ return {
91
+ statusTag: statusTag
92
+ };
83
93
  };
84
94
  var StatusTag = function StatusTag(_ref) {
85
95
  var _statusTag$status, _statusTag$status2, _statusTag$status3, _statusTag$status4;
86
96
  var _ref$status = _ref.status,
87
97
  status = _ref$status === void 0 ? 0 : _ref$status;
98
+ var _useStatusHelper = useStatusHelper(),
99
+ statusTag = _useStatusHelper.statusTag;
88
100
  return /*#__PURE__*/React.createElement("div", {
89
101
  className: styles['status-tag'],
90
102
  style: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chlp-tech/rpa-ui",
3
- "version": "0.0.17-beta-1",
3
+ "version": "0.0.17-beta-2",
4
4
  "description": "rpa-ui",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",