awing-library 2.1.53-beta → 2.1.54-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.
@@ -15,7 +15,7 @@ exports.Constants = {
15
15
  ALL: 'All',
16
16
  ALL_STATUS: undefined,
17
17
  UNREAD: 'Unread',
18
- UNREAD_STATUS: 1,
18
+ UNREAD_STATUS: 0,
19
19
  SELECT_ALL: 'SelectAll',
20
20
  NOTIFICATIONS_PATH: 'Notifications',
21
21
  NOTIFICATION_SETTING_SCREEN_PATH: 'Notification',
@@ -14,8 +14,10 @@ var ButtonTabs = function (props) {
14
14
  };
15
15
  return ((0, jsx_runtime_1.jsxs)(material_1.Box, { mt: 2, component: "div", children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleUpdateTabs, sx: [
16
16
  {
17
- fontWeight: '600',
17
+ fontSize: '14px',
18
+ fontWeight: 700,
18
19
  borderRadius: '24px',
20
+ textTransform: 'none',
19
21
  color: tabActive === Constant_1.Constants.ALL ? '#FFF' : '#000',
20
22
  backgroundColor: tabActive === Constant_1.Constants.ALL ? '#ED1D25' : 'inherit',
21
23
  },
@@ -28,9 +30,11 @@ var ButtonTabs = function (props) {
28
30
  },
29
31
  ], "data-tabs": Constant_1.Constants.ALL, children: t('Common.All') }), (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleUpdateTabs, "data-tabs": Constant_1.Constants.UNREAD, sx: [
30
32
  {
33
+ fontSize: '14px',
31
34
  marginLeft: '8px',
32
- fontWeight: '600',
35
+ fontWeight: 700,
33
36
  borderRadius: '24px',
37
+ textTransform: 'none',
34
38
  color: tabActive === Constant_1.Constants.UNREAD ? '#FFF' : '#000',
35
39
  backgroundColor: tabActive === Constant_1.Constants.UNREAD
36
40
  ? '#ED1D25'
@@ -73,6 +73,6 @@ var MenuNotification = function (props) {
73
73
  }, children: menuData().map(function (item) { return ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, { onClick: selectMenuItem, "data-value": item.value, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { mr: 2, style: {
74
74
  display: 'flex',
75
75
  justifyContent: 'center',
76
- }, children: (item === null || item === void 0 ? void 0 : item.icon) && ((0, jsx_runtime_1.jsx)("img", { alt: "", src: item.icon, style: { width: '20px', height: '20px' } })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "inherit", children: item.title })] }, item.id)); }) })] }));
76
+ }, children: (item === null || item === void 0 ? void 0 : item.icon) && ((0, jsx_runtime_1.jsx)("img", { alt: "", src: item.icon, style: { width: '20px', height: '20px' } })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "inherit", sx: { fontSize: '15px', fontWeight: 400 }, children: item.title })] }, item.id)); }) })] }));
77
77
  };
78
78
  exports.default = react_1.default.memo(MenuNotification);
@@ -10,6 +10,7 @@ interface PropsHeaderInfo {
10
10
  textSearch: string;
11
11
  tabs: string;
12
12
  };
13
+ onClosePopover?: () => void;
13
14
  onUpdateStatus: (dataSent: IValueItem | string) => void;
14
15
  onValueFilter: (textSearch: string, tabs: string) => void;
15
16
  }
@@ -20,11 +20,15 @@ var Router_1 = require("../../../../AWING/Router");
20
20
  var HeaderInfo = function (props) {
21
21
  var navigate = (0, Router_1.useNavigate)();
22
22
  var t = (0, react_i18next_1.useTranslation)().t;
23
- var valueFilter = props.valueFilter, _a = props.onValueFilter, onValueFilter = _a === void 0 ? function () { return null; } : _a, _b = props.onUpdateStatus, onUpdateStatus = _b === void 0 ? function () { return null; } : _b;
23
+ var valueFilter = props.valueFilter, _a = props.onValueFilter, onValueFilter = _a === void 0 ? function () { return null; } : _a, _b = props.onUpdateStatus, onUpdateStatus = _b === void 0 ? function () { return null; } : _b, _c = props.onClosePopover, onClosePopover = _c === void 0 ? function () { return null; } : _c;
24
24
  var handleUpdateMenuItem = function (value) {
25
25
  if (value === Constant_1.Constants.SELECT_ALL) {
26
26
  onUpdateStatus(Constant_1.Constants.ALL);
27
27
  }
28
+ else if (value === Constant_1.Constants.NOTIFICATION_SETTING_SCREEN_PATH) {
29
+ navigate("".concat(value));
30
+ onClosePopover();
31
+ }
28
32
  else {
29
33
  // Chuyển đến trang tương ứng
30
34
  navigate("".concat(value));
@@ -40,10 +44,7 @@ var HeaderInfo = function (props) {
40
44
  display: 'flex',
41
45
  flexDirection: 'row',
42
46
  justifyContent: 'space-between',
43
- }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h1", style: {
44
- fontWeight: '700',
45
- fontSize: '1.5em',
46
- }, children: t('Common.Notification') }), (0, jsx_runtime_1.jsx)(MenuNotification_1.default, { onUpdateMenuItem: handleUpdateMenuItem })] }), (0, jsx_runtime_1.jsx)(SearchBox_1.default, { variantPaper: "outlined", onSearch: handleKeyWordPassing, stylePaper: {
47
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { component: "h1", variant: "h5", color: "inherit", noWrap: true, fontWeight: 'bold', children: t('Common.Notification') }), (0, jsx_runtime_1.jsx)(MenuNotification_1.default, { onUpdateMenuItem: handleUpdateMenuItem })] }), (0, jsx_runtime_1.jsx)(SearchBox_1.default, { variantPaper: "outlined", onSearch: handleKeyWordPassing, stylePaper: {
47
48
  flex: 1,
48
49
  width: 'auto',
49
50
  maxWidth: '100%',
@@ -24,9 +24,9 @@ var NotificationEmpty = function (props) {
24
24
  alignItems: 'center',
25
25
  justifyContent: 'space-between',
26
26
  }, children: [(0, jsx_runtime_1.jsx)("img", { src: (isSearch ? binoculars_svg_1.default : bell_svg_1.default), alt: isSearch ? 'iconBinoculars' : 'iconBell', style: { width: '80px', height: '80px' } }), (0, jsx_runtime_1.jsx)(material_1.Typography, { style: {
27
- fontSize: '1.3em',
27
+ fontSize: '20px',
28
28
  color: '#65676B',
29
- fontWeight: '600',
29
+ fontWeight: 600,
30
30
  marginTop: '10px',
31
31
  textAlign: 'center',
32
32
  }, children: isSearch
@@ -25,8 +25,8 @@ var material_1 = require("@mui/material");
25
25
  var NotificationAvatar = function (props) {
26
26
  var url = props.url, name = props.name;
27
27
  var styleAvatar = {
28
- width: '56px',
29
- height: '56px',
28
+ width: '54px',
29
+ height: '54px',
30
30
  border: '1px solid #0000001a',
31
31
  };
32
32
  if (!url) {
@@ -29,23 +29,26 @@ var NotificationContent = function (props) {
29
29
  textOverflow: 'ellipsis',
30
30
  display: '-webkit-box',
31
31
  WebkitBoxOrient: 'vertical',
32
- WebkitLineClamp: 2,
32
+ WebkitLineClamp: 5,
33
33
  margin: '0 0 2px 0',
34
34
  lineHeight: 1.2,
35
- fontSize: '1rem',
35
+ fontSize: '14px',
36
+ fontWeight: 400,
36
37
  justifyContent: 'space-between',
37
38
  },
38
39
  {
39
40
  '& h1, h2, h3, h4, h5, h6, p, span, b, strong, small, em, i, big': {
40
41
  marginTop: 0,
41
42
  marginBottom: 0,
42
- fontSize: '1rem',
43
+ fontSize: '14px',
44
+ fontWeight: 400,
43
45
  textAlign: 'justify',
44
46
  },
45
47
  '& a': {
46
48
  color: '#1a0dab',
47
49
  textDecoration: 'none',
48
- fontSize: '1rem',
50
+ fontSize: '14px',
51
+ fontWeight: 400,
49
52
  textAlign: 'justify',
50
53
  },
51
54
  },
@@ -28,7 +28,7 @@ var NotificationItem = function (props) {
28
28
  status === Types_1.NotificationMessageStatus.Read &&
29
29
  onUpdateStatus({ id: id, status: status });
30
30
  };
31
- var itemStatus = status === Types_1.NotificationMessageStatus.Read;
31
+ var itemStatus = status === Types_1.NotificationMessageStatus.Unread;
32
32
  return ((0, jsx_runtime_1.jsxs)(material_1.Box, { color: "inherit", onClick: handleClickNotification, sx: [
33
33
  {
34
34
  display: 'flex',
@@ -3,6 +3,9 @@
3
3
  * @author dauquan1108@gmail.com on 11/27/2023.
4
4
  *
5
5
  **/
6
- import React from 'react';
7
- declare const NotificationDetail: React.FC;
6
+ /// <reference types="react" />
7
+ interface NotificationDetailProps {
8
+ onClosePopover?: () => void;
9
+ }
10
+ declare const NotificationDetail: (props: NotificationDetailProps) => JSX.Element;
8
11
  export default NotificationDetail;
@@ -61,8 +61,9 @@ var Constant_1 = require("../Constant");
61
61
  var Hooks_1 = __importDefault(require("../Hooks"));
62
62
  var NotificationList_1 = __importDefault(require("./NotificationList"));
63
63
  var Types_1 = require("../Types");
64
- var NotificationDetail = function () {
64
+ var NotificationDetail = function (props) {
65
65
  var service = (0, Hooks_1.default)().service;
66
+ var onClosePopover = props.onClosePopover;
66
67
  var _a = (0, react_1.useState)({
67
68
  textSearch: '',
68
69
  tabs: Constant_1.Constants.ALL,
@@ -123,12 +124,12 @@ var NotificationDetail = function () {
123
124
  var handleUpdateStatus = (0, react_1.useCallback)(function (dataSent) {
124
125
  if (typeof dataSent === 'string') {
125
126
  var isCheckStatus = notificationMessage.some(function (item) {
126
- return item.status === Types_1.NotificationMessageStatus.Read;
127
+ return item.status === Types_1.NotificationMessageStatus.Unread;
127
128
  });
128
129
  if (isCheckStatus) {
129
130
  service.notificationsReadAll().then(function () {
130
131
  setNotificationMessage(function (prevNotifications) {
131
- return prevNotifications.map(function (item) { return (__assign(__assign({}, item), { status: Types_1.NotificationMessageStatus.Unread })); });
132
+ return prevNotifications.map(function (item) { return (__assign(__assign({}, item), { status: Types_1.NotificationMessageStatus.Read })); });
132
133
  });
133
134
  });
134
135
  }
@@ -153,6 +154,6 @@ var NotificationDetail = function () {
153
154
  });
154
155
  }
155
156
  }, [notificationMessage, service]);
156
- return ((0, jsx_runtime_1.jsxs)(react_i18next_1.I18nextProvider, { i18n: i18n_1.default, children: [(0, jsx_runtime_1.jsx)(Box_1.default, { pt: 2, pl: 2, pr: 2, pb: 1, component: "div", children: (0, jsx_runtime_1.jsx)(HeaderInfo_1.default, { valueFilter: valueFilter, onValueFilter: handleValueFilter, onUpdateStatus: handleUpdateStatus }) }), (0, jsx_runtime_1.jsx)(Box_1.default, { pl: 1, pr: 1, pb: 1, component: "div", children: (0, jsx_runtime_1.jsx)(NotificationList_1.default, { isLoading: isLoading, valueFilter: valueFilter, notificationMessage: notificationMessage, onUpdateStatus: handleUpdateStatus }) }), (0, jsx_runtime_1.jsx)(Box_1.default, { id: "last-Item", component: "div", sx: { height: '20px' } })] }));
157
+ return ((0, jsx_runtime_1.jsxs)(react_i18next_1.I18nextProvider, { i18n: i18n_1.default, children: [(0, jsx_runtime_1.jsx)(Box_1.default, { pt: 2, pl: 2, pr: 2, pb: 1, component: "div", children: (0, jsx_runtime_1.jsx)(HeaderInfo_1.default, { valueFilter: valueFilter, onClosePopover: onClosePopover, onValueFilter: handleValueFilter, onUpdateStatus: handleUpdateStatus }) }), (0, jsx_runtime_1.jsx)(Box_1.default, { pl: 1, pr: 1, pb: 1, component: "div", children: (0, jsx_runtime_1.jsx)(NotificationList_1.default, { isLoading: isLoading, valueFilter: valueFilter, notificationMessage: notificationMessage, onUpdateStatus: handleUpdateStatus }) }), (0, jsx_runtime_1.jsx)(Box_1.default, { id: "last-Item", component: "div", sx: { height: '20px' } })] }));
157
158
  };
158
159
  exports.default = NotificationDetail;
@@ -144,6 +144,6 @@ var Container = function () {
144
144
  backgroundColor: '#c1c1c1',
145
145
  },
146
146
  },
147
- ], children: (0, jsx_runtime_1.jsx)(NotificationDetail_1.default, {}) }) })] }));
147
+ ], children: (0, jsx_runtime_1.jsx)(NotificationDetail_1.default, { onClosePopover: handleClose }) }) })] }));
148
148
  };
149
149
  exports.default = Container;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.53-beta",
3
+ "version": "2.1.54-beta",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",