awing-library 2.1.39-beta → 2.1.41-beta
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/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/index.js
CHANGED
|
@@ -6,65 +6,69 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
var react_i18next_1 = require("react-i18next");
|
|
8
8
|
var material_1 = require("@mui/material");
|
|
9
|
-
var react_router_dom_1 = require("react-router-dom");
|
|
10
9
|
var NotificationAvatar_1 = __importDefault(require("./NotificationAvatar"));
|
|
11
10
|
var NotificationContent_1 = __importDefault(require("./NotificationContent"));
|
|
12
11
|
var notSeen_svg_1 = __importDefault(require("../../../../../Assets/Images/notSeen.svg"));
|
|
13
12
|
var watched_svg_1 = __importDefault(require("../../../../../Assets/Images/watched.svg"));
|
|
14
13
|
var Types_1 = require("../../../Types");
|
|
15
14
|
var Message_1 = require("./Message");
|
|
15
|
+
var Router_1 = require("../../../../../AWING/Router");
|
|
16
16
|
var NotificationItem = function (props) {
|
|
17
17
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
18
|
-
var
|
|
18
|
+
var navigate = (0, Router_1.useNavigate)();
|
|
19
|
+
var notificationMessage = props.notificationMessage, onUpdateStatus = props.onUpdateStatus;
|
|
19
20
|
var sagaTransactionType = notificationMessage.sagaTransactionType, fields = notificationMessage.fields, status = notificationMessage.status, id = notificationMessage.id;
|
|
20
21
|
var handleUpdateStatus = function (event) {
|
|
21
22
|
event.preventDefault();
|
|
22
23
|
event.stopPropagation();
|
|
23
24
|
onUpdateStatus({ id: id, status: status });
|
|
24
25
|
};
|
|
26
|
+
var handleClickNotification = function () {
|
|
27
|
+
navigate((0, Message_1.getFullDescription)(sagaTransactionType, t, fields).url);
|
|
28
|
+
status === Types_1.NotificationMessageStatus.Read &&
|
|
29
|
+
onUpdateStatus({ id: id, status: status });
|
|
30
|
+
};
|
|
25
31
|
var itemStatus = status === Types_1.NotificationMessageStatus.Read;
|
|
26
|
-
return ((0, jsx_runtime_1.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
'
|
|
41
|
-
backgroundColor: '#03030312',
|
|
42
|
-
'& .wrapBtnStatus': {
|
|
43
|
-
display: 'flex',
|
|
44
|
-
alignItems: 'center',
|
|
45
|
-
position: 'absolute',
|
|
46
|
-
right: '32px',
|
|
47
|
-
padding: '4px',
|
|
48
|
-
cursor: 'pointer',
|
|
49
|
-
borderRadius: '50%',
|
|
50
|
-
backgroundColor: '#EBEDF0',
|
|
51
|
-
boxShadow: 'rgba(14, 30, 37, 0.12) 0 2px 4px 0, rgba(14, 30, 37, 0.32) 0 2px 16px 0',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
], children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { content: "div", sx: {
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { color: "inherit", onClick: handleClickNotification, sx: [
|
|
33
|
+
{
|
|
34
|
+
display: 'flex',
|
|
35
|
+
flexDirection: 'row',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
justifyContent: 'space-between',
|
|
38
|
+
padding: '8px',
|
|
39
|
+
borderRadius: '8px',
|
|
40
|
+
position: 'relative',
|
|
41
|
+
cursor: 'pointer',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
'&:hover': {
|
|
45
|
+
backgroundColor: '#03030312',
|
|
46
|
+
'& .wrapBtnStatus': {
|
|
56
47
|
display: 'flex',
|
|
57
|
-
flexDirection: 'row',
|
|
58
48
|
alignItems: 'center',
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
:
|
|
62
|
-
|
|
63
|
-
: watched_svg_1.default), alt: itemStatus ? 'iconNotSeen' : 'iconWatched', style: { width: '25px', height: '25px' } }) }), itemStatus && ((0, jsx_runtime_1.jsx)(material_1.Paper, { "data-testid": "iconStatus", variant: "outlined", sx: {
|
|
64
|
-
padding: '5px',
|
|
65
|
-
marginLeft: '8px',
|
|
49
|
+
position: 'absolute',
|
|
50
|
+
right: '32px',
|
|
51
|
+
padding: '4px',
|
|
52
|
+
cursor: 'pointer',
|
|
66
53
|
borderRadius: '50%',
|
|
67
|
-
backgroundColor: '#
|
|
68
|
-
|
|
54
|
+
backgroundColor: '#EBEDF0',
|
|
55
|
+
boxShadow: 'rgba(14, 30, 37, 0.12) 0 2px 4px 0, rgba(14, 30, 37, 0.32) 0 2px 16px 0',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
], children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { content: "div", sx: {
|
|
60
|
+
display: 'flex',
|
|
61
|
+
flexDirection: 'row',
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
}, children: [(0, jsx_runtime_1.jsx)(NotificationAvatar_1.default, { url: '', name: '' }), (0, jsx_runtime_1.jsx)(NotificationContent_1.default, { status: itemStatus, notificationMessage: notificationMessage })] }), (0, jsx_runtime_1.jsx)(material_1.Paper, { variant: "outlined", sx: { display: 'none' }, className: "wrapBtnStatus", onClick: handleUpdateStatus, title: itemStatus
|
|
64
|
+
? t('Notifications.TitleMarkRead')
|
|
65
|
+
: t('Notifications.TitleMarkUnread'), children: (0, jsx_runtime_1.jsx)("img", { src: (itemStatus
|
|
66
|
+
? notSeen_svg_1.default
|
|
67
|
+
: watched_svg_1.default), alt: itemStatus ? 'iconNotSeen' : 'iconWatched', style: { width: '25px', height: '25px' } }) }), itemStatus && ((0, jsx_runtime_1.jsx)(material_1.Paper, { "data-testid": "iconStatus", variant: "outlined", sx: {
|
|
68
|
+
padding: '5px',
|
|
69
|
+
marginLeft: '8px',
|
|
70
|
+
borderRadius: '50%',
|
|
71
|
+
backgroundColor: '#ed1d25',
|
|
72
|
+
} }))] }));
|
|
69
73
|
};
|
|
70
74
|
exports.default = NotificationItem;
|