contentoh-components-library 21.3.14 → 21.3.16
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/.env.development +0 -5
- package/dist/assets/fonts/{Roboto → roboto}/LICENSE.txt +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Black.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-BlackItalic.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Bold.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-BoldItalic.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Italic.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Light.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-LightItalic.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Medium.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-MediumItalic.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Regular.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Thin.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-ThinItalic.ttf +0 -0
- package/dist/assets/images/generalButton/closeIcon.svg +2 -2
- package/dist/components/atoms/ProgressBar/index.js +6 -36
- package/dist/components/atoms/ProgressBar/styles.js +3 -11
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +22 -21
- package/dist/components/molecules/CustomSelect/SelectItem.js +1 -10
- package/dist/components/molecules/HeaderTop/index.js +6 -23
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/molecules/ProductNameHeader/index.js +4 -6
- package/dist/components/organisms/FullProductNameHeader/index.js +0 -1
- package/dist/components/organisms/RangeCalendar/index.js +3 -4
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +50 -65
- package/dist/components/pages/ProviderProductEdition/index.js +11 -15
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +86 -60
- package/dist/components/pages/RetailerProductEdition/index.js +72 -65
- package/dist/global-files/fonts.css +0 -6
- package/dist/global-files/utils.js +2 -22
- package/dist/global-files/variables.js +0 -2
- package/dist/index.js +46 -267
- package/package.json +1 -12
- package/src/assets/images/generalButton/closeIcon.svg +2 -2
- package/src/components/atoms/ProgressBar/index.js +5 -40
- package/src/components/atoms/ProgressBar/styles.js +0 -24
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +12 -20
- package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
- package/src/components/molecules/HeaderTop/index.js +8 -29
- package/src/components/molecules/HeaderTop/styles.js +0 -4
- package/src/components/molecules/ProductNameHeader/index.js +2 -7
- package/src/components/organisms/FullProductNameHeader/index.js +0 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +49 -67
- package/src/components/pages/ProviderProductEdition/index.js +7 -16
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +85 -62
- package/src/components/pages/RetailerProductEdition/index.js +18 -18
- package/src/global-files/fonts.css +0 -6
- package/src/global-files/variables.js +0 -2
- package/src/index.js +0 -17
- package/dist/assets/images/chatPopup/Spinner.gif +0 -0
- package/dist/assets/images/chatPopup/close.svg +0 -3
- package/dist/assets/images/chatPopup/defaultImage.png +0 -0
- package/dist/assets/images/chatPopup/defaultProfile.png +0 -0
- package/dist/assets/images/chatPopup/doc.svg +0 -1
- package/dist/assets/images/chatPopup/document.svg +0 -1
- package/dist/assets/images/chatPopup/iconChat.svg +0 -19
- package/dist/assets/images/chatPopup/iconPlus.svg +0 -3
- package/dist/assets/images/chatPopup/pdf.svg +0 -75
- package/dist/assets/images/chatPopup/remove.svg +0 -4
- package/dist/assets/images/chatPopup/send.svg +0 -3
- package/dist/assets/images/chatPopup/svgIcon.svg +0 -109
- package/dist/assets/images/chatPopup/upload_file.svg +0 -3
- package/dist/assets/images/chatPopup/xls.svg +0 -53
- package/dist/components/atoms/ChatPopUp/ChatPopUp.stories.js +0 -28
- package/dist/components/atoms/ChatPopUp/index.js +0 -841
- package/dist/components/atoms/ChatPopUp/styles.js +0 -27
- package/dist/components/atoms/ChatPopUp/utils/handlersChat.js +0 -182
- package/dist/components/atoms/StatusTag/StatusTag.stories.js +0 -48
- package/dist/components/atoms/StatusTag/index.js +0 -58
- package/dist/components/atoms/StatusTag/styles.js +0 -20
- package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +0 -37
- package/dist/components/pages/RegistrationLoginFirstStep/index.js +0 -269
- package/dist/components/pages/RegistrationLoginFirstStep/styles.js +0 -20
- package/src/assets/images/customSelect/starIcon.svg +0 -14
- package/src/assets/images/defaultImages/Spinner.gif +0 -0
- package/src/assets/images/defaultImages/notFound.svg +0 -124
- package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -47
- package/src/components/atoms/ButtonFileChooser/index.js +0 -68
- package/src/components/atoms/ButtonFileChooser/styles.js +0 -4
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -53
- package/src/components/atoms/ButtonV2/index.js +0 -85
- package/src/components/atoms/ButtonV2/styles.js +0 -217
- package/src/components/atoms/CustomIcon/CustomIcon.stories.js +0 -36
- package/src/components/atoms/CustomIcon/index.js +0 -41
- package/src/components/atoms/CustomIcon/styles.js +0 -85
- package/src/components/atoms/IconFile/IconFile.stories.js +0 -35
- package/src/components/atoms/IconFile/index.js +0 -119
- package/src/components/atoms/IconFile/styles.js +0 -67
- package/src/components/atoms/Image/Image.stories.js +0 -51
- package/src/components/atoms/Image/index.js +0 -55
- package/src/components/atoms/Image/styles.js +0 -34
- package/src/components/atoms/ImageLink/ImageLink.stories.js +0 -43
- package/src/components/atoms/ImageLink/index.js +0 -57
- package/src/components/atoms/ImageLink/styles.js +0 -30
- package/src/components/atoms/ImagePreview/ImagePreview.stories.js +0 -52
- package/src/components/atoms/ImagePreview/index.js +0 -178
- package/src/components/atoms/ImagePreview/styles.js +0 -77
- package/src/components/atoms/InputText/InputText.stories.js +0 -39
- package/src/components/atoms/InputText/index.js +0 -61
- package/src/components/atoms/InputText/styles.js +0 -89
- package/src/components/atoms/NotFound/NotFound.stories.js +0 -19
- package/src/components/atoms/NotFound/index.js +0 -52
- package/src/components/atoms/NotFound/styles.js +0 -55
- package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -26
- package/src/components/atoms/SelectItemV2/index.js +0 -61
- package/src/components/atoms/SelectItemV2/styles.js +0 -90
- package/src/components/atoms/Tooltip/Tooltip.stories.js +0 -51
- package/src/components/atoms/Tooltip/index.js +0 -59
- package/src/components/atoms/Tooltip/styles.js +0 -42
- package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -54
- package/src/components/molecules/ButtonDownloadFile/index.js +0 -109
- package/src/components/molecules/ButtonDownloadFile/styles.js +0 -66
- package/src/components/molecules/Dropdown/Dropdown.stories.js +0 -103
- package/src/components/molecules/Dropdown/index.js +0 -150
- package/src/components/molecules/Dropdown/styles.js +0 -75
- package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -68
- package/src/components/molecules/ImageTooltip/index.js +0 -63
- package/src/components/molecules/ImageTooltip/styles.js +0 -18
- package/src/components/molecules/SelectV2/SelectV2.stories.js +0 -115
- package/src/components/molecules/SelectV2/index.js +0 -357
- package/src/components/molecules/SelectV2/styles.js +0 -105
- package/src/components/molecules/SelectV2/test.js +0 -61
- package/src/components/molecules/SelectV2/test.stories.js +0 -10
- package/src/components/organisms/Chat/Chat.stories.js +0 -147
- package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -65
- package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
- package/src/components/organisms/Chat/ChatLists/index.js +0 -141
- package/src/components/organisms/Chat/ChatLists/styles.js +0 -162
- package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -142
- package/src/components/organisms/Chat/ContainerItems/index.js +0 -512
- package/src/components/organisms/Chat/ContainerItems/styles.js +0 -328
- package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -102
- package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
- package/src/components/organisms/Chat/ContentChat/index.js +0 -897
- package/src/components/organisms/Chat/ContentChat/styles.js +0 -41
- package/src/components/organisms/Chat/Footer/Footer.stories.js +0 -22
- package/src/components/organisms/Chat/Footer/index.js +0 -661
- package/src/components/organisms/Chat/Footer/styles.js +0 -286
- package/src/components/organisms/Chat/Header/Header.stories.js +0 -66
- package/src/components/organisms/Chat/Header/index.js +0 -94
- package/src/components/organisms/Chat/Header/styles.js +0 -49
- package/src/components/organisms/Chat/index.js +0 -235
- package/src/components/organisms/Chat/styles.js +0 -42
- package/src/components/organisms/Modal/Modal.stories.js +0 -55
- package/src/components/organisms/Modal/index.js +0 -97
- package/src/components/organisms/Modal/styles.js +0 -103
- package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +0 -16
- package/src/components/organisms/RangeCalendar/index.js +0 -121
- package/src/components/organisms/RangeCalendar/styles.js +0 -883
- package/src/global-files/handle_http.js +0 -225
- package/src/global-files/handle_userTech.js +0 -7
- package/src/global-files/utils.js +0 -330
|
@@ -1,841 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.ChatPopUp = void 0;
|
|
9
|
-
|
|
10
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
|
-
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createForOfIteratorHelper"));
|
|
13
|
-
|
|
14
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
15
|
-
|
|
16
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
17
|
-
|
|
18
|
-
var _styles = require("./styles");
|
|
19
|
-
|
|
20
|
-
var _react = require("react");
|
|
21
|
-
|
|
22
|
-
var _iconChat = _interopRequireDefault(require("../../../assets/images/chatPopup/iconChat.svg"));
|
|
23
|
-
|
|
24
|
-
var _close = _interopRequireDefault(require("../../../assets/images/chatPopup/close.svg"));
|
|
25
|
-
|
|
26
|
-
var _send = _interopRequireDefault(require("../../../assets/images/chatPopup/send.svg"));
|
|
27
|
-
|
|
28
|
-
var _iconPlus = _interopRequireDefault(require("../../../assets/images/chatPopup/iconPlus.svg"));
|
|
29
|
-
|
|
30
|
-
var _upload_file = _interopRequireDefault(require("../../../assets/images/chatPopup/upload_file.svg"));
|
|
31
|
-
|
|
32
|
-
var _defaultProfile = _interopRequireDefault(require("../../../assets/images/chatPopup/defaultProfile.png"));
|
|
33
|
-
|
|
34
|
-
var _defaultImage = _interopRequireDefault(require("../../../assets/images/chatPopup/defaultImage.png"));
|
|
35
|
-
|
|
36
|
-
var _Spinner = _interopRequireDefault(require("../../../assets/images/chatPopup/Spinner.gif"));
|
|
37
|
-
|
|
38
|
-
var _doc = _interopRequireDefault(require("../../../assets/images/chatPopup/doc.svg"));
|
|
39
|
-
|
|
40
|
-
var _xls = _interopRequireDefault(require("../../../assets/images/chatPopup/xls.svg"));
|
|
41
|
-
|
|
42
|
-
var _document = _interopRequireDefault(require("../../../assets/images/chatPopup/document.svg"));
|
|
43
|
-
|
|
44
|
-
var _svgIcon = _interopRequireDefault(require("../../../assets/images/chatPopup/svgIcon.svg"));
|
|
45
|
-
|
|
46
|
-
var _moment = _interopRequireDefault(require("moment"));
|
|
47
|
-
|
|
48
|
-
var _awsSdk = _interopRequireDefault(require("aws-sdk"));
|
|
49
|
-
|
|
50
|
-
var _reactImageFallback = _interopRequireDefault(require("react-image-fallback"));
|
|
51
|
-
|
|
52
|
-
var _uuid = require("uuid");
|
|
53
|
-
|
|
54
|
-
var _handlersChat = require("./utils/handlersChat");
|
|
55
|
-
|
|
56
|
-
var _data = require("../../../global-files/data");
|
|
57
|
-
|
|
58
|
-
var _Tooltip = require("../Tooltip");
|
|
59
|
-
|
|
60
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
61
|
-
|
|
62
|
-
var S3_BUCKET = process.env.REACT_APP_IMAGES_BUCKET;
|
|
63
|
-
var REGION = "us-east-1";
|
|
64
|
-
|
|
65
|
-
var Buffer = require("buffer/").Buffer;
|
|
66
|
-
|
|
67
|
-
_awsSdk.default.config.update({
|
|
68
|
-
accessKeyId: process.env.REACT_APP_KEY_UPLOAD_TO_S3,
|
|
69
|
-
secretAccessKey: process.env.REACT_APP_ACCESS_KEY_UPLOAD_TO_S3
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
var myBucket = new _awsSdk.default.S3({
|
|
73
|
-
params: {
|
|
74
|
-
Bucket: S3_BUCKET
|
|
75
|
-
},
|
|
76
|
-
region: REGION
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
var ChatPopUp = function ChatPopUp(_ref) {
|
|
80
|
-
var props = _ref.props;
|
|
81
|
-
|
|
82
|
-
var _useState = (0, _react.useState)(false),
|
|
83
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
84
|
-
showMenu = _useState2[0],
|
|
85
|
-
setShowMenu = _useState2[1];
|
|
86
|
-
|
|
87
|
-
var _useState3 = (0, _react.useState)(),
|
|
88
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
89
|
-
items = _useState4[0],
|
|
90
|
-
setItems = _useState4[1]; // items que vienen de la BD
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
var _useState5 = (0, _react.useState)([]),
|
|
94
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
95
|
-
customItems = _useState6[0],
|
|
96
|
-
setCustomItems = _useState6[1]; // JSX acorde al tipo de los items
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
var _useState7 = (0, _react.useState)(0),
|
|
100
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
101
|
-
current_id_company = _useState8[0],
|
|
102
|
-
setCurrent_id_company = _useState8[1];
|
|
103
|
-
|
|
104
|
-
var _useState9 = (0, _react.useState)(""),
|
|
105
|
-
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
106
|
-
valueInput = _useState10[0],
|
|
107
|
-
setValueInput = _useState10[1];
|
|
108
|
-
|
|
109
|
-
var _useState11 = (0, _react.useState)(),
|
|
110
|
-
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
111
|
-
processUpdateID = _useState12[0],
|
|
112
|
-
setProcessUpdateID = _useState12[1];
|
|
113
|
-
|
|
114
|
-
var _useState13 = (0, _react.useState)(0),
|
|
115
|
-
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
116
|
-
countUpdate = _useState14[0],
|
|
117
|
-
setCountUpdate = _useState14[1];
|
|
118
|
-
|
|
119
|
-
var arrayIMG = {
|
|
120
|
-
data: {
|
|
121
|
-
ext: [],
|
|
122
|
-
nameFile: []
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
var Authorization = props.chat_authorization;
|
|
126
|
-
var prop_id_article = props.chat_id_article;
|
|
127
|
-
var prop_version_article = props.chat_version_article;
|
|
128
|
-
(0, _react.useEffect)(function () {
|
|
129
|
-
//setItems([])
|
|
130
|
-
getInitial();
|
|
131
|
-
}, []);
|
|
132
|
-
(0, _react.useEffect)(function () {
|
|
133
|
-
if (!items) return;
|
|
134
|
-
renderItems(); //console.log("update en 10s");
|
|
135
|
-
//const processUpdate = setTimeout( () => {
|
|
136
|
-
// setCountUpdate( (prev) => prev+1 )
|
|
137
|
-
//} , 25000 )
|
|
138
|
-
//setProcessUpdateID(processUpdate);
|
|
139
|
-
}, [items]); // implementar update cada 30s
|
|
140
|
-
|
|
141
|
-
(0, _react.useEffect)(function () {
|
|
142
|
-
if (countUpdate == 0) return;
|
|
143
|
-
getUpdate();
|
|
144
|
-
}, [countUpdate]);
|
|
145
|
-
|
|
146
|
-
var renderItems = /*#__PURE__*/function () {
|
|
147
|
-
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
148
|
-
var jsxItems, date, countDate, _iterator, _step, item, newDate;
|
|
149
|
-
|
|
150
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
151
|
-
while (1) {
|
|
152
|
-
switch (_context.prev = _context.next) {
|
|
153
|
-
case 0:
|
|
154
|
-
jsxItems = [];
|
|
155
|
-
date = undefined;
|
|
156
|
-
countDate = 1;
|
|
157
|
-
_iterator = (0, _createForOfIteratorHelper2.default)(items);
|
|
158
|
-
|
|
159
|
-
try {
|
|
160
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
161
|
-
item = _step.value;
|
|
162
|
-
|
|
163
|
-
if (!date) {
|
|
164
|
-
date = getFullDate(new Date(item.creation_date));
|
|
165
|
-
} else {
|
|
166
|
-
newDate = getFullDate(new Date(item.creation_date));
|
|
167
|
-
|
|
168
|
-
if (newDate != date) {
|
|
169
|
-
jsxItems.push( /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
170
|
-
className: "group-date",
|
|
171
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("hr", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
172
|
-
children: date
|
|
173
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("hr", {})]
|
|
174
|
-
}, "itemDate-" + countDate++));
|
|
175
|
-
date = newDate;
|
|
176
|
-
}
|
|
177
|
-
} // manejo de los tipos items
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
if (item.user.id_company == current_id_company) {
|
|
181
|
-
jsxItems.push( /*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
|
|
182
|
-
className: "own-message",
|
|
183
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.CustomTooltip, {
|
|
184
|
-
className: "tooltip-userName",
|
|
185
|
-
componentTooltip: /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
186
|
-
children: item.user.name
|
|
187
|
-
}),
|
|
188
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
189
|
-
className: "profile",
|
|
190
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactImageFallback.default, {
|
|
191
|
-
src: (0, _data.getProfilePicture)(item.user.id, 24, 24),
|
|
192
|
-
fallbackImage: _defaultProfile.default,
|
|
193
|
-
initialImage: _Spinner.default,
|
|
194
|
-
alt: "profile"
|
|
195
|
-
})
|
|
196
|
-
})
|
|
197
|
-
}), item.value_type == "txt" ? renderTXT(item) : item.value_type == "img" ? renderIMG(item) : renderFILE(item), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
198
|
-
className: "date",
|
|
199
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
200
|
-
children: getTime(item.creation_date)
|
|
201
|
-
})
|
|
202
|
-
})]
|
|
203
|
-
}, "item-" + item.id));
|
|
204
|
-
} else {
|
|
205
|
-
jsxItems.push( /*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
|
|
206
|
-
className: "",
|
|
207
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.CustomTooltip, {
|
|
208
|
-
className: "tooltip-userName",
|
|
209
|
-
componentTooltip: /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
210
|
-
children: item.user.name
|
|
211
|
-
}),
|
|
212
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
213
|
-
className: "profile",
|
|
214
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactImageFallback.default, {
|
|
215
|
-
src: (0, _data.getProfilePicture)(item.user.id, 24, 24),
|
|
216
|
-
fallbackImage: _defaultProfile.default,
|
|
217
|
-
initialImage: _Spinner.default,
|
|
218
|
-
alt: "profile"
|
|
219
|
-
})
|
|
220
|
-
})
|
|
221
|
-
}), item.value_type == "txt" ? renderTXT(item) : item.value_type == "img" ? renderIMG(item) : renderFILE(item), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
222
|
-
className: "date",
|
|
223
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
224
|
-
children: getTime(item.creation_date)
|
|
225
|
-
})
|
|
226
|
-
})]
|
|
227
|
-
}, "item-" + item.id));
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
} catch (err) {
|
|
231
|
-
_iterator.e(err);
|
|
232
|
-
} finally {
|
|
233
|
-
_iterator.f();
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
if (date) {
|
|
237
|
-
jsxItems.push( /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
238
|
-
className: "group-date",
|
|
239
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("hr", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
240
|
-
children: date
|
|
241
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("hr", {})]
|
|
242
|
-
}, "itemDate-" + countDate++));
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
setCustomItems(jsxItems);
|
|
246
|
-
|
|
247
|
-
case 7:
|
|
248
|
-
case "end":
|
|
249
|
-
return _context.stop();
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}, _callee);
|
|
253
|
-
}));
|
|
254
|
-
|
|
255
|
-
return function renderItems() {
|
|
256
|
-
return _ref2.apply(this, arguments);
|
|
257
|
-
};
|
|
258
|
-
}();
|
|
259
|
-
|
|
260
|
-
var getBase64 = /*#__PURE__*/function () {
|
|
261
|
-
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(file) {
|
|
262
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
263
|
-
while (1) {
|
|
264
|
-
switch (_context2.prev = _context2.next) {
|
|
265
|
-
case 0:
|
|
266
|
-
return _context2.abrupt("return", new Promise(function (resolve) {
|
|
267
|
-
var reader = new FileReader();
|
|
268
|
-
reader.addEventListener("loadend", function () {
|
|
269
|
-
var base64 = reader.result.replace(/^data:\w+\/\w+.*;base64,/, "");
|
|
270
|
-
resolve(base64);
|
|
271
|
-
});
|
|
272
|
-
reader.readAsDataURL(file);
|
|
273
|
-
}));
|
|
274
|
-
|
|
275
|
-
case 1:
|
|
276
|
-
case "end":
|
|
277
|
-
return _context2.stop();
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}, _callee2);
|
|
281
|
-
}));
|
|
282
|
-
|
|
283
|
-
return function getBase64(_x) {
|
|
284
|
-
return _ref3.apply(this, arguments);
|
|
285
|
-
};
|
|
286
|
-
}();
|
|
287
|
-
|
|
288
|
-
var createPreview = /*#__PURE__*/function () {
|
|
289
|
-
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(file) {
|
|
290
|
-
var base64IMG, ext, fileB, params;
|
|
291
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
292
|
-
while (1) {
|
|
293
|
-
switch (_context3.prev = _context3.next) {
|
|
294
|
-
case 0:
|
|
295
|
-
if (!(file.type.split("/")[0] === "image" || file.type.split("/")[0] === "application" || file.type.split("/")[0] === "text")) {
|
|
296
|
-
_context3.next = 12;
|
|
297
|
-
break;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
_context3.next = 3;
|
|
301
|
-
return getBase64(file);
|
|
302
|
-
|
|
303
|
-
case 3:
|
|
304
|
-
base64IMG = _context3.sent;
|
|
305
|
-
ext = file.name.split(".")[file.name.split(".").length - 1];
|
|
306
|
-
arrayIMG.data.ext.push(ext);
|
|
307
|
-
arrayIMG.data.nameFile.push(file.name.split(".")[0]);
|
|
308
|
-
fileB = Buffer.from(base64IMG, "base64");
|
|
309
|
-
params = {
|
|
310
|
-
ACL: "public-read",
|
|
311
|
-
Body: fileB,
|
|
312
|
-
Bucket: S3_BUCKET,
|
|
313
|
-
Key: "".concat(prop_id_article, "/").concat(prop_version_article, "/chat/").concat(arrayIMG.data.nameFile[0], "-").concat((0, _uuid.v4)(), ".").concat(arrayIMG.data.ext[0])
|
|
314
|
-
};
|
|
315
|
-
_context3.next = 11;
|
|
316
|
-
return myBucket.putObject(params).promise();
|
|
317
|
-
|
|
318
|
-
case 11:
|
|
319
|
-
if (file.type.split("/")[0] === "image") {
|
|
320
|
-
if (arrayIMG.data.ext[0] === "svg") {
|
|
321
|
-
onClickInsertar("file", params.Key);
|
|
322
|
-
} else onClickInsertar("img", params.Key);
|
|
323
|
-
} else if (file.type.split("/")[0] === "application" || file.type.split("/")[0] === "text") {
|
|
324
|
-
onClickInsertar("file", params.Key);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
case 12:
|
|
328
|
-
arrayIMG.data.ext.shift();
|
|
329
|
-
arrayIMG.data.nameFile.shift();
|
|
330
|
-
|
|
331
|
-
case 14:
|
|
332
|
-
case "end":
|
|
333
|
-
return _context3.stop();
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}, _callee3);
|
|
337
|
-
}));
|
|
338
|
-
|
|
339
|
-
return function createPreview(_x2) {
|
|
340
|
-
return _ref4.apply(this, arguments);
|
|
341
|
-
};
|
|
342
|
-
}();
|
|
343
|
-
|
|
344
|
-
var getTime = function getTime(time) {
|
|
345
|
-
var fecha = (0, _moment.default)(time).format("LT");
|
|
346
|
-
var fechaHoy = new Date();
|
|
347
|
-
|
|
348
|
-
if ((0, _moment.default)(time).format("L") === (0, _moment.default)(fechaHoy).format("L")) {
|
|
349
|
-
return (0, _moment.default)(time).format("LT");
|
|
350
|
-
} else return fecha;
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
var renderTXT = function renderTXT(item) {
|
|
354
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
355
|
-
className: "body-message",
|
|
356
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
357
|
-
children: item.value
|
|
358
|
-
})
|
|
359
|
-
});
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
var renderIMG = function renderIMG(item) {
|
|
363
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
364
|
-
className: "img-file",
|
|
365
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|
|
366
|
-
href: "https://content-management-images.s3.amazonaws.com/".concat(item.value),
|
|
367
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactImageFallback.default, {
|
|
368
|
-
src: "https://content-management-images.s3.amazonaws.com/".concat(item.value),
|
|
369
|
-
fallbackImage: _defaultImage.default,
|
|
370
|
-
initialImage: _Spinner.default,
|
|
371
|
-
alt: item.value
|
|
372
|
-
})
|
|
373
|
-
})
|
|
374
|
-
});
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
var renderFILE = function renderFILE(item) {
|
|
378
|
-
var ext = item.value.split(".")[item.value.split(".").length - 1];
|
|
379
|
-
var imgFile;
|
|
380
|
-
|
|
381
|
-
if (ext === "docx" || ext === "doc" || ext === "docs") {
|
|
382
|
-
imgFile = _doc.default;
|
|
383
|
-
} else if (ext === "xls" || ext === "xlsx" || ext === "csv" || ext === "tsv") {
|
|
384
|
-
imgFile = _xls.default;
|
|
385
|
-
} else if (ext === "svg") {
|
|
386
|
-
imgFile = _svgIcon.default;
|
|
387
|
-
} else if (ext === "pdf") {
|
|
388
|
-
imgFile = "https://eu-phoenix.eu/wp-content/uploads/2022/03/pdf-icon.svg";
|
|
389
|
-
} else imgFile = _document.default;
|
|
390
|
-
|
|
391
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
392
|
-
className: "body-message",
|
|
393
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|
|
394
|
-
href: "https://content-management-images.s3.amazonaws.com/".concat(item.value),
|
|
395
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
396
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
397
|
-
src: imgFile,
|
|
398
|
-
alt: item.value
|
|
399
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
400
|
-
children: item.value.split("/")[3]
|
|
401
|
-
})]
|
|
402
|
-
})
|
|
403
|
-
})
|
|
404
|
-
});
|
|
405
|
-
};
|
|
406
|
-
|
|
407
|
-
var getInitial = /*#__PURE__*/function () {
|
|
408
|
-
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
409
|
-
var response;
|
|
410
|
-
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
411
|
-
while (1) {
|
|
412
|
-
switch (_context4.prev = _context4.next) {
|
|
413
|
-
case 0:
|
|
414
|
-
_context4.next = 2;
|
|
415
|
-
return (0, _handlersChat.getBD)(prop_id_article, prop_version_article, "initial", "", Authorization);
|
|
416
|
-
|
|
417
|
-
case 2:
|
|
418
|
-
response = _context4.sent;
|
|
419
|
-
|
|
420
|
-
if (!response.body) {
|
|
421
|
-
// console.log("=====================");
|
|
422
|
-
// console.log("ERROR INITIAL");
|
|
423
|
-
// console.log("=====================");
|
|
424
|
-
// console.log(response);
|
|
425
|
-
console.log("Unable to retrieve company and user from database, please report this to TI");
|
|
426
|
-
setItems([]);
|
|
427
|
-
} else {
|
|
428
|
-
// console.log("=====================");
|
|
429
|
-
// console.log("ITEMS INICIALES");
|
|
430
|
-
// console.log("=====================");
|
|
431
|
-
// console.log(response.body.items);
|
|
432
|
-
setCurrent_id_company(response.body.current_id_company);
|
|
433
|
-
setItems(response.body.items);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
case 4:
|
|
437
|
-
case "end":
|
|
438
|
-
return _context4.stop();
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
}, _callee4);
|
|
442
|
-
}));
|
|
443
|
-
|
|
444
|
-
return function getInitial() {
|
|
445
|
-
return _ref5.apply(this, arguments);
|
|
446
|
-
};
|
|
447
|
-
}();
|
|
448
|
-
|
|
449
|
-
var getUpdate = /*#__PURE__*/function () {
|
|
450
|
-
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
451
|
-
var _currentItems$0$creat, _currentItems$;
|
|
452
|
-
|
|
453
|
-
var currentItems, dateItem, response, newItems;
|
|
454
|
-
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
455
|
-
while (1) {
|
|
456
|
-
switch (_context5.prev = _context5.next) {
|
|
457
|
-
case 0:
|
|
458
|
-
currentItems = items.slice();
|
|
459
|
-
dateItem = (_currentItems$0$creat = (_currentItems$ = currentItems[0]) === null || _currentItems$ === void 0 ? void 0 : _currentItems$.creation_date) !== null && _currentItems$0$creat !== void 0 ? _currentItems$0$creat : "";
|
|
460
|
-
response = {};
|
|
461
|
-
|
|
462
|
-
if (!(dateItem == "")) {
|
|
463
|
-
_context5.next = 9;
|
|
464
|
-
break;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
_context5.next = 6;
|
|
468
|
-
return getInitial();
|
|
469
|
-
|
|
470
|
-
case 6:
|
|
471
|
-
return _context5.abrupt("return");
|
|
472
|
-
|
|
473
|
-
case 9:
|
|
474
|
-
_context5.next = 11;
|
|
475
|
-
return (0, _handlersChat.getBD)(prop_id_article, prop_version_article, "update_latest", dateItem, Authorization);
|
|
476
|
-
|
|
477
|
-
case 11:
|
|
478
|
-
response = _context5.sent;
|
|
479
|
-
|
|
480
|
-
case 12:
|
|
481
|
-
if (!response.body) {
|
|
482
|
-
// console.log("=====================");
|
|
483
|
-
// console.log("ERROR UPDATE LATEST");
|
|
484
|
-
// console.log("=====================");
|
|
485
|
-
console.log("Unable to retrieve company and user from database, please report this to TI");
|
|
486
|
-
setItems(currentItems);
|
|
487
|
-
} else {
|
|
488
|
-
// console.log("=====================");
|
|
489
|
-
// console.log("ITEMS DEL UPDATE LATEST");
|
|
490
|
-
// console.log("=====================");
|
|
491
|
-
// console.log(response.body.items);
|
|
492
|
-
newItems = response.body.items;
|
|
493
|
-
newItems = newItems.concat(currentItems);
|
|
494
|
-
setItems(newItems);
|
|
495
|
-
} // setCountUpdate((prev) => prev + 1);
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
case 13:
|
|
499
|
-
case "end":
|
|
500
|
-
return _context5.stop();
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
}, _callee5);
|
|
504
|
-
}));
|
|
505
|
-
|
|
506
|
-
return function getUpdate() {
|
|
507
|
-
return _ref6.apply(this, arguments);
|
|
508
|
-
};
|
|
509
|
-
}();
|
|
510
|
-
|
|
511
|
-
var getFullDate = function getFullDate() {
|
|
512
|
-
var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
|
|
513
|
-
var dateString = "";
|
|
514
|
-
|
|
515
|
-
switch (date.getDay()) {
|
|
516
|
-
case 0:
|
|
517
|
-
dateString += "Dom ";
|
|
518
|
-
break;
|
|
519
|
-
|
|
520
|
-
case 1:
|
|
521
|
-
dateString += "Lun ";
|
|
522
|
-
break;
|
|
523
|
-
|
|
524
|
-
case 2:
|
|
525
|
-
dateString += "Mar ";
|
|
526
|
-
break;
|
|
527
|
-
|
|
528
|
-
case 3:
|
|
529
|
-
dateString += "Mie ";
|
|
530
|
-
break;
|
|
531
|
-
|
|
532
|
-
case 4:
|
|
533
|
-
dateString += "Jue ";
|
|
534
|
-
break;
|
|
535
|
-
|
|
536
|
-
case 5:
|
|
537
|
-
dateString += "Vie ";
|
|
538
|
-
break;
|
|
539
|
-
|
|
540
|
-
case 6:
|
|
541
|
-
dateString += "Sab ";
|
|
542
|
-
break;
|
|
543
|
-
|
|
544
|
-
default:
|
|
545
|
-
dateString += "-- ";
|
|
546
|
-
break;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
dateString += date.getDate() + " ";
|
|
550
|
-
|
|
551
|
-
switch (date.getMonth() + 1) {
|
|
552
|
-
case 1:
|
|
553
|
-
dateString += "Ene ";
|
|
554
|
-
break;
|
|
555
|
-
|
|
556
|
-
case 2:
|
|
557
|
-
dateString += "Feb ";
|
|
558
|
-
break;
|
|
559
|
-
|
|
560
|
-
case 3:
|
|
561
|
-
dateString += "Mar ";
|
|
562
|
-
break;
|
|
563
|
-
|
|
564
|
-
case 4:
|
|
565
|
-
dateString += "Abr ";
|
|
566
|
-
break;
|
|
567
|
-
|
|
568
|
-
case 5:
|
|
569
|
-
dateString += "May ";
|
|
570
|
-
break;
|
|
571
|
-
|
|
572
|
-
case 6:
|
|
573
|
-
dateString += "Jun ";
|
|
574
|
-
break;
|
|
575
|
-
|
|
576
|
-
case 7:
|
|
577
|
-
dateString += "Jul ";
|
|
578
|
-
break;
|
|
579
|
-
|
|
580
|
-
case 8:
|
|
581
|
-
dateString += "Ago ";
|
|
582
|
-
break;
|
|
583
|
-
|
|
584
|
-
case 9:
|
|
585
|
-
dateString += "Sep ";
|
|
586
|
-
break;
|
|
587
|
-
|
|
588
|
-
case 10:
|
|
589
|
-
dateString += "Oct ";
|
|
590
|
-
break;
|
|
591
|
-
|
|
592
|
-
case 11:
|
|
593
|
-
dateString += "Nov ";
|
|
594
|
-
break;
|
|
595
|
-
|
|
596
|
-
case 12:
|
|
597
|
-
dateString += "Dic ";
|
|
598
|
-
break;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
dateString += date.getFullYear();
|
|
602
|
-
return dateString;
|
|
603
|
-
};
|
|
604
|
-
|
|
605
|
-
var onClickLoadMore = /*#__PURE__*/function () {
|
|
606
|
-
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
607
|
-
var _currentItems$creatio, _currentItems;
|
|
608
|
-
|
|
609
|
-
var currentItems, dateItem, response, newItems;
|
|
610
|
-
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
611
|
-
while (1) {
|
|
612
|
-
switch (_context6.prev = _context6.next) {
|
|
613
|
-
case 0:
|
|
614
|
-
clearTimeout(processUpdateID);
|
|
615
|
-
currentItems = items.slice();
|
|
616
|
-
dateItem = (_currentItems$creatio = (_currentItems = currentItems[currentItems.length - 1]) === null || _currentItems === void 0 ? void 0 : _currentItems.creation_date) !== null && _currentItems$creatio !== void 0 ? _currentItems$creatio : "";
|
|
617
|
-
response = {};
|
|
618
|
-
|
|
619
|
-
if (!(dateItem == "")) {
|
|
620
|
-
_context6.next = 10;
|
|
621
|
-
break;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
_context6.next = 7;
|
|
625
|
-
return getInitial();
|
|
626
|
-
|
|
627
|
-
case 7:
|
|
628
|
-
return _context6.abrupt("return");
|
|
629
|
-
|
|
630
|
-
case 10:
|
|
631
|
-
_context6.next = 12;
|
|
632
|
-
return (0, _handlersChat.getBD)(prop_id_article, prop_version_article, "load_more", dateItem, Authorization);
|
|
633
|
-
|
|
634
|
-
case 12:
|
|
635
|
-
response = _context6.sent;
|
|
636
|
-
|
|
637
|
-
case 13:
|
|
638
|
-
if (!response.body) {
|
|
639
|
-
// console.log("=====================");
|
|
640
|
-
// console.log("ERROR LOAD MORE");
|
|
641
|
-
// console.log("=====================");
|
|
642
|
-
console.log("Unable to retrieve company and user from database, please report this to TI");
|
|
643
|
-
setItems(currentItems);
|
|
644
|
-
} else {
|
|
645
|
-
// console.log("=====================");
|
|
646
|
-
// console.log("ITEMS DEL LOAD MORE");
|
|
647
|
-
// console.log("=====================");
|
|
648
|
-
// console.log(response.body.items);
|
|
649
|
-
newItems = currentItems.concat(response.body.items);
|
|
650
|
-
setItems(newItems);
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
case 14:
|
|
654
|
-
case "end":
|
|
655
|
-
return _context6.stop();
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
}, _callee6);
|
|
659
|
-
}));
|
|
660
|
-
|
|
661
|
-
return function onClickLoadMore() {
|
|
662
|
-
return _ref7.apply(this, arguments);
|
|
663
|
-
};
|
|
664
|
-
}();
|
|
665
|
-
|
|
666
|
-
var onClickInsertar = /*#__PURE__*/function () {
|
|
667
|
-
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(valueType, valueInput) {
|
|
668
|
-
var currentItems, response;
|
|
669
|
-
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
670
|
-
while (1) {
|
|
671
|
-
switch (_context7.prev = _context7.next) {
|
|
672
|
-
case 0:
|
|
673
|
-
clearTimeout(processUpdateID);
|
|
674
|
-
currentItems = items.slice();
|
|
675
|
-
_context7.next = 4;
|
|
676
|
-
return (0, _handlersChat.createItemBD)(prop_id_article, prop_version_article, valueType, valueInput, Authorization);
|
|
677
|
-
|
|
678
|
-
case 4:
|
|
679
|
-
response = _context7.sent;
|
|
680
|
-
|
|
681
|
-
if (response.body) {
|
|
682
|
-
_context7.next = 10;
|
|
683
|
-
break;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
// console.log("=====================");
|
|
687
|
-
// console.log("ERROR INSERTAR");
|
|
688
|
-
// console.log("=====================");
|
|
689
|
-
console.log("Unable to retrieve company and user from database, please report this to TI");
|
|
690
|
-
setItems(currentItems);
|
|
691
|
-
_context7.next = 18;
|
|
692
|
-
break;
|
|
693
|
-
|
|
694
|
-
case 10:
|
|
695
|
-
setValueInput("");
|
|
696
|
-
|
|
697
|
-
if (!((currentItems === null || currentItems === void 0 ? void 0 : currentItems.length) == 0)) {
|
|
698
|
-
_context7.next = 16;
|
|
699
|
-
break;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
_context7.next = 14;
|
|
703
|
-
return getInitial();
|
|
704
|
-
|
|
705
|
-
case 14:
|
|
706
|
-
_context7.next = 18;
|
|
707
|
-
break;
|
|
708
|
-
|
|
709
|
-
case 16:
|
|
710
|
-
_context7.next = 18;
|
|
711
|
-
return getUpdate();
|
|
712
|
-
|
|
713
|
-
case 18:
|
|
714
|
-
case "end":
|
|
715
|
-
return _context7.stop();
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
}, _callee7);
|
|
719
|
-
}));
|
|
720
|
-
|
|
721
|
-
return function onClickInsertar(_x3, _x4) {
|
|
722
|
-
return _ref8.apply(this, arguments);
|
|
723
|
-
};
|
|
724
|
-
}();
|
|
725
|
-
|
|
726
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
727
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
728
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
729
|
-
src: _iconChat.default,
|
|
730
|
-
alt: "chat icon",
|
|
731
|
-
className: "icon-chat",
|
|
732
|
-
onClick: function onClick() {
|
|
733
|
-
setShowMenu(!showMenu);
|
|
734
|
-
}
|
|
735
|
-
})
|
|
736
|
-
}), showMenu && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Slider, {
|
|
737
|
-
id: "div-slider",
|
|
738
|
-
showMenu: showMenu,
|
|
739
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
740
|
-
onClick: function onClick() {
|
|
741
|
-
setShowMenu(false);
|
|
742
|
-
},
|
|
743
|
-
className: "close",
|
|
744
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
745
|
-
src: _close.default,
|
|
746
|
-
alt: "close-chat"
|
|
747
|
-
})
|
|
748
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
749
|
-
className: "content-chat",
|
|
750
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
751
|
-
onClick: /*#__PURE__*/function () {
|
|
752
|
-
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(event) {
|
|
753
|
-
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
754
|
-
while (1) {
|
|
755
|
-
switch (_context8.prev = _context8.next) {
|
|
756
|
-
case 0:
|
|
757
|
-
return _context8.abrupt("return", onClickLoadMore());
|
|
758
|
-
|
|
759
|
-
case 1:
|
|
760
|
-
case "end":
|
|
761
|
-
return _context8.stop();
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
}, _callee8);
|
|
765
|
-
}));
|
|
766
|
-
|
|
767
|
-
return function (_x5) {
|
|
768
|
-
return _ref9.apply(this, arguments);
|
|
769
|
-
};
|
|
770
|
-
}(),
|
|
771
|
-
className: "cargar-mas",
|
|
772
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
773
|
-
src: _iconPlus.default,
|
|
774
|
-
alt: "Cargar m\xE1s"
|
|
775
|
-
}), "cargar m\xE1s"]
|
|
776
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
|
777
|
-
id: "myListChat",
|
|
778
|
-
children: customItems
|
|
779
|
-
})]
|
|
780
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
781
|
-
className: "input-chat",
|
|
782
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
783
|
-
className: "send-message",
|
|
784
|
-
placeholder: "Escribe Aqu\xED...",
|
|
785
|
-
id: "id-input-message",
|
|
786
|
-
onKeyDown: function onKeyDown(e) {
|
|
787
|
-
switch (e.key) {
|
|
788
|
-
case "Enter":
|
|
789
|
-
onClickInsertar("txt", valueInput);
|
|
790
|
-
break;
|
|
791
|
-
|
|
792
|
-
default:
|
|
793
|
-
break;
|
|
794
|
-
}
|
|
795
|
-
},
|
|
796
|
-
value: valueInput,
|
|
797
|
-
onChange: function onChange(event) {
|
|
798
|
-
return setValueInput(event.target.value);
|
|
799
|
-
}
|
|
800
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
801
|
-
type: "file",
|
|
802
|
-
id: "file",
|
|
803
|
-
accept: "image/*,text/*,application/*",
|
|
804
|
-
className: "add-picture-input",
|
|
805
|
-
onChange: function onChange(e) {
|
|
806
|
-
createPreview(document.getElementById("file").files[0]);
|
|
807
|
-
}
|
|
808
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
809
|
-
htmlFor: "file",
|
|
810
|
-
className: "upload",
|
|
811
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
812
|
-
src: _upload_file.default,
|
|
813
|
-
alt: "send chat"
|
|
814
|
-
})
|
|
815
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
816
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
817
|
-
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
818
|
-
while (1) {
|
|
819
|
-
switch (_context9.prev = _context9.next) {
|
|
820
|
-
case 0:
|
|
821
|
-
return _context9.abrupt("return", onClickInsertar("txt", valueInput));
|
|
822
|
-
|
|
823
|
-
case 1:
|
|
824
|
-
case "end":
|
|
825
|
-
return _context9.stop();
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
}, _callee9);
|
|
829
|
-
})),
|
|
830
|
-
className: "send",
|
|
831
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
832
|
-
src: _send.default,
|
|
833
|
-
alt: "send chat"
|
|
834
|
-
})
|
|
835
|
-
})]
|
|
836
|
-
})]
|
|
837
|
-
})]
|
|
838
|
-
});
|
|
839
|
-
};
|
|
840
|
-
|
|
841
|
-
exports.ChatPopUp = ChatPopUp;
|