@esvndev/es-react-template-chat 0.0.75 → 0.0.77
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/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +215 -85
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +215 -85
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -15,6 +15,8 @@ import { HelpEventOpen } from '@esvndev/es-template-help';
|
|
|
15
15
|
import { CDN_URL_VIEW as CDN_URL_VIEW$1 } from '@src/domain/constants';
|
|
16
16
|
import { isNullOrUndefined as isNullOrUndefined$2 } from '@src/utility/hooks/isNullOrUndefined';
|
|
17
17
|
import avatarDefault from '@core/assets/images/avatars/avatar-blank.png';
|
|
18
|
+
import '@draft-js-plugins/mention/lib/plugin.css';
|
|
19
|
+
import '@draft-js-plugins/emoji/lib/plugin.css';
|
|
18
20
|
import { useLocation } from 'react-router-dom';
|
|
19
21
|
import { useDispatch } from 'react-redux';
|
|
20
22
|
|
|
@@ -21489,6 +21491,85 @@ function commonjsRequire (path) {
|
|
|
21489
21491
|
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
21490
21492
|
}
|
|
21491
21493
|
|
|
21494
|
+
var classnames$1 = {exports: {}};
|
|
21495
|
+
|
|
21496
|
+
/*!
|
|
21497
|
+
Copyright (c) 2018 Jed Watson.
|
|
21498
|
+
Licensed under the MIT License (MIT), see
|
|
21499
|
+
http://jedwatson.github.io/classnames
|
|
21500
|
+
*/
|
|
21501
|
+
|
|
21502
|
+
(function (module) {
|
|
21503
|
+
/* global define */
|
|
21504
|
+
|
|
21505
|
+
(function () {
|
|
21506
|
+
|
|
21507
|
+
var hasOwn = {}.hasOwnProperty;
|
|
21508
|
+
|
|
21509
|
+
function classNames () {
|
|
21510
|
+
var classes = '';
|
|
21511
|
+
|
|
21512
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
21513
|
+
var arg = arguments[i];
|
|
21514
|
+
if (arg) {
|
|
21515
|
+
classes = appendClass(classes, parseValue(arg));
|
|
21516
|
+
}
|
|
21517
|
+
}
|
|
21518
|
+
|
|
21519
|
+
return classes;
|
|
21520
|
+
}
|
|
21521
|
+
|
|
21522
|
+
function parseValue (arg) {
|
|
21523
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
21524
|
+
return arg;
|
|
21525
|
+
}
|
|
21526
|
+
|
|
21527
|
+
if (typeof arg !== 'object') {
|
|
21528
|
+
return '';
|
|
21529
|
+
}
|
|
21530
|
+
|
|
21531
|
+
if (Array.isArray(arg)) {
|
|
21532
|
+
return classNames.apply(null, arg);
|
|
21533
|
+
}
|
|
21534
|
+
|
|
21535
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
21536
|
+
return arg.toString();
|
|
21537
|
+
}
|
|
21538
|
+
|
|
21539
|
+
var classes = '';
|
|
21540
|
+
|
|
21541
|
+
for (var key in arg) {
|
|
21542
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
21543
|
+
classes = appendClass(classes, key);
|
|
21544
|
+
}
|
|
21545
|
+
}
|
|
21546
|
+
|
|
21547
|
+
return classes;
|
|
21548
|
+
}
|
|
21549
|
+
|
|
21550
|
+
function appendClass (value, newClass) {
|
|
21551
|
+
if (!newClass) {
|
|
21552
|
+
return value;
|
|
21553
|
+
}
|
|
21554
|
+
|
|
21555
|
+
if (value) {
|
|
21556
|
+
return value + ' ' + newClass;
|
|
21557
|
+
}
|
|
21558
|
+
|
|
21559
|
+
return value + newClass;
|
|
21560
|
+
}
|
|
21561
|
+
|
|
21562
|
+
if (module.exports) {
|
|
21563
|
+
classNames.default = classNames;
|
|
21564
|
+
module.exports = classNames;
|
|
21565
|
+
} else {
|
|
21566
|
+
window.classNames = classNames;
|
|
21567
|
+
}
|
|
21568
|
+
}());
|
|
21569
|
+
}(classnames$1));
|
|
21570
|
+
|
|
21571
|
+
var classnames = classnames$1.exports;
|
|
21572
|
+
|
|
21492
21573
|
var vi = {exports: {}};
|
|
21493
21574
|
|
|
21494
21575
|
var dayjs_min = {exports: {}};
|
|
@@ -29434,85 +29515,6 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
29434
29515
|
|
|
29435
29516
|
var PropTypes = propTypes$s.exports;
|
|
29436
29517
|
|
|
29437
|
-
var classnames$1 = {exports: {}};
|
|
29438
|
-
|
|
29439
|
-
/*!
|
|
29440
|
-
Copyright (c) 2018 Jed Watson.
|
|
29441
|
-
Licensed under the MIT License (MIT), see
|
|
29442
|
-
http://jedwatson.github.io/classnames
|
|
29443
|
-
*/
|
|
29444
|
-
|
|
29445
|
-
(function (module) {
|
|
29446
|
-
/* global define */
|
|
29447
|
-
|
|
29448
|
-
(function () {
|
|
29449
|
-
|
|
29450
|
-
var hasOwn = {}.hasOwnProperty;
|
|
29451
|
-
|
|
29452
|
-
function classNames () {
|
|
29453
|
-
var classes = '';
|
|
29454
|
-
|
|
29455
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
29456
|
-
var arg = arguments[i];
|
|
29457
|
-
if (arg) {
|
|
29458
|
-
classes = appendClass(classes, parseValue(arg));
|
|
29459
|
-
}
|
|
29460
|
-
}
|
|
29461
|
-
|
|
29462
|
-
return classes;
|
|
29463
|
-
}
|
|
29464
|
-
|
|
29465
|
-
function parseValue (arg) {
|
|
29466
|
-
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
29467
|
-
return arg;
|
|
29468
|
-
}
|
|
29469
|
-
|
|
29470
|
-
if (typeof arg !== 'object') {
|
|
29471
|
-
return '';
|
|
29472
|
-
}
|
|
29473
|
-
|
|
29474
|
-
if (Array.isArray(arg)) {
|
|
29475
|
-
return classNames.apply(null, arg);
|
|
29476
|
-
}
|
|
29477
|
-
|
|
29478
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
29479
|
-
return arg.toString();
|
|
29480
|
-
}
|
|
29481
|
-
|
|
29482
|
-
var classes = '';
|
|
29483
|
-
|
|
29484
|
-
for (var key in arg) {
|
|
29485
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
29486
|
-
classes = appendClass(classes, key);
|
|
29487
|
-
}
|
|
29488
|
-
}
|
|
29489
|
-
|
|
29490
|
-
return classes;
|
|
29491
|
-
}
|
|
29492
|
-
|
|
29493
|
-
function appendClass (value, newClass) {
|
|
29494
|
-
if (!newClass) {
|
|
29495
|
-
return value;
|
|
29496
|
-
}
|
|
29497
|
-
|
|
29498
|
-
if (value) {
|
|
29499
|
-
return value + ' ' + newClass;
|
|
29500
|
-
}
|
|
29501
|
-
|
|
29502
|
-
return value + newClass;
|
|
29503
|
-
}
|
|
29504
|
-
|
|
29505
|
-
if (module.exports) {
|
|
29506
|
-
classNames.default = classNames;
|
|
29507
|
-
module.exports = classNames;
|
|
29508
|
-
} else {
|
|
29509
|
-
window.classNames = classNames;
|
|
29510
|
-
}
|
|
29511
|
-
}());
|
|
29512
|
-
}(classnames$1));
|
|
29513
|
-
|
|
29514
|
-
var classnames = classnames$1.exports;
|
|
29515
|
-
|
|
29516
29518
|
function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
29517
29519
|
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty$9(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29518
29520
|
function _defineProperty$9(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -36674,6 +36676,14 @@ var SvgLogOut = function (_a) {
|
|
|
36674
36676
|
React.createElement("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9" })));
|
|
36675
36677
|
};
|
|
36676
36678
|
|
|
36679
|
+
var SvgMail = function (_a) {
|
|
36680
|
+
var title = _a.title, titleId = _a.titleId, props = __rest(_a, ["title", "titleId"]);
|
|
36681
|
+
return (React.createElement("svg", __assign$1({ xmlns: "http://www.w3.org/2000/svg", width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: props.strokeWidth || 1.5, strokeLinecap: "round", strokeLinejoin: "round", className: "mail_svg__feather mail_svg__feather-mail", "aria-labelledby": titleId }, props),
|
|
36682
|
+
title ? React.createElement("title", { id: titleId }, title) : null,
|
|
36683
|
+
React.createElement("path", { d: "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" }),
|
|
36684
|
+
React.createElement("path", { d: "m22 6-10 7L2 6" })));
|
|
36685
|
+
};
|
|
36686
|
+
|
|
36677
36687
|
var SvgMessageCircle = function (_a) {
|
|
36678
36688
|
var title = _a.title, titleId = _a.titleId, props = __rest(_a, ["title", "titleId"]);
|
|
36679
36689
|
return (React.createElement("svg", __assign$1({ xmlns: "http://www.w3.org/2000/svg", width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: props.strokeWidth || 1.5, strokeLinecap: "round", strokeLinejoin: "round", className: "message-circle_svg__feather message-circle_svg__feather-message-circle", "aria-labelledby": titleId }, props),
|
|
@@ -36681,6 +36691,13 @@ var SvgMessageCircle = function (_a) {
|
|
|
36681
36691
|
React.createElement("path", { d: "M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" })));
|
|
36682
36692
|
};
|
|
36683
36693
|
|
|
36694
|
+
var SvgMessageSquare = function (_a) {
|
|
36695
|
+
var title = _a.title, titleId = _a.titleId, props = __rest(_a, ["title", "titleId"]);
|
|
36696
|
+
return (React.createElement("svg", __assign$1({ xmlns: "http://www.w3.org/2000/svg", width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: props.strokeWidth || 1.5, strokeLinecap: "round", strokeLinejoin: "round", className: "message-square_svg__feather message-square_svg__feather-message-square", "aria-labelledby": titleId }, props),
|
|
36697
|
+
title ? React.createElement("title", { id: titleId }, title) : null,
|
|
36698
|
+
React.createElement("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })));
|
|
36699
|
+
};
|
|
36700
|
+
|
|
36684
36701
|
var SvgPaperclip = function (_a) {
|
|
36685
36702
|
var title = _a.title, titleId = _a.titleId, props = __rest(_a, ["title", "titleId"]);
|
|
36686
36703
|
return (React.createElement("svg", __assign$1({ xmlns: "http://www.w3.org/2000/svg", width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: props.strokeWidth || 1.5, strokeLinecap: "round", strokeLinejoin: "round", className: "paperclip_svg__feather paperclip_svg__feather-paperclip", "aria-labelledby": titleId }, props),
|
|
@@ -36688,6 +36705,13 @@ var SvgPaperclip = function (_a) {
|
|
|
36688
36705
|
React.createElement("path", { d: "m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48" })));
|
|
36689
36706
|
};
|
|
36690
36707
|
|
|
36708
|
+
var SvgPhoneCall = function (_a) {
|
|
36709
|
+
var title = _a.title, titleId = _a.titleId, props = __rest(_a, ["title", "titleId"]);
|
|
36710
|
+
return (React.createElement("svg", __assign$1({ xmlns: "http://www.w3.org/2000/svg", width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: props.strokeWidth || 1.5, strokeLinecap: "round", strokeLinejoin: "round", className: "phone-call_svg__feather phone-call_svg__feather-phone-call", "aria-labelledby": titleId }, props),
|
|
36711
|
+
title ? React.createElement("title", { id: titleId }, title) : null,
|
|
36712
|
+
React.createElement("path", { d: "M15.05 5A5 5 0 0 1 19 8.95M15.05 1A9 9 0 0 1 23 8.94m-1 7.98v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z" })));
|
|
36713
|
+
};
|
|
36714
|
+
|
|
36691
36715
|
var SvgPlus = function (_a) {
|
|
36692
36716
|
var title = _a.title, titleId = _a.titleId, props = __rest(_a, ["title", "titleId"]);
|
|
36693
36717
|
return (React.createElement("svg", __assign$1({ xmlns: "http://www.w3.org/2000/svg", width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: props.strokeWidth || 1.5, strokeLinecap: "round", strokeLinejoin: "round", className: "plus_svg__feather plus_svg__feather-plus", "aria-labelledby": titleId }, props),
|
|
@@ -71749,6 +71773,30 @@ module.exports = exports['default'];
|
|
|
71749
71773
|
|
|
71750
71774
|
var PerfectScrollbar = /*@__PURE__*/getDefaultExportFromCjs(lib.exports);
|
|
71751
71775
|
|
|
71776
|
+
const UserProfileSidebar = (props) => {
|
|
71777
|
+
// ** Props
|
|
71778
|
+
const { user, handleUserSidebarRight, userSidebarRight } = props;
|
|
71779
|
+
const { t } = useTranslation();
|
|
71780
|
+
const userAvatar = (user && user.avatar) ? user.avatar : DEFAULT_AVATAR;
|
|
71781
|
+
return (jsxs("div", { className: classnames('user-profile-sidebar', { show: userSidebarRight === true }), children: [jsxs("header", { className: 'user-profile-header', children: [jsx("span", { className: 'close-icon', onClick: handleUserSidebarRight, children: jsx(SvgX, { fontSize: 14 }) }), jsxs("div", { className: 'header-profile-sidebar', children: [jsx(AvatarDefault, { className: 'box-shadow-1 avatar-border', size: 'xl', status: user.status === 1 ? 'online' : 'offline', img: userAvatar, imgHeight: '70', imgWidth: '70', color: 'light-secondary' }), jsx("h4", { className: 'chat-user-name', children: user.name }), jsx("span", { className: 'user-post', children: user.code })] })] }), jsx(PerfectScrollbar, { className: 'user-profile-sidebar-area', options: { wheelPropagation: false }, children: jsxs("div", { className: 'personal-info', children: [jsx("h6", { className: 'section-label mb-1 mt-3', children: t('Personal Information') }), jsxs("ul", { className: 'list-unstyled', children: [jsxs("li", { className: 'mb-1', children: [jsx(SvgMail, { className: 'me-75', fontSize: 17 }), jsx("span", { className: 'align-middle', children: user?.email })] }), jsxs("li", { className: 'mb-1', children: [jsx(SvgPhoneCall, { className: 'me-50', fontSize: 17 }), jsx("span", { className: 'align-middle', children: user?.phone })] })] })] }) })] }));
|
|
71782
|
+
};
|
|
71783
|
+
|
|
71784
|
+
const DateHeader = memo(({ label }) => (jsx("div", { className: "d-flex justify-content-center", children: jsx("div", { style: {
|
|
71785
|
+
backgroundColor: "rgba(0,0,0,0.2)",
|
|
71786
|
+
padding: "2px 15px",
|
|
71787
|
+
borderRadius: "6px"
|
|
71788
|
+
}, children: jsx("p", { className: "m-0", style: { textAlign: "center", color: "#fff" }, children: label }) }) })));
|
|
71789
|
+
DateHeader.displayName = 'DateHeader';
|
|
71790
|
+
const ChatLog = (props) => {
|
|
71791
|
+
// ** Props & Store
|
|
71792
|
+
// const clipboard = useClipboard()
|
|
71793
|
+
const { contactId, chatRoomId } = useChat();
|
|
71794
|
+
const containerChatRef = useRef(null);
|
|
71795
|
+
return (jsx("div", { id: "chat-app-window", className: "chat-app-window", ref: containerChatRef, children: jsxs("div", { className: classnames("start-chat-area", {
|
|
71796
|
+
"d-none": contactId || chatRoomId
|
|
71797
|
+
}), children: [jsx("div", { className: "start-chat-icon mb-1", children: jsx(SvgMessageSquare, {}) }), jsx("h4", { className: "sidebar-toggle start-chat-text", children: "B\u1EAFt \u0111\u1EA7u tr\u00F2 chuy\u1EC7n" })] }) }));
|
|
71798
|
+
};
|
|
71799
|
+
|
|
71752
71800
|
var __extends$4 = (undefined && undefined.__extends) || (function () {
|
|
71753
71801
|
var extendStatics = function (d, b) {
|
|
71754
71802
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -75784,14 +75832,16 @@ const AppChat = () => {
|
|
|
75784
75832
|
return { innerWidth, innerHeight };
|
|
75785
75833
|
};
|
|
75786
75834
|
// ** States
|
|
75787
|
-
useState({});
|
|
75835
|
+
const [user, setUser] = useState({});
|
|
75788
75836
|
const [sidebar, setSidebar] = useState(false);
|
|
75789
|
-
useState(false);
|
|
75790
|
-
useState(false);
|
|
75837
|
+
const [sidebarRight, setSidebarRight] = useState(false);
|
|
75838
|
+
const [userSidebarRight, setUserSidebarRight] = useState(false);
|
|
75791
75839
|
const [userSidebarLeft, setUserSidebarLeft] = useState(false);
|
|
75792
75840
|
const [dataProfile, setDataProfile] = useState({});
|
|
75793
75841
|
const handleSidebar = () => setSidebar(!sidebar);
|
|
75842
|
+
const handleSidebarRight = () => setSidebarRight(!sidebarRight);
|
|
75794
75843
|
const handleUserSidebarLeft = () => setUserSidebarLeft(!userSidebarLeft);
|
|
75844
|
+
const handleUserSidebarRight = () => setUserSidebarRight(!userSidebarRight);
|
|
75795
75845
|
const [openModal, setOpenModal] = useState(false);
|
|
75796
75846
|
const [typeOpenModalAdd, setTypeOpenModalAdd] = useState(false);
|
|
75797
75847
|
const [tagFilter, setTagFilter] = useState('');
|
|
@@ -75801,14 +75851,22 @@ const AppChat = () => {
|
|
|
75801
75851
|
const [openModalGroup, setOpenModalGroup] = useState(false);
|
|
75802
75852
|
const [windowSize, setWindowSize] = useState(getWindowSize());
|
|
75803
75853
|
const [dataInfo, setDataInfo] = useState({});
|
|
75804
|
-
|
|
75854
|
+
useState({});
|
|
75805
75855
|
const [search, setSearch] = useState('');
|
|
75806
75856
|
const [currentPage, setCurrentPage] = useState(1);
|
|
75807
75857
|
const [contact, setContact] = useState([]);
|
|
75858
|
+
// ** Set user function for Right Sidebar
|
|
75859
|
+
const handleUser = (obj) => setUser(obj);
|
|
75808
75860
|
const handleModal = () => setOpenModal(!openModal);
|
|
75809
75861
|
const handleModalGroup = () => setOpenModalGroup(!openModalGroup);
|
|
75810
75862
|
const handleModalAddUserGroup = () => setOpenModalAddUserGroup(!openModalAddUserGroup);
|
|
75811
75863
|
const handleModalGroupInfo = () => setOpenModalGroupInfo(!openModalGroupInfo);
|
|
75864
|
+
const handleOverlayClick = () => {
|
|
75865
|
+
setSidebar(false);
|
|
75866
|
+
setUserSidebarRight(false);
|
|
75867
|
+
setUserSidebarLeft(false);
|
|
75868
|
+
setSidebarRight(false);
|
|
75869
|
+
};
|
|
75812
75870
|
useEffect(() => {
|
|
75813
75871
|
if (typeChat !== 'CONTACT') {
|
|
75814
75872
|
getData();
|
|
@@ -75847,7 +75905,7 @@ const AppChat = () => {
|
|
|
75847
75905
|
order: '',
|
|
75848
75906
|
pageNumber: 1,
|
|
75849
75907
|
pageSize: 20,
|
|
75850
|
-
tag: tagFilter
|
|
75908
|
+
tag: tagFilter
|
|
75851
75909
|
};
|
|
75852
75910
|
getHistoryApi(paging);
|
|
75853
75911
|
};
|
|
@@ -75864,6 +75922,23 @@ const AppChat = () => {
|
|
|
75864
75922
|
.then((rs) => setDataInfo(rs))
|
|
75865
75923
|
.catch((ex) => console.log(ex));
|
|
75866
75924
|
};
|
|
75925
|
+
const getMessageByGroup = async (param, pageNumber) => {
|
|
75926
|
+
if (chatRoomId === param) {
|
|
75927
|
+
const paging = {
|
|
75928
|
+
keyword: '',
|
|
75929
|
+
filter: '',
|
|
75930
|
+
order: 'createdDate;asc',
|
|
75931
|
+
pageNumber,
|
|
75932
|
+
pageSize: 25
|
|
75933
|
+
};
|
|
75934
|
+
try {
|
|
75935
|
+
await connection.invoke('GetMessageByGroupHistory', chatRoomId, paging);
|
|
75936
|
+
}
|
|
75937
|
+
catch (e) {
|
|
75938
|
+
console.error(e);
|
|
75939
|
+
}
|
|
75940
|
+
}
|
|
75941
|
+
};
|
|
75867
75942
|
const getMessageByContact = async (param, pageNumber) => {
|
|
75868
75943
|
const paging = {
|
|
75869
75944
|
keyword: '',
|
|
@@ -75891,6 +75966,14 @@ const AppChat = () => {
|
|
|
75891
75966
|
.then((rs) => setContact(rs.items))
|
|
75892
75967
|
.catch((ex) => console.log(ex));
|
|
75893
75968
|
};
|
|
75969
|
+
const sendMessage = async (id, message) => {
|
|
75970
|
+
try {
|
|
75971
|
+
await connection.invoke("SendMessage", id, message);
|
|
75972
|
+
}
|
|
75973
|
+
catch (e) {
|
|
75974
|
+
console.error(e);
|
|
75975
|
+
}
|
|
75976
|
+
};
|
|
75894
75977
|
const joinRoom = async (id) => {
|
|
75895
75978
|
try {
|
|
75896
75979
|
await connection.invoke("JoinRoom", id);
|
|
@@ -75923,6 +76006,22 @@ const AppChat = () => {
|
|
|
75923
76006
|
console.error(e);
|
|
75924
76007
|
}
|
|
75925
76008
|
};
|
|
76009
|
+
const chatGetType = async (chatRoomId, userId, keyword, type, startDate, endDate, pageNumber, pageSize) => {
|
|
76010
|
+
try {
|
|
76011
|
+
await connection.invoke("ChatGetType", chatRoomId, userId, keyword, type, startDate, endDate, pageNumber, pageSize);
|
|
76012
|
+
}
|
|
76013
|
+
catch (e) {
|
|
76014
|
+
console.error(e);
|
|
76015
|
+
}
|
|
76016
|
+
};
|
|
76017
|
+
const chatGetGroupCreateDate = async (chatRoomId, userId, keyword, type, startDate, endDate, pageNumber, pageSize) => {
|
|
76018
|
+
try {
|
|
76019
|
+
await connection.invoke("ChatGetGroupCreateDate", chatRoomId, userId, keyword, type, startDate, endDate, pageNumber, pageSize);
|
|
76020
|
+
}
|
|
76021
|
+
catch (e) {
|
|
76022
|
+
console.error(e);
|
|
76023
|
+
}
|
|
76024
|
+
};
|
|
75926
76025
|
const removeChatRoom = async (chatRoomId) => {
|
|
75927
76026
|
try {
|
|
75928
76027
|
await connection.invoke("RemoveChatRoom", chatRoomId);
|
|
@@ -75931,6 +76030,14 @@ const AppChat = () => {
|
|
|
75931
76030
|
console.error(e);
|
|
75932
76031
|
}
|
|
75933
76032
|
};
|
|
76033
|
+
const approveUpdateStatus = async (id, chatRoomId, status) => {
|
|
76034
|
+
try {
|
|
76035
|
+
await connection.invoke("ApproveUpdateStatus", id, chatRoomId, status);
|
|
76036
|
+
}
|
|
76037
|
+
catch (e) {
|
|
76038
|
+
console.error(e);
|
|
76039
|
+
}
|
|
76040
|
+
};
|
|
75934
76041
|
const editGroupName = async (chatRoomId, chatRoomName) => {
|
|
75935
76042
|
try {
|
|
75936
76043
|
await connection.invoke("EditGroupName", chatRoomId, chatRoomName);
|
|
@@ -75939,6 +76046,22 @@ const AppChat = () => {
|
|
|
75939
76046
|
console.error(e);
|
|
75940
76047
|
}
|
|
75941
76048
|
};
|
|
76049
|
+
const pinMessage = async (chatRoomId, messageId) => {
|
|
76050
|
+
try {
|
|
76051
|
+
await connection.invoke("PinMessage", chatRoomId, messageId);
|
|
76052
|
+
}
|
|
76053
|
+
catch (e) {
|
|
76054
|
+
console.error(e);
|
|
76055
|
+
}
|
|
76056
|
+
};
|
|
76057
|
+
const getPinnedMessages = async (chatRoomId) => {
|
|
76058
|
+
try {
|
|
76059
|
+
await connection.invoke("GetPinnedMessages", chatRoomId);
|
|
76060
|
+
}
|
|
76061
|
+
catch (e) {
|
|
76062
|
+
console.error(e);
|
|
76063
|
+
}
|
|
76064
|
+
};
|
|
75942
76065
|
const editGroupAvatar = async (chatRoomId, chatRoomAvatar) => {
|
|
75943
76066
|
try {
|
|
75944
76067
|
await connection.invoke("EditGroupAvatar", chatRoomId, chatRoomAvatar);
|
|
@@ -75956,7 +76079,14 @@ const AppChat = () => {
|
|
|
75956
76079
|
loadCldr(require(`@src/assets/cldr-data/main/${lang}/ca-gregorian.json`), require(`@src/assets/cldr-data/main/${lang}/numbers.json`), require(`@src/assets/cldr-data/main/${lang}/timeZoneNames.json`), require("@src/assets/supplemental/numberingSystems.json"));
|
|
75957
76080
|
setCulture(lang); // Change the Grid culture
|
|
75958
76081
|
}, [lang]);
|
|
75959
|
-
return (jsx(Fragment, { children: jsxs(LexicalComposer, { initialConfig: editorConfig(['@'], '', false, [EmojiNode], mentionItems), children: [jsx(SidebarLeft, { setSearch: setSearch, activeId: active, onTagFilterChange: setTagFilter, onFilterTabChange: setFilterTab, typeChat: typeChat, dataContact: contact, dataProfile: dataProfile, data: [...listHistory]?.sort((a, b) => new Date(b?.createdDate || 0).getTime() - new Date(a?.createdDate || 0).getTime()), sidebar: sidebar, handleSidebar: handleSidebar, userSidebarLeft: userSidebarLeft, handleUserSidebarLeft: handleUserSidebarLeft, joinRoom: joinRoom, leaveRoom: leaveRoom, JoinRoomContact: JoinRoomContact, chatRoomMemberUnreadMessages: chatRoomMemberUnreadMessages, removeChatRoom: removeChatRoom, currentPage: currentPage, setCurrentPage: setCurrentPage, dataHistory: listHistory, active: active, handleModal: handleModal, handleModalGroup: handleModalGroup, handleModalAddUserGroup: handleModalAddUserGroup }),
|
|
76082
|
+
return (jsx(Fragment, { children: jsxs(LexicalComposer, { initialConfig: editorConfig(['@'], '', false, [EmojiNode], mentionItems), children: [jsx(SidebarLeft, { setSearch: setSearch, activeId: active, onTagFilterChange: setTagFilter, onFilterTabChange: setFilterTab, typeChat: typeChat, dataContact: contact, dataProfile: dataProfile, data: [...listHistory]?.sort((a, b) => new Date(b?.createdDate || 0).getTime() - new Date(a?.createdDate || 0).getTime()), sidebar: sidebar, handleSidebar: handleSidebar, userSidebarLeft: userSidebarLeft, handleUserSidebarLeft: handleUserSidebarLeft, joinRoom: joinRoom, leaveRoom: leaveRoom, JoinRoomContact: JoinRoomContact, chatRoomMemberUnreadMessages: chatRoomMemberUnreadMessages, removeChatRoom: removeChatRoom, currentPage: currentPage, setCurrentPage: setCurrentPage, dataHistory: listHistory, active: active, handleModal: handleModal, handleModalGroup: handleModalGroup, handleModalAddUserGroup: handleModalAddUserGroup }), jsx("div", { className: classnames('content-right content-chat', {
|
|
76083
|
+
'content-chat-with-sidebar-right': sidebarRight
|
|
76084
|
+
}), children: jsx("div", { className: "content-wrapper", children: jsxs("div", { className: "content-body", children: [jsx("div", { className: classnames("body-content-overlay", {
|
|
76085
|
+
show: userSidebarRight || sidebar || userSidebarLeft || sidebarRight
|
|
76086
|
+
}), onClick: handleOverlayClick }), jsx(ChatLog, { connectHub: sendMessage, dataHistory: listHistory, dataInfo: dataInfo, dataProfile: dataProfile, handleUser: handleUser, handleSidebar: handleSidebar, handleSidebarRight: handleSidebarRight, userSidebarLeft: userSidebarLeft, handleUserSidebarRight: handleUserSidebarRight, chatGetType: chatGetType, chatGetGroupCreateDate: chatGetGroupCreateDate, approveUpdateStatus: approveUpdateStatus, currentPage: currentPage, setCurrentPage: setCurrentPage, getMessageByGroup: getMessageByGroup, getMessageByContact: getMessageByContact, messageByGroup: messageByGroup, pinMessage: pinMessage, getPinnedMessages: getPinnedMessages,
|
|
76087
|
+
//handleModalAdministrative={handleModalAdministrative}
|
|
76088
|
+
//setDataItem={setDataItem}
|
|
76089
|
+
handleModalAddUserGroup: handleModalAddUserGroup, handleModalGroup: handleModalGroup, typeOpenModalAdd: typeOpenModalAdd, setTypeOpenModalAdd: setTypeOpenModalAdd }), jsx(UserProfileSidebar, { user: user, userSidebarRight: userSidebarRight, handleUserSidebarRight: handleUserSidebarRight })] }) }) }), openModal && jsx(ModalComponent, { dataProfile: dataProfile, openModal: openModal, handleModal: handleModal, windowSize: windowSize }), openModalAddUserGroup && jsx(ModalAddUserGroupComponent, { dataHistory: listHistory, active: active, openModalAddUserGroup: openModalAddUserGroup, handleModalAddUserGroup: handleModalAddUserGroup, windowSize: windowSize }), openModalGroup && jsx(ModalGroupComponent, { dataHistory: listHistory, active: active, openModalGroup: openModalGroup, handleModalGroup: handleModalGroup, windowSize: windowSize, typeOpenModalAdd: typeOpenModalAdd }), openModalGroupInfo && jsx(ModalGroupInfo, { editGroupName: editGroupName, editGroupAvatar: editGroupAvatar, openModalGroupInfo: openModalGroupInfo, handleModalGroupInfo: handleModalGroupInfo, windowSize: windowSize, groupChatUsers: groupChatUsers })] }) }));
|
|
75960
76090
|
};
|
|
75961
76091
|
|
|
75962
76092
|
registerLicense('ORg4AjUWIQA/Gnt2VVhiQlFadVlJXmJWf1FpTGpQdk5yd19DaVZUTX1dQl9hSXlTckVmXHtfcHNVRGM=');
|