@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.js
CHANGED
|
@@ -17,6 +17,8 @@ var esTemplateHelp = require('@esvndev/es-template-help');
|
|
|
17
17
|
var constants = require('@src/domain/constants');
|
|
18
18
|
var isNullOrUndefined$2 = require('@src/utility/hooks/isNullOrUndefined');
|
|
19
19
|
var avatarDefault = require('@core/assets/images/avatars/avatar-blank.png');
|
|
20
|
+
require('@draft-js-plugins/mention/lib/plugin.css');
|
|
21
|
+
require('@draft-js-plugins/emoji/lib/plugin.css');
|
|
20
22
|
var reactRouterDom = require('react-router-dom');
|
|
21
23
|
var reactRedux = require('react-redux');
|
|
22
24
|
|
|
@@ -21518,6 +21520,85 @@ function commonjsRequire (path) {
|
|
|
21518
21520
|
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.');
|
|
21519
21521
|
}
|
|
21520
21522
|
|
|
21523
|
+
var classnames$1 = {exports: {}};
|
|
21524
|
+
|
|
21525
|
+
/*!
|
|
21526
|
+
Copyright (c) 2018 Jed Watson.
|
|
21527
|
+
Licensed under the MIT License (MIT), see
|
|
21528
|
+
http://jedwatson.github.io/classnames
|
|
21529
|
+
*/
|
|
21530
|
+
|
|
21531
|
+
(function (module) {
|
|
21532
|
+
/* global define */
|
|
21533
|
+
|
|
21534
|
+
(function () {
|
|
21535
|
+
|
|
21536
|
+
var hasOwn = {}.hasOwnProperty;
|
|
21537
|
+
|
|
21538
|
+
function classNames () {
|
|
21539
|
+
var classes = '';
|
|
21540
|
+
|
|
21541
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
21542
|
+
var arg = arguments[i];
|
|
21543
|
+
if (arg) {
|
|
21544
|
+
classes = appendClass(classes, parseValue(arg));
|
|
21545
|
+
}
|
|
21546
|
+
}
|
|
21547
|
+
|
|
21548
|
+
return classes;
|
|
21549
|
+
}
|
|
21550
|
+
|
|
21551
|
+
function parseValue (arg) {
|
|
21552
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
21553
|
+
return arg;
|
|
21554
|
+
}
|
|
21555
|
+
|
|
21556
|
+
if (typeof arg !== 'object') {
|
|
21557
|
+
return '';
|
|
21558
|
+
}
|
|
21559
|
+
|
|
21560
|
+
if (Array.isArray(arg)) {
|
|
21561
|
+
return classNames.apply(null, arg);
|
|
21562
|
+
}
|
|
21563
|
+
|
|
21564
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
21565
|
+
return arg.toString();
|
|
21566
|
+
}
|
|
21567
|
+
|
|
21568
|
+
var classes = '';
|
|
21569
|
+
|
|
21570
|
+
for (var key in arg) {
|
|
21571
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
21572
|
+
classes = appendClass(classes, key);
|
|
21573
|
+
}
|
|
21574
|
+
}
|
|
21575
|
+
|
|
21576
|
+
return classes;
|
|
21577
|
+
}
|
|
21578
|
+
|
|
21579
|
+
function appendClass (value, newClass) {
|
|
21580
|
+
if (!newClass) {
|
|
21581
|
+
return value;
|
|
21582
|
+
}
|
|
21583
|
+
|
|
21584
|
+
if (value) {
|
|
21585
|
+
return value + ' ' + newClass;
|
|
21586
|
+
}
|
|
21587
|
+
|
|
21588
|
+
return value + newClass;
|
|
21589
|
+
}
|
|
21590
|
+
|
|
21591
|
+
if (module.exports) {
|
|
21592
|
+
classNames.default = classNames;
|
|
21593
|
+
module.exports = classNames;
|
|
21594
|
+
} else {
|
|
21595
|
+
window.classNames = classNames;
|
|
21596
|
+
}
|
|
21597
|
+
}());
|
|
21598
|
+
}(classnames$1));
|
|
21599
|
+
|
|
21600
|
+
var classnames = classnames$1.exports;
|
|
21601
|
+
|
|
21521
21602
|
var vi = {exports: {}};
|
|
21522
21603
|
|
|
21523
21604
|
var dayjs_min = {exports: {}};
|
|
@@ -29463,85 +29544,6 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
29463
29544
|
|
|
29464
29545
|
var PropTypes = propTypes$s.exports;
|
|
29465
29546
|
|
|
29466
|
-
var classnames$1 = {exports: {}};
|
|
29467
|
-
|
|
29468
|
-
/*!
|
|
29469
|
-
Copyright (c) 2018 Jed Watson.
|
|
29470
|
-
Licensed under the MIT License (MIT), see
|
|
29471
|
-
http://jedwatson.github.io/classnames
|
|
29472
|
-
*/
|
|
29473
|
-
|
|
29474
|
-
(function (module) {
|
|
29475
|
-
/* global define */
|
|
29476
|
-
|
|
29477
|
-
(function () {
|
|
29478
|
-
|
|
29479
|
-
var hasOwn = {}.hasOwnProperty;
|
|
29480
|
-
|
|
29481
|
-
function classNames () {
|
|
29482
|
-
var classes = '';
|
|
29483
|
-
|
|
29484
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
29485
|
-
var arg = arguments[i];
|
|
29486
|
-
if (arg) {
|
|
29487
|
-
classes = appendClass(classes, parseValue(arg));
|
|
29488
|
-
}
|
|
29489
|
-
}
|
|
29490
|
-
|
|
29491
|
-
return classes;
|
|
29492
|
-
}
|
|
29493
|
-
|
|
29494
|
-
function parseValue (arg) {
|
|
29495
|
-
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
29496
|
-
return arg;
|
|
29497
|
-
}
|
|
29498
|
-
|
|
29499
|
-
if (typeof arg !== 'object') {
|
|
29500
|
-
return '';
|
|
29501
|
-
}
|
|
29502
|
-
|
|
29503
|
-
if (Array.isArray(arg)) {
|
|
29504
|
-
return classNames.apply(null, arg);
|
|
29505
|
-
}
|
|
29506
|
-
|
|
29507
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
29508
|
-
return arg.toString();
|
|
29509
|
-
}
|
|
29510
|
-
|
|
29511
|
-
var classes = '';
|
|
29512
|
-
|
|
29513
|
-
for (var key in arg) {
|
|
29514
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
29515
|
-
classes = appendClass(classes, key);
|
|
29516
|
-
}
|
|
29517
|
-
}
|
|
29518
|
-
|
|
29519
|
-
return classes;
|
|
29520
|
-
}
|
|
29521
|
-
|
|
29522
|
-
function appendClass (value, newClass) {
|
|
29523
|
-
if (!newClass) {
|
|
29524
|
-
return value;
|
|
29525
|
-
}
|
|
29526
|
-
|
|
29527
|
-
if (value) {
|
|
29528
|
-
return value + ' ' + newClass;
|
|
29529
|
-
}
|
|
29530
|
-
|
|
29531
|
-
return value + newClass;
|
|
29532
|
-
}
|
|
29533
|
-
|
|
29534
|
-
if (module.exports) {
|
|
29535
|
-
classNames.default = classNames;
|
|
29536
|
-
module.exports = classNames;
|
|
29537
|
-
} else {
|
|
29538
|
-
window.classNames = classNames;
|
|
29539
|
-
}
|
|
29540
|
-
}());
|
|
29541
|
-
}(classnames$1));
|
|
29542
|
-
|
|
29543
|
-
var classnames = classnames$1.exports;
|
|
29544
|
-
|
|
29545
29547
|
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; }
|
|
29546
29548
|
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; }
|
|
29547
29549
|
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; }
|
|
@@ -36703,6 +36705,14 @@ var SvgLogOut = function (_a) {
|
|
|
36703
36705
|
React__namespace.createElement("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9" })));
|
|
36704
36706
|
};
|
|
36705
36707
|
|
|
36708
|
+
var SvgMail = function (_a) {
|
|
36709
|
+
var title = _a.title, titleId = _a.titleId, props = __rest(_a, ["title", "titleId"]);
|
|
36710
|
+
return (React__namespace.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),
|
|
36711
|
+
title ? React__namespace.createElement("title", { id: titleId }, title) : null,
|
|
36712
|
+
React__namespace.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" }),
|
|
36713
|
+
React__namespace.createElement("path", { d: "m22 6-10 7L2 6" })));
|
|
36714
|
+
};
|
|
36715
|
+
|
|
36706
36716
|
var SvgMessageCircle = function (_a) {
|
|
36707
36717
|
var title = _a.title, titleId = _a.titleId, props = __rest(_a, ["title", "titleId"]);
|
|
36708
36718
|
return (React__namespace.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),
|
|
@@ -36710,6 +36720,13 @@ var SvgMessageCircle = function (_a) {
|
|
|
36710
36720
|
React__namespace.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" })));
|
|
36711
36721
|
};
|
|
36712
36722
|
|
|
36723
|
+
var SvgMessageSquare = function (_a) {
|
|
36724
|
+
var title = _a.title, titleId = _a.titleId, props = __rest(_a, ["title", "titleId"]);
|
|
36725
|
+
return (React__namespace.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),
|
|
36726
|
+
title ? React__namespace.createElement("title", { id: titleId }, title) : null,
|
|
36727
|
+
React__namespace.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" })));
|
|
36728
|
+
};
|
|
36729
|
+
|
|
36713
36730
|
var SvgPaperclip = function (_a) {
|
|
36714
36731
|
var title = _a.title, titleId = _a.titleId, props = __rest(_a, ["title", "titleId"]);
|
|
36715
36732
|
return (React__namespace.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),
|
|
@@ -36717,6 +36734,13 @@ var SvgPaperclip = function (_a) {
|
|
|
36717
36734
|
React__namespace.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" })));
|
|
36718
36735
|
};
|
|
36719
36736
|
|
|
36737
|
+
var SvgPhoneCall = function (_a) {
|
|
36738
|
+
var title = _a.title, titleId = _a.titleId, props = __rest(_a, ["title", "titleId"]);
|
|
36739
|
+
return (React__namespace.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),
|
|
36740
|
+
title ? React__namespace.createElement("title", { id: titleId }, title) : null,
|
|
36741
|
+
React__namespace.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" })));
|
|
36742
|
+
};
|
|
36743
|
+
|
|
36720
36744
|
var SvgPlus = function (_a) {
|
|
36721
36745
|
var title = _a.title, titleId = _a.titleId, props = __rest(_a, ["title", "titleId"]);
|
|
36722
36746
|
return (React__namespace.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),
|
|
@@ -71778,6 +71802,30 @@ module.exports = exports['default'];
|
|
|
71778
71802
|
|
|
71779
71803
|
var PerfectScrollbar = /*@__PURE__*/getDefaultExportFromCjs(lib.exports);
|
|
71780
71804
|
|
|
71805
|
+
const UserProfileSidebar = (props) => {
|
|
71806
|
+
// ** Props
|
|
71807
|
+
const { user, handleUserSidebarRight, userSidebarRight } = props;
|
|
71808
|
+
const { t } = reactI18next.useTranslation();
|
|
71809
|
+
const userAvatar = (user && user.avatar) ? user.avatar : DEFAULT_AVATAR;
|
|
71810
|
+
return (jsxRuntime.jsxs("div", { className: classnames('user-profile-sidebar', { show: userSidebarRight === true }), children: [jsxRuntime.jsxs("header", { className: 'user-profile-header', children: [jsxRuntime.jsx("span", { className: 'close-icon', onClick: handleUserSidebarRight, children: jsxRuntime.jsx(SvgX, { fontSize: 14 }) }), jsxRuntime.jsxs("div", { className: 'header-profile-sidebar', children: [jsxRuntime.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' }), jsxRuntime.jsx("h4", { className: 'chat-user-name', children: user.name }), jsxRuntime.jsx("span", { className: 'user-post', children: user.code })] })] }), jsxRuntime.jsx(PerfectScrollbar, { className: 'user-profile-sidebar-area', options: { wheelPropagation: false }, children: jsxRuntime.jsxs("div", { className: 'personal-info', children: [jsxRuntime.jsx("h6", { className: 'section-label mb-1 mt-3', children: t('Personal Information') }), jsxRuntime.jsxs("ul", { className: 'list-unstyled', children: [jsxRuntime.jsxs("li", { className: 'mb-1', children: [jsxRuntime.jsx(SvgMail, { className: 'me-75', fontSize: 17 }), jsxRuntime.jsx("span", { className: 'align-middle', children: user?.email })] }), jsxRuntime.jsxs("li", { className: 'mb-1', children: [jsxRuntime.jsx(SvgPhoneCall, { className: 'me-50', fontSize: 17 }), jsxRuntime.jsx("span", { className: 'align-middle', children: user?.phone })] })] })] }) })] }));
|
|
71811
|
+
};
|
|
71812
|
+
|
|
71813
|
+
const DateHeader = React.memo(({ label }) => (jsxRuntime.jsx("div", { className: "d-flex justify-content-center", children: jsxRuntime.jsx("div", { style: {
|
|
71814
|
+
backgroundColor: "rgba(0,0,0,0.2)",
|
|
71815
|
+
padding: "2px 15px",
|
|
71816
|
+
borderRadius: "6px"
|
|
71817
|
+
}, children: jsxRuntime.jsx("p", { className: "m-0", style: { textAlign: "center", color: "#fff" }, children: label }) }) })));
|
|
71818
|
+
DateHeader.displayName = 'DateHeader';
|
|
71819
|
+
const ChatLog = (props) => {
|
|
71820
|
+
// ** Props & Store
|
|
71821
|
+
// const clipboard = useClipboard()
|
|
71822
|
+
const { contactId, chatRoomId } = useChat();
|
|
71823
|
+
const containerChatRef = React.useRef(null);
|
|
71824
|
+
return (jsxRuntime.jsx("div", { id: "chat-app-window", className: "chat-app-window", ref: containerChatRef, children: jsxRuntime.jsxs("div", { className: classnames("start-chat-area", {
|
|
71825
|
+
"d-none": contactId || chatRoomId
|
|
71826
|
+
}), children: [jsxRuntime.jsx("div", { className: "start-chat-icon mb-1", children: jsxRuntime.jsx(SvgMessageSquare, {}) }), jsxRuntime.jsx("h4", { className: "sidebar-toggle start-chat-text", children: "B\u1EAFt \u0111\u1EA7u tr\u00F2 chuy\u1EC7n" })] }) }));
|
|
71827
|
+
};
|
|
71828
|
+
|
|
71781
71829
|
var __extends$4 = (undefined && undefined.__extends) || (function () {
|
|
71782
71830
|
var extendStatics = function (d, b) {
|
|
71783
71831
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -75813,14 +75861,16 @@ const AppChat = () => {
|
|
|
75813
75861
|
return { innerWidth, innerHeight };
|
|
75814
75862
|
};
|
|
75815
75863
|
// ** States
|
|
75816
|
-
React.useState({});
|
|
75864
|
+
const [user, setUser] = React.useState({});
|
|
75817
75865
|
const [sidebar, setSidebar] = React.useState(false);
|
|
75818
|
-
React.useState(false);
|
|
75819
|
-
React.useState(false);
|
|
75866
|
+
const [sidebarRight, setSidebarRight] = React.useState(false);
|
|
75867
|
+
const [userSidebarRight, setUserSidebarRight] = React.useState(false);
|
|
75820
75868
|
const [userSidebarLeft, setUserSidebarLeft] = React.useState(false);
|
|
75821
75869
|
const [dataProfile, setDataProfile] = React.useState({});
|
|
75822
75870
|
const handleSidebar = () => setSidebar(!sidebar);
|
|
75871
|
+
const handleSidebarRight = () => setSidebarRight(!sidebarRight);
|
|
75823
75872
|
const handleUserSidebarLeft = () => setUserSidebarLeft(!userSidebarLeft);
|
|
75873
|
+
const handleUserSidebarRight = () => setUserSidebarRight(!userSidebarRight);
|
|
75824
75874
|
const [openModal, setOpenModal] = React.useState(false);
|
|
75825
75875
|
const [typeOpenModalAdd, setTypeOpenModalAdd] = React.useState(false);
|
|
75826
75876
|
const [tagFilter, setTagFilter] = React.useState('');
|
|
@@ -75830,14 +75880,22 @@ const AppChat = () => {
|
|
|
75830
75880
|
const [openModalGroup, setOpenModalGroup] = React.useState(false);
|
|
75831
75881
|
const [windowSize, setWindowSize] = React.useState(getWindowSize());
|
|
75832
75882
|
const [dataInfo, setDataInfo] = React.useState({});
|
|
75833
|
-
|
|
75883
|
+
React.useState({});
|
|
75834
75884
|
const [search, setSearch] = React.useState('');
|
|
75835
75885
|
const [currentPage, setCurrentPage] = React.useState(1);
|
|
75836
75886
|
const [contact, setContact] = React.useState([]);
|
|
75887
|
+
// ** Set user function for Right Sidebar
|
|
75888
|
+
const handleUser = (obj) => setUser(obj);
|
|
75837
75889
|
const handleModal = () => setOpenModal(!openModal);
|
|
75838
75890
|
const handleModalGroup = () => setOpenModalGroup(!openModalGroup);
|
|
75839
75891
|
const handleModalAddUserGroup = () => setOpenModalAddUserGroup(!openModalAddUserGroup);
|
|
75840
75892
|
const handleModalGroupInfo = () => setOpenModalGroupInfo(!openModalGroupInfo);
|
|
75893
|
+
const handleOverlayClick = () => {
|
|
75894
|
+
setSidebar(false);
|
|
75895
|
+
setUserSidebarRight(false);
|
|
75896
|
+
setUserSidebarLeft(false);
|
|
75897
|
+
setSidebarRight(false);
|
|
75898
|
+
};
|
|
75841
75899
|
React.useEffect(() => {
|
|
75842
75900
|
if (typeChat !== 'CONTACT') {
|
|
75843
75901
|
getData();
|
|
@@ -75876,7 +75934,7 @@ const AppChat = () => {
|
|
|
75876
75934
|
order: '',
|
|
75877
75935
|
pageNumber: 1,
|
|
75878
75936
|
pageSize: 20,
|
|
75879
|
-
tag: tagFilter
|
|
75937
|
+
tag: tagFilter
|
|
75880
75938
|
};
|
|
75881
75939
|
getHistoryApi(paging);
|
|
75882
75940
|
};
|
|
@@ -75893,6 +75951,23 @@ const AppChat = () => {
|
|
|
75893
75951
|
.then((rs) => setDataInfo(rs))
|
|
75894
75952
|
.catch((ex) => console.log(ex));
|
|
75895
75953
|
};
|
|
75954
|
+
const getMessageByGroup = async (param, pageNumber) => {
|
|
75955
|
+
if (chatRoomId === param) {
|
|
75956
|
+
const paging = {
|
|
75957
|
+
keyword: '',
|
|
75958
|
+
filter: '',
|
|
75959
|
+
order: 'createdDate;asc',
|
|
75960
|
+
pageNumber,
|
|
75961
|
+
pageSize: 25
|
|
75962
|
+
};
|
|
75963
|
+
try {
|
|
75964
|
+
await connection.invoke('GetMessageByGroupHistory', chatRoomId, paging);
|
|
75965
|
+
}
|
|
75966
|
+
catch (e) {
|
|
75967
|
+
console.error(e);
|
|
75968
|
+
}
|
|
75969
|
+
}
|
|
75970
|
+
};
|
|
75896
75971
|
const getMessageByContact = async (param, pageNumber) => {
|
|
75897
75972
|
const paging = {
|
|
75898
75973
|
keyword: '',
|
|
@@ -75920,6 +75995,14 @@ const AppChat = () => {
|
|
|
75920
75995
|
.then((rs) => setContact(rs.items))
|
|
75921
75996
|
.catch((ex) => console.log(ex));
|
|
75922
75997
|
};
|
|
75998
|
+
const sendMessage = async (id, message) => {
|
|
75999
|
+
try {
|
|
76000
|
+
await connection.invoke("SendMessage", id, message);
|
|
76001
|
+
}
|
|
76002
|
+
catch (e) {
|
|
76003
|
+
console.error(e);
|
|
76004
|
+
}
|
|
76005
|
+
};
|
|
75923
76006
|
const joinRoom = async (id) => {
|
|
75924
76007
|
try {
|
|
75925
76008
|
await connection.invoke("JoinRoom", id);
|
|
@@ -75952,6 +76035,22 @@ const AppChat = () => {
|
|
|
75952
76035
|
console.error(e);
|
|
75953
76036
|
}
|
|
75954
76037
|
};
|
|
76038
|
+
const chatGetType = async (chatRoomId, userId, keyword, type, startDate, endDate, pageNumber, pageSize) => {
|
|
76039
|
+
try {
|
|
76040
|
+
await connection.invoke("ChatGetType", chatRoomId, userId, keyword, type, startDate, endDate, pageNumber, pageSize);
|
|
76041
|
+
}
|
|
76042
|
+
catch (e) {
|
|
76043
|
+
console.error(e);
|
|
76044
|
+
}
|
|
76045
|
+
};
|
|
76046
|
+
const chatGetGroupCreateDate = async (chatRoomId, userId, keyword, type, startDate, endDate, pageNumber, pageSize) => {
|
|
76047
|
+
try {
|
|
76048
|
+
await connection.invoke("ChatGetGroupCreateDate", chatRoomId, userId, keyword, type, startDate, endDate, pageNumber, pageSize);
|
|
76049
|
+
}
|
|
76050
|
+
catch (e) {
|
|
76051
|
+
console.error(e);
|
|
76052
|
+
}
|
|
76053
|
+
};
|
|
75955
76054
|
const removeChatRoom = async (chatRoomId) => {
|
|
75956
76055
|
try {
|
|
75957
76056
|
await connection.invoke("RemoveChatRoom", chatRoomId);
|
|
@@ -75960,6 +76059,14 @@ const AppChat = () => {
|
|
|
75960
76059
|
console.error(e);
|
|
75961
76060
|
}
|
|
75962
76061
|
};
|
|
76062
|
+
const approveUpdateStatus = async (id, chatRoomId, status) => {
|
|
76063
|
+
try {
|
|
76064
|
+
await connection.invoke("ApproveUpdateStatus", id, chatRoomId, status);
|
|
76065
|
+
}
|
|
76066
|
+
catch (e) {
|
|
76067
|
+
console.error(e);
|
|
76068
|
+
}
|
|
76069
|
+
};
|
|
75963
76070
|
const editGroupName = async (chatRoomId, chatRoomName) => {
|
|
75964
76071
|
try {
|
|
75965
76072
|
await connection.invoke("EditGroupName", chatRoomId, chatRoomName);
|
|
@@ -75968,6 +76075,22 @@ const AppChat = () => {
|
|
|
75968
76075
|
console.error(e);
|
|
75969
76076
|
}
|
|
75970
76077
|
};
|
|
76078
|
+
const pinMessage = async (chatRoomId, messageId) => {
|
|
76079
|
+
try {
|
|
76080
|
+
await connection.invoke("PinMessage", chatRoomId, messageId);
|
|
76081
|
+
}
|
|
76082
|
+
catch (e) {
|
|
76083
|
+
console.error(e);
|
|
76084
|
+
}
|
|
76085
|
+
};
|
|
76086
|
+
const getPinnedMessages = async (chatRoomId) => {
|
|
76087
|
+
try {
|
|
76088
|
+
await connection.invoke("GetPinnedMessages", chatRoomId);
|
|
76089
|
+
}
|
|
76090
|
+
catch (e) {
|
|
76091
|
+
console.error(e);
|
|
76092
|
+
}
|
|
76093
|
+
};
|
|
75971
76094
|
const editGroupAvatar = async (chatRoomId, chatRoomAvatar) => {
|
|
75972
76095
|
try {
|
|
75973
76096
|
await connection.invoke("EditGroupAvatar", chatRoomId, chatRoomAvatar);
|
|
@@ -75985,7 +76108,14 @@ const AppChat = () => {
|
|
|
75985
76108
|
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"));
|
|
75986
76109
|
setCulture(lang); // Change the Grid culture
|
|
75987
76110
|
}, [lang]);
|
|
75988
|
-
return (jsxRuntime.jsx(React.Fragment, { children: jsxRuntime.jsxs(LexicalComposer, { initialConfig: editorConfig(['@'], '', false, [EmojiNode], mentionItems), children: [jsxRuntime.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 }),
|
|
76111
|
+
return (jsxRuntime.jsx(React.Fragment, { children: jsxRuntime.jsxs(LexicalComposer, { initialConfig: editorConfig(['@'], '', false, [EmojiNode], mentionItems), children: [jsxRuntime.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 }), jsxRuntime.jsx("div", { className: classnames('content-right content-chat', {
|
|
76112
|
+
'content-chat-with-sidebar-right': sidebarRight
|
|
76113
|
+
}), children: jsxRuntime.jsx("div", { className: "content-wrapper", children: jsxRuntime.jsxs("div", { className: "content-body", children: [jsxRuntime.jsx("div", { className: classnames("body-content-overlay", {
|
|
76114
|
+
show: userSidebarRight || sidebar || userSidebarLeft || sidebarRight
|
|
76115
|
+
}), onClick: handleOverlayClick }), jsxRuntime.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,
|
|
76116
|
+
//handleModalAdministrative={handleModalAdministrative}
|
|
76117
|
+
//setDataItem={setDataItem}
|
|
76118
|
+
handleModalAddUserGroup: handleModalAddUserGroup, handleModalGroup: handleModalGroup, typeOpenModalAdd: typeOpenModalAdd, setTypeOpenModalAdd: setTypeOpenModalAdd }), jsxRuntime.jsx(UserProfileSidebar, { user: user, userSidebarRight: userSidebarRight, handleUserSidebarRight: handleUserSidebarRight })] }) }) }), openModal && jsxRuntime.jsx(ModalComponent, { dataProfile: dataProfile, openModal: openModal, handleModal: handleModal, windowSize: windowSize }), openModalAddUserGroup && jsxRuntime.jsx(ModalAddUserGroupComponent, { dataHistory: listHistory, active: active, openModalAddUserGroup: openModalAddUserGroup, handleModalAddUserGroup: handleModalAddUserGroup, windowSize: windowSize }), openModalGroup && jsxRuntime.jsx(ModalGroupComponent, { dataHistory: listHistory, active: active, openModalGroup: openModalGroup, handleModalGroup: handleModalGroup, windowSize: windowSize, typeOpenModalAdd: typeOpenModalAdd }), openModalGroupInfo && jsxRuntime.jsx(ModalGroupInfo, { editGroupName: editGroupName, editGroupAvatar: editGroupAvatar, openModalGroupInfo: openModalGroupInfo, handleModalGroupInfo: handleModalGroupInfo, windowSize: windowSize, groupChatUsers: groupChatUsers })] }) }));
|
|
75989
76119
|
};
|
|
75990
76120
|
|
|
75991
76121
|
registerLicense('ORg4AjUWIQA/Gnt2VVhiQlFadVlJXmJWf1FpTGpQdk5yd19DaVZUTX1dQl9hSXlTckVmXHtfcHNVRGM=');
|