@messenger-box/platform-browser 10.0.3-alpha.7 → 10.0.3-alpha.74
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/CHANGELOG.md +100 -0
- package/lib/components/InboxMessage/InboxDetails/index.d.ts +6 -1
- package/lib/components/InboxMessage/InboxDetails/index.d.ts.map +1 -1
- package/lib/components/InboxMessage/InboxDetails/index.js +10 -11
- package/lib/components/InboxMessage/InboxDetails/index.js.map +1 -1
- package/lib/components/InboxMessage/InboxSidebar/index.d.ts.map +1 -1
- package/lib/components/InboxMessage/InboxSidebar/index.js +23 -32
- package/lib/components/InboxMessage/InboxSidebar/index.js.map +1 -1
- package/lib/components/InboxMessage/Messages/index.d.ts.map +1 -1
- package/lib/components/InboxMessage/Messages/index.js +42 -81
- package/lib/components/InboxMessage/Messages/index.js.map +1 -1
- package/lib/components/InboxMessage/MessagesList/index.d.ts.map +1 -1
- package/lib/components/InboxMessage/MessagesList/index.js +53 -74
- package/lib/components/InboxMessage/MessagesList/index.js.map +1 -1
- package/lib/components/InboxMessage/Popover/index.d.ts +5 -1
- package/lib/components/InboxMessage/Popover/index.d.ts.map +1 -1
- package/lib/components/InboxMessage/Popover/index.js +8 -35
- package/lib/components/InboxMessage/Popover/index.js.map +1 -1
- package/lib/components/InboxMessage/UserModalContent/index.d.ts.map +1 -1
- package/lib/components/InboxMessage/UserModalContent/index.js +50 -47
- package/lib/components/InboxMessage/UserModalContent/index.js.map +1 -1
- package/lib/components/InboxMessage/index.d.ts.map +1 -1
- package/lib/components/InboxMessage/index.js +38 -70
- package/lib/components/InboxMessage/index.js.map +1 -1
- package/lib/components/dashboard/menu_header.d.ts.map +1 -1
- package/lib/components/dashboard/menu_header.js +38 -24
- package/lib/components/dashboard/menu_header.js.map +1 -1
- package/lib/components/dashboard/modals/direct_modal.d.ts +10 -8
- package/lib/components/dashboard/modals/direct_modal.d.ts.map +1 -1
- package/lib/components/dashboard/modals/direct_modal.js +59 -39
- package/lib/components/dashboard/modals/direct_modal.js.map +1 -1
- package/lib/components/dashboard/modals.d.ts +18 -6
- package/lib/components/dashboard/modals.d.ts.map +1 -1
- package/lib/components/dashboard/modals.js +60 -101
- package/lib/components/dashboard/modals.js.map +1 -1
- package/lib/components/messenger/avatar/index.d.ts.map +1 -1
- package/lib/components/messenger/index.d.ts.map +1 -1
- package/lib/components/messenger/index.js +45 -82
- package/lib/components/messenger/index.js.map +1 -1
- package/lib/components/messenger/messagesList/index.d.ts.map +1 -1
- package/lib/components/messenger/messagesList/index.js +174 -454
- package/lib/components/messenger/messagesList/index.js.map +1 -1
- package/lib/components/messenger/messagesList/messageBox.d.ts +0 -1
- package/lib/components/messenger/messagesList/messageBox.d.ts.map +1 -1
- package/lib/components/messenger/more_action/index.d.ts.map +1 -1
- package/lib/components/messenger/postMessage/postMessage.d.ts +7 -2
- package/lib/components/messenger/postMessage/postMessage.d.ts.map +1 -1
- package/lib/components/messenger/sidebarThreadList/index.d.ts.map +1 -1
- package/lib/components/messenger/threadSidebar/index.d.ts.map +1 -1
- package/lib/components/messenger/types/message.d.ts +11 -11
- package/lib/components/messenger/types/message.d.ts.map +1 -1
- package/lib/components/post/create_post/create_post.d.ts +10 -1
- package/lib/components/post/create_post/create_post.d.ts.map +1 -1
- package/lib/components/post/index.d.ts +5 -3
- package/lib/components/post/index.d.ts.map +1 -1
- package/lib/components/post/index.js +63 -97
- package/lib/components/post/index.js.map +1 -1
- package/lib/components/post/post_header/post_header_custom_status.d.ts.map +1 -1
- package/lib/compute.d.ts.map +1 -1
- package/lib/compute.js +1 -1
- package/lib/compute.js.map +1 -1
- package/lib/containers/Dashboard.d.ts.map +1 -1
- package/lib/containers/Dashboard.js +110 -124
- package/lib/containers/Dashboard.js.map +1 -1
- package/lib/containers/DashboardWithLoader.d.ts.map +1 -1
- package/lib/containers/DashboardWithLoader.js +10 -3
- package/lib/containers/DashboardWithLoader.js.map +1 -1
- package/package.json +5 -5
- package/src/components/InboxMessage/InboxDetails/index.tsx +13 -15
- package/src/components/InboxMessage/InboxSidebar/index.tsx +23 -33
- package/src/components/InboxMessage/Messages/index.tsx +58 -97
- package/src/components/InboxMessage/MessagesList/index.tsx +71 -82
- package/src/components/InboxMessage/Popover/index.tsx +14 -38
- package/src/components/InboxMessage/UserModalContent/index.tsx +41 -44
- package/src/components/InboxMessage/index.tsx +53 -68
- package/src/components/dashboard/menu_header.tsx +52 -45
- package/src/components/dashboard/modals/direct_modal.tsx +73 -40
- package/src/components/dashboard/modals.tsx +114 -105
- package/src/components/messenger/avatar/index.tsx +27 -13
- package/src/components/messenger/index.tsx +126 -161
- package/src/components/messenger/messagesList/index.tsx +288 -572
- package/src/components/messenger/messagesList/messageBox.tsx +45 -34
- package/src/components/messenger/more_action/index.tsx +16 -10
- package/src/components/messenger/postMessage/postMessage.tsx +28 -16
- package/src/components/messenger/sidebarThreadList/index.tsx +52 -178
- package/src/components/messenger/threadSidebar/index.tsx +88 -75
- package/src/components/messenger/types/message.ts +12 -11
- package/src/components/post/channel_view/channel_view.tsx +2 -2
- package/src/components/post/create_post/create_post.tsx +104 -195
- package/src/components/post/index.tsx +78 -99
- package/src/components/post/post_header/post_header_custom_status.tsx +7 -6
- package/src/components/post/post_header/style.ts +51 -51
- package/src/compute.ts +8 -8
- package/src/containers/Dashboard.tsx +170 -213
- package/src/containers/DashboardWithLoader.tsx +13 -5
- package/lib/components/InboxMessage/InboxDetails/style.d.ts +0 -2
- package/lib/components/InboxMessage/InboxDetails/style.d.ts.map +0 -1
- package/lib/components/InboxMessage/InboxDetails/style.js +0 -27
- package/lib/components/InboxMessage/InboxDetails/style.js.map +0 -1
- package/lib/components/InboxMessage/InboxSidebar/styles.d.ts +0 -2
- package/lib/components/InboxMessage/InboxSidebar/styles.d.ts.map +0 -1
- package/lib/components/InboxMessage/InboxSidebar/styles.js +0 -57
- package/lib/components/InboxMessage/InboxSidebar/styles.js.map +0 -1
- package/lib/components/InboxMessage/Messages/styles.d.ts +0 -81
- package/lib/components/InboxMessage/Messages/styles.d.ts.map +0 -1
- package/lib/components/InboxMessage/Messages/styles.js +0 -85
- package/lib/components/InboxMessage/Messages/styles.js.map +0 -1
- package/lib/components/InboxMessage/Popover/style.d.ts +0 -28
- package/lib/components/InboxMessage/Popover/style.d.ts.map +0 -1
- package/lib/components/InboxMessage/Popover/style.js +0 -27
- package/lib/components/InboxMessage/Popover/style.js.map +0 -1
- package/lib/components/InboxMessage/UserModalContent/style.d.ts +0 -2
- package/lib/components/InboxMessage/UserModalContent/style.d.ts.map +0 -1
- package/lib/components/InboxMessage/UserModalContent/style.js +0 -98
- package/lib/components/InboxMessage/UserModalContent/style.js.map +0 -1
- package/lib/components/InboxMessage/style.js +0 -189
- package/lib/components/InboxMessage/style.js.map +0 -1
- package/lib/components/messenger/avatar/style.d.ts +0 -2
- package/lib/components/messenger/avatar/style.d.ts.map +0 -1
- package/lib/components/messenger/messagesList/style.js +0 -446
- package/lib/components/messenger/messagesList/style.js.map +0 -1
- package/lib/components/messenger/more_action/index.js +0 -48
- package/lib/components/messenger/more_action/index.js.map +0 -1
- package/lib/components/messenger/more_action/style.d.ts +0 -2
- package/lib/components/messenger/more_action/style.d.ts.map +0 -1
- package/lib/components/messenger/more_action/style.js +0 -45
- package/lib/components/messenger/more_action/style.js.map +0 -1
- package/lib/components/post/style.js +0 -20101
- package/lib/components/post/style.js.map +0 -1
- package/lib/style.js +0 -400
- package/lib/style.js.map +0 -1
- package/src/components/InboxMessage/InboxDetails/style.ts +0 -27
- package/src/components/InboxMessage/InboxSidebar/styles.ts +0 -57
- package/src/components/InboxMessage/Messages/styles.ts +0 -85
- package/src/components/InboxMessage/Popover/style.ts +0 -27
- package/src/components/InboxMessage/UserModalContent/style.ts +0 -98
- package/src/components/messenger/avatar/style.ts +0 -86
- package/src/components/messenger/more_action/style.ts +0 -45
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import React, { FC, useState } from 'react';
|
|
2
|
-
import { Avatar, Col, Popover, Row } from 'antd';
|
|
3
|
-
import { Comment } from '@ant-design/compatible';
|
|
4
2
|
import { useSelector } from 'react-redux';
|
|
5
3
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
|
|
7
|
-
import {
|
|
4
|
+
import { BiDotsVerticalRounded } from '@react-icons/all-files/bi/BiDotsVerticalRounded';
|
|
5
|
+
import { BiPaperPlane } from '@react-icons/all-files/bi/BiPaperPlane';
|
|
6
|
+
import { BiDotsHorizontalRounded } from '@react-icons/all-files/bi/BiDotsHorizontalRounded';
|
|
8
7
|
import Moment from 'moment';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
8
|
+
import { IoBookmarkOutline } from '@react-icons/all-files/io5/IoBookmarkOutline';
|
|
9
|
+
import { MdModeEdit } from '@react-icons/all-files/md/MdModeEdit';
|
|
10
|
+
import { MdFavoriteBorder } from '@react-icons/all-files/md/MdFavoriteBorder';
|
|
11
|
+
import { MdCloudDownload } from '@react-icons/all-files/md/MdCloudDownload';
|
|
12
|
+
import { MdSentimentSatisfied } from '@react-icons/all-files/md/MdSentimentSatisfied';
|
|
13
|
+
import { MdDesktopMac } from '@react-icons/all-files/md/MdDesktopMac';
|
|
14
|
+
// import {
|
|
15
|
+
// MdModeEditOutline,
|
|
16
|
+
// MdOutlineAddReaction,
|
|
17
|
+
// MdOutlineCloudDownload,
|
|
18
|
+
// MdOutlineDesktopMac,
|
|
19
|
+
// MdOutlineEmojiEmotions,
|
|
20
|
+
// } from 'react-icons/md';
|
|
21
|
+
import { VscChromeClose } from '@react-icons/all-files/vsc/VscChromeClose';
|
|
22
|
+
import { FaRobot } from '@react-icons/all-files/fa/FaRobot';
|
|
23
|
+
import { TiUserAdd } from '@react-icons/all-files/ti/TiUserAdd';
|
|
24
|
+
import { RiShareForwardLine } from '@react-icons/all-files/ri/RiShareForwardLine';
|
|
25
|
+
import { BsReply } from '@react-icons/all-files/bs/BsReply';
|
|
26
|
+
import { GrClose } from '@react-icons/all-files/gr/GrClose';
|
|
25
27
|
import { Picker } from 'emoji-mart';
|
|
26
28
|
import { Button, Modal } from 'react-bootstrap';
|
|
27
29
|
import { IPostFragment } from 'common';
|
|
28
30
|
import MoreAction from '../more_action';
|
|
29
|
-
import { styleSheet2 } from '../../post/style';
|
|
30
31
|
|
|
31
32
|
interface IProps {
|
|
32
33
|
userMessagesList: IPostFragment[];
|
|
@@ -59,6 +60,10 @@ export const MessagesList: FC<IProps> = ({
|
|
|
59
60
|
const [showAddMember, setShowAddMember] = useState(false);
|
|
60
61
|
const [inputValue, setInputValue] = useState({ id: '', msg: '' });
|
|
61
62
|
const { t } = useTranslation();
|
|
63
|
+
const [showEmoji, setShowEmoji] = useState(false);
|
|
64
|
+
const [likes, setLikes] = useState(0);
|
|
65
|
+
const [dislikes, setDislikes] = useState(0);
|
|
66
|
+
const [action, setAction] = useState<string | null>(null);
|
|
62
67
|
|
|
63
68
|
console.log('-------Selected channel for chatting---------', channel);
|
|
64
69
|
console.log('-------All messages for selected channel---------', userMessagesList);
|
|
@@ -124,6 +129,18 @@ export const MessagesList: FC<IProps> = ({
|
|
|
124
129
|
document.getElementById(id).click();
|
|
125
130
|
};
|
|
126
131
|
|
|
132
|
+
const like = () => {
|
|
133
|
+
setLikes(1);
|
|
134
|
+
setDislikes(0);
|
|
135
|
+
setAction('liked');
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const dislike = () => {
|
|
139
|
+
setLikes(0);
|
|
140
|
+
setDislikes(1);
|
|
141
|
+
setAction('disliked');
|
|
142
|
+
};
|
|
143
|
+
|
|
127
144
|
return (
|
|
128
145
|
<div>
|
|
129
146
|
<Modal show={show} onHide={() => handleClose('editMessage')}>
|
|
@@ -138,7 +155,12 @@ export const MessagesList: FC<IProps> = ({
|
|
|
138
155
|
/>
|
|
139
156
|
</Modal.Header>
|
|
140
157
|
<Modal.Body>
|
|
141
|
-
<input
|
|
158
|
+
<input
|
|
159
|
+
type="text"
|
|
160
|
+
value={inputValue.msg}
|
|
161
|
+
onChange={(e) => handleChange(e)}
|
|
162
|
+
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
163
|
+
/>
|
|
142
164
|
</Modal.Body>
|
|
143
165
|
<Modal.Footer>
|
|
144
166
|
<Button onClick={() => handleClose('editMessage')}>{t('messenger_box_browser.close')}</Button>
|
|
@@ -165,55 +187,42 @@ export const MessagesList: FC<IProps> = ({
|
|
|
165
187
|
<input type="search" onChange={(e) => handleChange(e)} />
|
|
166
188
|
</Modal.Body>
|
|
167
189
|
</Modal>
|
|
168
|
-
<div className=
|
|
190
|
+
<div className="space-y-4">
|
|
169
191
|
{!channel ? (
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
>
|
|
189
|
-
<
|
|
190
|
-
</Avatar>
|
|
191
|
-
<p style={{ fontWeight: 'bold' }}>{t('messenger_box_browser.surveybot')}</p>
|
|
192
|
-
<p>{t('messenger_box_browser.survey_bot_collects_your')}</p>
|
|
193
|
-
<div>
|
|
194
|
-
<h5>
|
|
192
|
+
<div className="relative group">
|
|
193
|
+
<button
|
|
194
|
+
className="flex items-center space-x-2 p-2 rounded-full hover:bg-gray-100"
|
|
195
|
+
onClick={() => {}}
|
|
196
|
+
>
|
|
197
|
+
<div className="w-10 h-10 bg-gray-800 rounded-full flex items-center justify-center">
|
|
198
|
+
<FaRobot className="text-white text-xl" />
|
|
199
|
+
</div>
|
|
200
|
+
</button>
|
|
201
|
+
<div className="hidden group-hover:block absolute left-0 mt-2 w-64 p-4 bg-white rounded-lg shadow-lg">
|
|
202
|
+
<div className="flex flex-col items-center">
|
|
203
|
+
<div className="w-20 h-20 bg-gray-800 rounded-full flex items-center justify-center mb-4">
|
|
204
|
+
<FaRobot className="text-white text-3xl" />
|
|
205
|
+
</div>
|
|
206
|
+
<p className="font-bold">{t('messenger_box_browser.surveybot')}</p>
|
|
207
|
+
<p className="text-sm text-gray-600">
|
|
208
|
+
{t('messenger_box_browser.survey_bot_collects_your')}
|
|
209
|
+
</p>
|
|
210
|
+
<div className="mt-2">
|
|
211
|
+
<h5 className="text-sm">
|
|
195
212
|
{t('messenger_box_browser.local_time')}{' '}
|
|
196
213
|
<span>{Moment().format('HH:mm A')}</span>
|
|
197
214
|
</h5>
|
|
198
215
|
</div>
|
|
199
|
-
<
|
|
200
|
-
<BiPaperPlane
|
|
216
|
+
<button className="mt-4 flex items-center text-blue-600 hover:text-blue-700">
|
|
217
|
+
<BiPaperPlane className="mr-1" />
|
|
201
218
|
{t('messenger_box_browser.send_message')}
|
|
202
|
-
</
|
|
219
|
+
</button>
|
|
203
220
|
</div>
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
>
|
|
207
|
-
<Avatar className="main_avatar">
|
|
208
|
-
<FaRobot className="inner_main_avatar" />
|
|
209
|
-
</Avatar>
|
|
210
|
-
</Popover>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
211
223
|
) : (
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
{channel ? (
|
|
215
|
-
<div>
|
|
216
|
-
<p style={{ fontSize: '20px', fontWeight: 600, color: '#4b4a4e' }}>
|
|
224
|
+
<div className="space-y-4">
|
|
225
|
+
<p className="text-xl font-semibold text-gray-700">
|
|
217
226
|
{t('messenger_box_browser.beginning_of')}
|
|
218
227
|
{channel.type !== 'DIRECT'
|
|
219
228
|
? channel.title
|
|
@@ -223,542 +232,249 @@ export const MessagesList: FC<IProps> = ({
|
|
|
223
232
|
: channel.displayName.split('_')[1].split('-')[1]
|
|
224
233
|
: channel.displayName}
|
|
225
234
|
</p>
|
|
226
|
-
{channel.type !== 'DIRECT' ? (
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
235
|
+
{channel.type !== 'DIRECT' ? null : (
|
|
236
|
+
<h5 className="text-gray-600">
|
|
237
|
+
{t('messenger_box_browser.direct_messages_and_files_shared')}
|
|
238
|
+
</h5>
|
|
230
239
|
)}
|
|
231
|
-
<div className="
|
|
232
|
-
<
|
|
233
|
-
|
|
234
|
-
onClick={() =>
|
|
235
|
-
setShowAddMember(true);
|
|
236
|
-
}}
|
|
240
|
+
<div className="flex space-x-6">
|
|
241
|
+
<button
|
|
242
|
+
className="flex items-center text-gray-600 hover:text-gray-800"
|
|
243
|
+
onClick={() => setShowAddMember(true)}
|
|
237
244
|
>
|
|
238
|
-
<TiUserAdd />
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
245
|
+
<TiUserAdd className="mr-2" />
|
|
246
|
+
<span>{t('messenger_box_browser.invite_others_to_this_channel')}</span>
|
|
247
|
+
</button>
|
|
248
|
+
<button className="flex items-center text-gray-600 hover:text-gray-800">
|
|
249
|
+
<MdModeEdit className="mr-2" />
|
|
250
|
+
<span>{t('messenger_box_browser.set_a_header')}</span>
|
|
251
|
+
</button>
|
|
243
252
|
</div>
|
|
244
253
|
</div>
|
|
245
|
-
) : (
|
|
246
|
-
<>
|
|
247
|
-
<div className="text-nav">
|
|
248
|
-
<h5>{t('messenger_box_browser.surveybot')}</h5>
|
|
249
|
-
<span>{t('messenger_box_browser.bot')}</span>
|
|
250
|
-
</div>
|
|
251
|
-
<p className="p_style">{t('messenger_box_browser.this_is_the_start_of_your_direct_message')}</p>
|
|
252
|
-
<p className="p_style">{t('messenger_box_browser.direct_messages_and_files_shared')}</p>
|
|
253
|
-
</>
|
|
254
254
|
)}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
255
|
+
|
|
256
|
+
<div className="space-y-4">
|
|
257
|
+
{userMessagesList?.map((item, index: number) => {
|
|
258
|
+
if (!msgClr.hasOwnProperty(item.author.username)) {
|
|
259
|
+
let temp = msgClr;
|
|
260
|
+
let color = '#';
|
|
261
|
+
for (let i = 0; i < 6; i++) {
|
|
262
|
+
color += Math.floor(Math.random() * 10);
|
|
263
|
+
}
|
|
264
|
+
temp[item.author.username] = color;
|
|
265
|
+
setMsgClr(temp);
|
|
263
266
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
267
|
+
|
|
268
|
+
return (
|
|
269
|
+
<div
|
|
270
|
+
key={index}
|
|
271
|
+
className={`p-4 ${item.isPinned ? 'bg-yellow-50' : 'bg-white'} relative group`}
|
|
272
|
+
>
|
|
273
|
+
{/* Date Separator */}
|
|
274
|
+
{index !== 0 ? (
|
|
275
|
+
Moment(userMessagesList[index].createdAt).format('DD/MM/YYYY') !==
|
|
276
|
+
Moment(userMessagesList[index - 1].createdAt).format('DD/MM/YYYY') ? (
|
|
277
|
+
<div className="flex items-center my-4">
|
|
278
|
+
<div className="flex-1 border-t border-gray-300"></div>
|
|
279
|
+
<span className="px-3 text-sm text-gray-500">
|
|
280
|
+
{Moment(item.createdAt).diff(Moment().format(), 'year') == 0
|
|
281
|
+
? Moment(item.createdAt).diff(Moment().format(), 'day') == 0
|
|
282
|
+
? t('messenger_box_browser.today')
|
|
283
|
+
: Moment(item.createdAt).diff(Moment().format(), 'day') == -1
|
|
284
|
+
? t('messenger_box_browser.yesterday')
|
|
285
|
+
: Moment(item.createdAt).diff(Moment().format(), 'day') >= -6
|
|
286
|
+
? `${Moment(item.createdAt).format('dddd')}`
|
|
287
|
+
: `${Moment(item.createdAt).format('MMMM DD')}`
|
|
288
|
+
: `${Moment(item.createdAt).format('MMMM Do, YYYY')}`}
|
|
289
|
+
</span>
|
|
290
|
+
<div className="flex-1 border-t border-gray-300"></div>
|
|
291
|
+
</div>
|
|
292
|
+
) : null
|
|
289
293
|
) : (
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
<div className="btn-hover">
|
|
324
|
-
<div className="hover_btns">
|
|
325
|
-
<button>
|
|
326
|
-
<BiDotsHorizontalRounded
|
|
327
|
-
fontSize="16px"
|
|
328
|
-
fill="gray"
|
|
329
|
-
onClick={() => setShowMoreAction(!showMoreAction)}
|
|
294
|
+
<div className="flex items-center my-4">
|
|
295
|
+
<div className="flex-1 border-t border-gray-300"></div>
|
|
296
|
+
<span className="px-3 text-sm text-gray-500">
|
|
297
|
+
{Moment(item.createdAt).diff(Moment().format(), 'year') == 0
|
|
298
|
+
? Moment(item.createdAt).diff(Moment().format(), 'day') == 0
|
|
299
|
+
? t('messenger_box_browser.today')
|
|
300
|
+
: Moment(item.createdAt).diff(Moment().format(), 'day') == -1
|
|
301
|
+
? t('messenger_box_browser.yesterday')
|
|
302
|
+
: Moment(item.createdAt).diff(Moment().format(), 'day') >= -6
|
|
303
|
+
? `${Moment(item.createdAt).format('dddd')}`
|
|
304
|
+
: `${Moment(item.createdAt).format('MMMM DD')}`
|
|
305
|
+
: `${Moment(item.createdAt).format('MMMM Do, YYYY')}`}
|
|
306
|
+
</span>
|
|
307
|
+
<div className="flex-1 border-t border-gray-300"></div>
|
|
308
|
+
</div>
|
|
309
|
+
)}
|
|
310
|
+
|
|
311
|
+
{/* Emoji Picker */}
|
|
312
|
+
{displayEmoji && msgIndex === index && (
|
|
313
|
+
<div className="absolute bottom-full mb-2">
|
|
314
|
+
<Picker
|
|
315
|
+
onSelect={handleOnSelect}
|
|
316
|
+
native={true}
|
|
317
|
+
set="apple"
|
|
318
|
+
emoji="point_up"
|
|
319
|
+
title={t('messenger_box_browser.pick_your_emoji')}
|
|
320
|
+
emojiSize={24}
|
|
321
|
+
perLine={6}
|
|
322
|
+
color="#ae65c5"
|
|
323
|
+
sheetSize={16}
|
|
324
|
+
showPreview={true}
|
|
325
|
+
showSkinTones={false}
|
|
326
|
+
notFoundEmoji="sleuth_or_spy"
|
|
330
327
|
/>
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
pinMessage={pinMessage}
|
|
342
|
-
/>
|
|
343
|
-
) : null}
|
|
328
|
+
</div>
|
|
329
|
+
)}
|
|
330
|
+
|
|
331
|
+
{/* Message Actions */}
|
|
332
|
+
<div className="hidden group-hover:flex absolute right-4 top-2 bg-white shadow-lg rounded-md">
|
|
333
|
+
<button
|
|
334
|
+
className="p-2 hover:bg-gray-100 rounded-l-md"
|
|
335
|
+
onClick={() => setShowMoreAction(!showMoreAction)}
|
|
336
|
+
>
|
|
337
|
+
<BiDotsHorizontalRounded className="text-gray-500" />
|
|
344
338
|
</button>
|
|
345
|
-
<button
|
|
346
|
-
|
|
339
|
+
<button
|
|
340
|
+
className="p-2 hover:bg-gray-100"
|
|
341
|
+
onClick={() => emojiClick(index, item.id)}
|
|
342
|
+
>
|
|
343
|
+
<MdSentimentSatisfied className="text-gray-500" />
|
|
347
344
|
</button>
|
|
348
|
-
<button>
|
|
349
|
-
<IoBookmarkOutline
|
|
345
|
+
<button className="p-2 hover:bg-gray-100">
|
|
346
|
+
<IoBookmarkOutline className="text-gray-500" />
|
|
350
347
|
</button>
|
|
351
|
-
<button onClick={handleShowSideBar}>
|
|
352
|
-
<BsReply
|
|
348
|
+
<button className="p-2 hover:bg-gray-100 rounded-r-md" onClick={handleShowSideBar}>
|
|
349
|
+
<BsReply className="text-gray-500" />
|
|
353
350
|
</button>
|
|
354
351
|
</div>
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
author={<a> {t('messenger_box_browser.system')} </a>}
|
|
363
|
-
avatar={
|
|
364
|
-
<Avatar style={{ background: 'gray' }}>
|
|
365
|
-
<MdOutlineDesktopMac
|
|
366
|
-
style={{ marginTop: '4px', width: '24px', height: '25px' }}
|
|
367
|
-
/>
|
|
368
|
-
</Avatar>
|
|
369
|
-
}
|
|
370
|
-
content={
|
|
371
|
-
<>
|
|
372
|
-
<p>
|
|
373
|
-
<a>{item.message.split(' ')[0]}</a>` $
|
|
374
|
-
{item.message.split(' ').splice(1).join(' ')}
|
|
375
|
-
</p>
|
|
376
|
-
</>
|
|
377
|
-
}
|
|
378
|
-
datetime={
|
|
379
|
-
<div>
|
|
380
|
-
<span>{Moment(item.createdAt).format('HH:mm A')}</span>
|
|
381
|
-
</div>
|
|
382
|
-
}
|
|
383
|
-
/>
|
|
384
|
-
) : (
|
|
385
|
-
<Comment
|
|
386
|
-
className="chat-cmt"
|
|
387
|
-
// actions={actions}
|
|
388
|
-
// author={<a>{item.author !== null?item.author.username:'User'}</a>}
|
|
389
|
-
author={<a>{item.author ? item.author.username : 'user'}</a>}
|
|
390
|
-
avatar={
|
|
391
|
-
<Popover
|
|
392
|
-
placement="right"
|
|
393
|
-
title={<a>{'@' + item.author.username}</a>}
|
|
394
|
-
content={
|
|
395
|
-
<div
|
|
396
|
-
style={{
|
|
397
|
-
display: 'flex',
|
|
398
|
-
flexDirection: 'column',
|
|
399
|
-
}}
|
|
400
|
-
>
|
|
401
|
-
<Avatar
|
|
402
|
-
size="large"
|
|
403
|
-
style={{
|
|
404
|
-
backgroundColor: 'red',
|
|
405
|
-
marginBottom: '15px',
|
|
406
|
-
marginLeft: '25px',
|
|
407
|
-
alignItems: 'center',
|
|
408
|
-
}}
|
|
409
|
-
>
|
|
410
|
-
{item.author.username
|
|
411
|
-
.match(/\b(\w)/g)
|
|
412
|
-
.join('')
|
|
413
|
-
.toUpperCase()}
|
|
414
|
-
</Avatar>
|
|
415
|
-
<p style={{ fontWeight: 'bold' }}>{item.author.username}</p>
|
|
416
|
-
{/*<p>Survey bot collects your..</p>*/}
|
|
417
|
-
<div>
|
|
418
|
-
<h5>
|
|
419
|
-
{t('messenger_box_browser.local_time')}
|
|
420
|
-
<span>{Moment(item.createdAt).format('HH:mm A')}</span>
|
|
421
|
-
</h5>
|
|
422
|
-
</div>
|
|
423
|
-
<a className="icon-popover">
|
|
424
|
-
<BiPaperPlane
|
|
425
|
-
style={{ fontSize: '15px', marginRight: '3px' }}
|
|
426
|
-
/>
|
|
427
|
-
{t('messenger_box_browser.send_message')}
|
|
428
|
-
</a>
|
|
429
|
-
</div>
|
|
430
|
-
}
|
|
431
|
-
trigger="click"
|
|
352
|
+
|
|
353
|
+
{/* Message Content */}
|
|
354
|
+
<div className="flex space-x-3">
|
|
355
|
+
<div className="flex-shrink-0">
|
|
356
|
+
<div
|
|
357
|
+
className="w-10 h-10 rounded-full flex items-center justify-center text-white"
|
|
358
|
+
style={{ backgroundColor: msgClr[item.author.username] }}
|
|
432
359
|
>
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
['gif', 'png', 'bmp', 'jpeg', 'jpg'].includes(file.extension)
|
|
448
|
-
) {
|
|
449
|
-
return (
|
|
450
|
-
<div className="msg_img_preview">
|
|
451
|
-
<div className="options_style">
|
|
452
|
-
<MdOutlineCloudDownload
|
|
453
|
-
onClick={() => handleDownload(file.id)}
|
|
454
|
-
/>
|
|
455
|
-
<RiShareForwardLine />
|
|
456
|
-
<BiDotsVerticalRounded />
|
|
457
|
-
</div>
|
|
458
|
-
<img
|
|
459
|
-
src={file.url}
|
|
460
|
-
className="preview_img_style"
|
|
461
|
-
onClick={(e) => handleShowPreview(file, item)}
|
|
462
|
-
></img>
|
|
463
|
-
<a
|
|
464
|
-
href={file.url}
|
|
465
|
-
download={file.name}
|
|
466
|
-
id={file.id}
|
|
467
|
-
style={{ display: 'none' }}
|
|
468
|
-
></a>
|
|
469
|
-
</div>
|
|
470
|
-
);
|
|
471
|
-
}
|
|
472
|
-
})
|
|
473
|
-
: ''}
|
|
474
|
-
{emoji && item.id === id
|
|
475
|
-
? emoji.map((e, index) => {
|
|
476
|
-
return (
|
|
477
|
-
<button
|
|
478
|
-
className="reactionClass"
|
|
479
|
-
onClick={() => {
|
|
480
|
-
removeEmoji(index);
|
|
481
|
-
}}
|
|
482
|
-
>
|
|
483
|
-
{e}
|
|
484
|
-
<span>1</span>
|
|
485
|
-
</button>
|
|
486
|
-
);
|
|
487
|
-
})
|
|
488
|
-
: ''}
|
|
489
|
-
{emoji.length && item.id === id ? (
|
|
490
|
-
<button
|
|
491
|
-
style={{
|
|
492
|
-
border: '0px',
|
|
493
|
-
fontSize: '20px',
|
|
494
|
-
padding: '2px',
|
|
495
|
-
position: 'absolute',
|
|
496
|
-
}}
|
|
497
|
-
>
|
|
498
|
-
<MdOutlineAddReaction fill="gray" />
|
|
499
|
-
</button>
|
|
500
|
-
) : (
|
|
501
|
-
''
|
|
502
|
-
)}
|
|
503
|
-
</>
|
|
504
|
-
}
|
|
505
|
-
datetime={
|
|
506
|
-
// <Tooltip title={Moment().format('YYYY-MM-DD HH:mm:ss')}>
|
|
507
|
-
<div>
|
|
508
|
-
{/*<span>{Moment().fromNow()}</span>*/}
|
|
509
|
-
<span>{Moment(item.createdAt).format('HH:mm A')}</span>
|
|
360
|
+
{item.author.username
|
|
361
|
+
.match(/\b(\w)/g)
|
|
362
|
+
.join('')
|
|
363
|
+
.toUpperCase()}
|
|
364
|
+
</div>
|
|
365
|
+
</div>
|
|
366
|
+
<div className="flex-1 min-w-0">
|
|
367
|
+
<div className="flex items-center space-x-2">
|
|
368
|
+
<span className="font-medium text-gray-900">
|
|
369
|
+
{item.author ? item.author.username : 'user'}
|
|
370
|
+
</span>
|
|
371
|
+
<span className="text-sm text-gray-500">
|
|
372
|
+
{Moment(item.createdAt).format('HH:mm A')}
|
|
373
|
+
</span>
|
|
510
374
|
</div>
|
|
511
|
-
|
|
512
|
-
}
|
|
513
|
-
/>
|
|
514
|
-
)}
|
|
515
|
-
</Col>
|
|
516
|
-
);
|
|
517
|
-
// } else {
|
|
518
|
-
// return (
|
|
519
|
-
// <Col
|
|
520
|
-
// md={24}
|
|
521
|
-
// key={index}
|
|
522
|
-
// className={css(styleSheet3.customStyleDemo as any)}
|
|
523
|
-
// style={item?.isPin ? styles : null}
|
|
524
|
-
// >
|
|
525
|
-
// {displayEmoji && msgIndex === index ?
|
|
526
|
-
// <Picker
|
|
527
|
-
// onSelect={handleOnSelect}
|
|
528
|
-
// native={true}
|
|
529
|
-
// set="apple"
|
|
530
|
-
// emoji="point_up"
|
|
531
|
-
// title="Pick your emoji..."
|
|
532
|
-
// emojiSize={24}
|
|
533
|
-
// perLine={6}
|
|
534
|
-
// color="#ae65c5"
|
|
535
|
-
// sheetSize={16}
|
|
536
|
-
// showPreview={true}
|
|
537
|
-
// showSkinTones={false}
|
|
538
|
-
// notFoundEmoji="sleuth_or_spy"
|
|
539
|
-
// /> : ''
|
|
540
|
-
// }
|
|
541
|
-
// <div className="btn-hover">
|
|
542
|
-
// <div className="hover_btns">
|
|
543
|
-
// <button>
|
|
544
|
-
// <BiDotsHorizontalRounded
|
|
545
|
-
// fontSize="16px"
|
|
546
|
-
// fill="gray"
|
|
547
|
-
// onClick={() => setShowMoreAction(!showMoreAction)}
|
|
548
|
-
// />
|
|
549
|
-
// {showMoreAction ? (
|
|
550
|
-
// <MoreAction
|
|
551
|
-
// handleShowSideBar={handleShowSideBar}
|
|
552
|
-
// handleDeleteMessage={handleDeleteMessage}
|
|
553
|
-
// id={item.id}
|
|
554
|
-
// handlePinBtn={handlePinBtn}
|
|
555
|
-
// pinMessage={pinMessage}
|
|
556
|
-
// />
|
|
557
|
-
// ) : null}
|
|
558
|
-
// </button>
|
|
559
|
-
// <button onClick={() => emojiClick(index)}>
|
|
560
|
-
// <MdOutlineEmojiEmotions fontSize="16px" fill="gray"/>
|
|
561
|
-
// </button>
|
|
562
|
-
// <button>
|
|
563
|
-
// <IoBookmarkOutline fontSize="16px" color="gray"/>
|
|
564
|
-
// </button>
|
|
565
|
-
// <button onClick={handleShowSideBar}>
|
|
566
|
-
// <BsReply fontSize="16px" fill="gray"/>
|
|
567
|
-
// </button>
|
|
568
|
-
// </div>
|
|
569
|
-
// </div>
|
|
570
|
-
// {
|
|
571
|
-
// item.timeIsToday ?
|
|
572
|
-
// !separatorDisplaying ?
|
|
573
|
-
// <>
|
|
574
|
-
// <div className="text-divider">Today</div>
|
|
575
|
-
// {separatorDisplaying = true}
|
|
576
|
-
// </>: '' : ''
|
|
577
|
-
// }
|
|
578
|
-
// <Comment
|
|
579
|
-
// // actions={actions}
|
|
580
|
-
// author={<a>{getUserAccount?.username}</a>}
|
|
581
|
-
// avatar={
|
|
582
|
-
// <Popover
|
|
583
|
-
// placement="right"
|
|
584
|
-
// title={<a>{'@' + getUserAccount.username}</a>}
|
|
585
|
-
// content={
|
|
586
|
-
// <div
|
|
587
|
-
// style={{
|
|
588
|
-
// display: 'flex',
|
|
589
|
-
// flexDirection: 'column',
|
|
590
|
-
// alignItems: 'center',
|
|
591
|
-
// }}
|
|
592
|
-
// >
|
|
593
|
-
// <Avatar
|
|
594
|
-
// size={{xxl: 100}}
|
|
595
|
-
// style={{
|
|
596
|
-
// backgroundColor: 'blue',
|
|
597
|
-
// textTransform: 'uppercase',
|
|
598
|
-
// fontSize: '50px',
|
|
599
|
-
// marginBottom: '15px',
|
|
600
|
-
// }}
|
|
601
|
-
// >
|
|
602
|
-
// {getUserAccount?.username.substring(0, 1)}
|
|
603
|
-
// </Avatar>
|
|
604
|
-
// <a>{getUserAccount?.email}</a>
|
|
605
|
-
// <div>
|
|
606
|
-
// <h5>
|
|
607
|
-
// Local Time <span>{Moment().format('HH:mm A')}</span>
|
|
608
|
-
// </h5>
|
|
609
|
-
// </div>
|
|
610
|
-
// <a
|
|
611
|
-
// className="icon-popover"
|
|
612
|
-
// style={{display: 'flex', justifyContent: 'c'}}
|
|
613
|
-
// >
|
|
614
|
-
// <BiEdit style={{fontSize: '15px', marginRight: '3px'}}/>
|
|
615
|
-
// Edit Account Setting
|
|
616
|
-
// </a>
|
|
617
|
-
// </div>
|
|
618
|
-
// }
|
|
619
|
-
// trigger="click"
|
|
620
|
-
// >
|
|
621
|
-
// <Avatar style={{backgroundColor: 'blue', textTransform: 'uppercase'}}>
|
|
622
|
-
// {getUserAccount?.username.substring(0, 1)}
|
|
623
|
-
// </Avatar>
|
|
624
|
-
// </Popover>
|
|
625
|
-
// }
|
|
626
|
-
// content={<p>{item?.message}</p>}
|
|
627
|
-
// datetime={
|
|
628
|
-
// // <Tooltip title={Moment().format('YYYY-MM-DD HH:mm:ss')}>
|
|
629
|
-
// <div>
|
|
630
|
-
// {/*<span>{Moment().fromNow()}</span>*/}
|
|
631
|
-
// <span>{Moment().format('HH:mm A')} </span>
|
|
632
|
-
// </div>
|
|
633
|
-
// /*</Tooltip>*/
|
|
634
|
-
// }
|
|
635
|
-
// />
|
|
636
|
-
// </Col>
|
|
637
|
-
// );
|
|
638
|
-
// }
|
|
639
|
-
})}
|
|
640
|
-
</Row>
|
|
375
|
+
<p className="mt-1 text-gray-900">{item.message}</p>
|
|
641
376
|
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
377
|
+
{/* Files/Images */}
|
|
378
|
+
{item.files.totalCount > 0 && (
|
|
379
|
+
<div className="mt-2 space-y-2">
|
|
380
|
+
{item.files.data.map((file) => {
|
|
381
|
+
if (['gif', 'png', 'bmp', 'jpeg', 'jpg'].includes(file.extension)) {
|
|
382
|
+
return (
|
|
383
|
+
<div key={file.id} className="relative group">
|
|
384
|
+
<img
|
|
385
|
+
src={file.url}
|
|
386
|
+
alt={file.name}
|
|
387
|
+
className="max-w-md rounded-lg cursor-pointer"
|
|
388
|
+
onClick={() => handleShowPreview(file, item)}
|
|
389
|
+
/>
|
|
390
|
+
<div className="hidden group-hover:flex absolute top-2 right-2 space-x-2">
|
|
391
|
+
<button
|
|
392
|
+
className="p-1 bg-black bg-opacity-50 rounded-full text-white hover:bg-opacity-70"
|
|
393
|
+
onClick={() => handleDownload(file.id)}
|
|
394
|
+
>
|
|
395
|
+
<MdCloudDownload />
|
|
396
|
+
</button>
|
|
397
|
+
<button className="p-1 bg-black bg-opacity-50 rounded-full text-white hover:bg-opacity-70">
|
|
398
|
+
<RiShareForwardLine />
|
|
399
|
+
</button>
|
|
400
|
+
<button className="p-1 bg-black bg-opacity-50 rounded-full text-white hover:bg-opacity-70">
|
|
401
|
+
<BiDotsVerticalRounded />
|
|
402
|
+
</button>
|
|
403
|
+
</div>
|
|
404
|
+
<a
|
|
405
|
+
href={file.url}
|
|
406
|
+
download={file.name}
|
|
407
|
+
id={file.id}
|
|
408
|
+
className="hidden"
|
|
409
|
+
/>
|
|
410
|
+
</div>
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
return null;
|
|
414
|
+
})}
|
|
415
|
+
</div>
|
|
416
|
+
)}
|
|
417
|
+
|
|
418
|
+
{/* Reactions */}
|
|
419
|
+
{emoji && item.id === id && (
|
|
420
|
+
<div className="mt-2 flex flex-wrap gap-2">
|
|
421
|
+
{emoji.map((e, index) => (
|
|
422
|
+
<button
|
|
423
|
+
key={index}
|
|
424
|
+
className="inline-flex items-center px-2 py-1 rounded-full bg-gray-100 hover:bg-gray-200"
|
|
425
|
+
onClick={() => removeEmoji(index)}
|
|
426
|
+
>
|
|
427
|
+
{e}
|
|
428
|
+
<span className="ml-1 text-xs text-gray-600">1</span>
|
|
429
|
+
</button>
|
|
430
|
+
))}
|
|
431
|
+
{emoji.length > 0 && (
|
|
432
|
+
<button className="p-1 text-gray-500 hover:text-gray-700">
|
|
433
|
+
<MdFavoriteBorder />
|
|
434
|
+
</button>
|
|
435
|
+
)}
|
|
436
|
+
</div>
|
|
437
|
+
)}
|
|
438
|
+
</div>
|
|
439
|
+
</div>
|
|
440
|
+
</div>
|
|
441
|
+
);
|
|
442
|
+
})}
|
|
443
|
+
</div>
|
|
444
|
+
</div>
|
|
445
|
+
|
|
446
|
+
{/* Image Preview Modal */}
|
|
447
|
+
<Modal show={showPreview} onHide={() => setShowPreview(false)} className="max-w-4xl mx-auto">
|
|
448
|
+
<div className="bg-gray-900 text-white p-4">
|
|
449
|
+
<div className="flex items-center justify-between">
|
|
450
|
+
<div className="flex items-center space-x-4">
|
|
451
|
+
<div className="w-10 h-10 rounded-full bg-gray-700 flex items-center justify-center">
|
|
651
452
|
{clickedImage.msgDetail?.author.username
|
|
652
453
|
.match(/\b(\w)/g)
|
|
653
454
|
.join('')
|
|
654
455
|
.toUpperCase()}
|
|
655
456
|
</div>
|
|
656
|
-
<div
|
|
657
|
-
<h4>{clickedImage.msgDetail?.author.username}</h4>
|
|
658
|
-
<p>{clickedImage.file?.name}</p>
|
|
457
|
+
<div>
|
|
458
|
+
<h4 className="font-medium">{clickedImage.msgDetail?.author.username}</h4>
|
|
459
|
+
<p className="text-sm text-gray-300">{clickedImage.file?.name}</p>
|
|
659
460
|
</div>
|
|
660
461
|
</div>
|
|
661
|
-
<
|
|
662
|
-
|
|
462
|
+
<button className="text-gray-300 hover:text-white" onClick={() => setShowPreview(false)}>
|
|
463
|
+
<GrClose />
|
|
464
|
+
</button>
|
|
465
|
+
</div>
|
|
663
466
|
</div>
|
|
664
|
-
<div className="
|
|
665
|
-
<
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
467
|
+
<div className="bg-black flex items-center justify-center p-4">
|
|
468
|
+
<img
|
|
469
|
+
src={clickedImage.file?.url}
|
|
470
|
+
alt={clickedImage.file?.name}
|
|
471
|
+
className="max-h-[80vh] object-contain"
|
|
472
|
+
/>
|
|
670
473
|
</div>
|
|
671
|
-
<div className="
|
|
672
|
-
<
|
|
673
|
-
<p>{t('messenger_box_browser.working')}</p>
|
|
674
|
-
</Modal.Footer>
|
|
474
|
+
<div className="bg-gray-900 text-white p-4">
|
|
475
|
+
<p>{t('messenger_box_browser.working')}</p>
|
|
675
476
|
</div>
|
|
676
477
|
</Modal>
|
|
677
478
|
</div>
|
|
678
479
|
);
|
|
679
480
|
};
|
|
680
|
-
|
|
681
|
-
// export const ThreadMessagesList: FC<IProps> = ({ userMessagesList, handleShowSideBar }) => {
|
|
682
|
-
//
|
|
683
|
-
// return <></>;
|
|
684
|
-
// return (
|
|
685
|
-
// <div>
|
|
686
|
-
// <Row className={css(styleSheet3.customStyle as any)}>
|
|
687
|
-
// {userMessagesList?.map((item: IMessageList, index: number) => {
|
|
688
|
-
// if (!item.loginUser) {
|
|
689
|
-
// return (
|
|
690
|
-
// <Col md={24} key={index} className={css(styleSheet3.customStyleDemo as any)}>
|
|
691
|
-
// <div className="btn-hover">
|
|
692
|
-
// <div className="hover_btns">
|
|
693
|
-
// <button>
|
|
694
|
-
// <BiDotsHorizontalRounded fontSize="16px" fill="gray"/>
|
|
695
|
-
// </button>
|
|
696
|
-
// <button>
|
|
697
|
-
// <MdOutlineEmojiEmotions fontSize="16px" fill="gray"/>
|
|
698
|
-
// </button>
|
|
699
|
-
// <button>
|
|
700
|
-
// <IoBookmarkOutline fontSize="16px" color="gray"/>
|
|
701
|
-
// </button>
|
|
702
|
-
// </div>
|
|
703
|
-
// </div>
|
|
704
|
-
// <div className="text-divider">Text h.biu guu divider</div>
|
|
705
|
-
// <Comment
|
|
706
|
-
// className="chat-cmt"
|
|
707
|
-
// // actions={actions}
|
|
708
|
-
// author={<a>Slack Bot</a>}
|
|
709
|
-
// avatar={
|
|
710
|
-
// <Avatar style={{backgroundColor: 'black'}}>
|
|
711
|
-
// <FaRobot style={{marginTop: '4px'}} fontSize="20px" fill="white"/>
|
|
712
|
-
// </Avatar>
|
|
713
|
-
// }
|
|
714
|
-
// content={<p>{item?.message}</p>}
|
|
715
|
-
// datetime={
|
|
716
|
-
// // <Tooltip title={Moment().format('YYYY-MM-DD HH:mm:ss')}>
|
|
717
|
-
// <div>
|
|
718
|
-
// {/*<span>{Moment().fromNow()}</span>*/}
|
|
719
|
-
// <span>{Moment().format('HH:mm A')}</span>
|
|
720
|
-
// </div>
|
|
721
|
-
// /*</Tooltip>*/
|
|
722
|
-
// }
|
|
723
|
-
// ></Comment>
|
|
724
|
-
// </Col>
|
|
725
|
-
// );
|
|
726
|
-
// } else {
|
|
727
|
-
// return (
|
|
728
|
-
// <Col md={24} key={index} className={css(styleSheet3.customStyleDemo as any)}>
|
|
729
|
-
// <div className="btn-hover">
|
|
730
|
-
// <div className="hover_btns">
|
|
731
|
-
// <button>
|
|
732
|
-
// <BiDotsHorizontalRounded fontSize="16px" fill="gray"/>
|
|
733
|
-
// </button>
|
|
734
|
-
// <button>
|
|
735
|
-
// <MdOutlineEmojiEmotions fontSize="16px" fill="gray"/>
|
|
736
|
-
// </button>
|
|
737
|
-
// <button>
|
|
738
|
-
// <IoBookmarkOutline fontSize="16px" color="gray"/>
|
|
739
|
-
// </button>
|
|
740
|
-
// </div>
|
|
741
|
-
// </div>
|
|
742
|
-
// <div className="text-divider">Text h.biu guu divider</div>
|
|
743
|
-
// <Comment
|
|
744
|
-
// // actions={actions}
|
|
745
|
-
// author={<a>Han Solo</a>}
|
|
746
|
-
// avatar={<Avatar style={{backgroundColor: 'blue'}}>HS</Avatar>}
|
|
747
|
-
// content={<p>{item?.message}</p>}
|
|
748
|
-
// datetime={
|
|
749
|
-
// // <Tooltip title={Moment().format('YYYY-MM-DD HH:mm:ss')}>
|
|
750
|
-
// <div>
|
|
751
|
-
// {/*<span>{Moment().fromNow()}</span>*/}
|
|
752
|
-
// <span>{Moment().format('HH:mm A')} </span>
|
|
753
|
-
// </div>
|
|
754
|
-
// /*</Tooltip>*/
|
|
755
|
-
// }
|
|
756
|
-
// ></Comment>
|
|
757
|
-
// </Col>
|
|
758
|
-
// );
|
|
759
|
-
// }
|
|
760
|
-
// })}
|
|
761
|
-
// </Row>
|
|
762
|
-
// </div>
|
|
763
|
-
// );
|
|
764
|
-
// };
|