@messenger-box/platform-browser 10.0.3-alpha.56 → 10.0.3-alpha.62
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 +8 -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 +173 -453
- 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/containers/Dashboard.d.ts.map +1 -1
- package/lib/containers/Dashboard.js +86 -112
- 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 +54 -93
- package/src/components/InboxMessage/MessagesList/index.tsx +69 -81
- package/src/components/InboxMessage/Popover/index.tsx +14 -38
- package/src/components/InboxMessage/UserModalContent/index.tsx +39 -42
- package/src/components/InboxMessage/index.tsx +50 -65
- package/src/components/dashboard/menu_header.tsx +50 -43
- package/src/components/dashboard/modals/direct_modal.tsx +72 -39
- package/src/components/dashboard/modals.tsx +113 -104
- package/src/components/messenger/avatar/index.tsx +27 -13
- package/src/components/messenger/index.tsx +124 -159
- package/src/components/messenger/messagesList/index.tsx +266 -557
- 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 +45 -173
- package/src/components/messenger/threadSidebar/index.tsx +86 -73
- 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 +103 -195
- package/src/components/post/index.tsx +69 -94
- 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/containers/Dashboard.tsx +119 -184
- package/src/containers/DashboardWithLoader.tsx +12 -4
- 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,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { styleSheet } from '../style';
|
|
3
2
|
import { IntlProvider } from 'react-intl';
|
|
4
3
|
import {
|
|
5
4
|
useAddChannelMutation,
|
|
@@ -10,13 +9,10 @@ import {
|
|
|
10
9
|
import { MenuHeader } from '../components/dashboard/menu_header';
|
|
11
10
|
import { Modals } from '../components/dashboard/modals';
|
|
12
11
|
import { DirectModal } from '../components/dashboard/modals/direct_modal';
|
|
13
|
-
import { css } from '@emotion/css';
|
|
14
12
|
import { BsGlobe2 } from 'react-icons/bs';
|
|
15
13
|
import { useTranslation } from 'react-i18next';
|
|
16
14
|
import { RiAdminFill } from 'react-icons/ri';
|
|
17
15
|
import { useEffect, useState } from 'react';
|
|
18
|
-
import { Avatar } from 'antd';
|
|
19
|
-
import { Comment } from '@ant-design/compatible';
|
|
20
16
|
import { indexOf } from 'lodash-es';
|
|
21
17
|
import { useSelector } from 'react-redux';
|
|
22
18
|
import { Routes, Route, Link, useNavigate, useLocation } from '@remix-run/react';
|
|
@@ -27,7 +23,6 @@ const Messenger = React.lazy(() => import('./Messenger'));
|
|
|
27
23
|
const Dashboard: React.FC = (props: any) => {
|
|
28
24
|
const [allUsers, usersToChat, currentUserRes, allChannels, getChannel] = props?.data;
|
|
29
25
|
const [channelInput, setChannelInput] = useState<any>({});
|
|
30
|
-
// const [channels, setChannels] = useState([]);
|
|
31
26
|
const [publicChannels, setPublicChannels] = useState([]);
|
|
32
27
|
const [directChannels, setDirectChannels] = useState([]);
|
|
33
28
|
const [clickedChannel, setClickedChannel] = useState<any>({});
|
|
@@ -37,10 +32,7 @@ const Dashboard: React.FC = (props: any) => {
|
|
|
37
32
|
const [selectedValues, setSelectedValues] = useState<any>([]);
|
|
38
33
|
const [directMoreModal, setDirectMoreModal] = useState<any>({ showDirectMore: false, modalPublicChannels: [] });
|
|
39
34
|
const [publicChlModal, setPublicChlModal] = useState<any>({ show: false });
|
|
40
|
-
const [
|
|
41
|
-
left_bar: 'left_bar',
|
|
42
|
-
root_div: 'root_div',
|
|
43
|
-
});
|
|
35
|
+
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
|
|
44
36
|
|
|
45
37
|
const currentUserAuth0Id = useSelector((state: any) => state.user.authUserId);
|
|
46
38
|
|
|
@@ -48,11 +40,7 @@ const Dashboard: React.FC = (props: any) => {
|
|
|
48
40
|
const location = useLocation();
|
|
49
41
|
const { t } = useTranslation();
|
|
50
42
|
|
|
51
|
-
// const allUsers = useGetAllUsersQuery()
|
|
52
|
-
// const usersToChat = useUsersToChatQuery({ variables: { auth0Id: currentUserAuth0Id } })
|
|
53
|
-
// const currentUserRes = useCurrentUserQuery({ variables: { auth0Id: currentUserAuth0Id } })
|
|
54
43
|
const { data, loading, error, refetch } = getChannel;
|
|
55
|
-
// const allChannels = useGetAllChannelQuery()
|
|
56
44
|
const [addMemberToChannelMutationInput, addMemberToChannelMutationResponse] = useAddMemberToChannelMutation({
|
|
57
45
|
update: (cache, mutationResult) => {
|
|
58
46
|
cache.modify({
|
|
@@ -133,7 +121,6 @@ const Dashboard: React.FC = (props: any) => {
|
|
|
133
121
|
},
|
|
134
122
|
}).then((response) => {
|
|
135
123
|
setClickedChannel(response.data.addMemberToChannel);
|
|
136
|
-
// setShowDirectMore(false)
|
|
137
124
|
setDirectMoreModal({ ...directMoreModal, showDirectMore: false });
|
|
138
125
|
sendMessagesMutationInput({
|
|
139
126
|
variables: {
|
|
@@ -143,15 +130,9 @@ const Dashboard: React.FC = (props: any) => {
|
|
|
143
130
|
},
|
|
144
131
|
});
|
|
145
132
|
});
|
|
146
|
-
// refetch().then((value => {
|
|
147
|
-
// setChannels(value.data.channelsByUser)
|
|
148
|
-
// setChannelInput({})
|
|
149
|
-
// }))
|
|
150
|
-
// allChannels.refetch()
|
|
151
133
|
};
|
|
152
134
|
|
|
153
135
|
const handleGo = () => {
|
|
154
|
-
// console.log('------directModal------', directModal)
|
|
155
136
|
if (selectedValues) {
|
|
156
137
|
let uids = [];
|
|
157
138
|
let dName = currentUser.username + ',';
|
|
@@ -191,24 +172,23 @@ const Dashboard: React.FC = (props: any) => {
|
|
|
191
172
|
tempOpt.push({
|
|
192
173
|
value: { username: `${usr.username}`, uid: `${usr.id}` },
|
|
193
174
|
label: (
|
|
194
|
-
<div
|
|
195
|
-
<
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/>
|
|
175
|
+
<div className="flex items-center space-x-4 p-2 hover:bg-gray-50 cursor-pointer">
|
|
176
|
+
<div className="flex-shrink-0">
|
|
177
|
+
<div
|
|
178
|
+
className={`w-10 h-10 rounded-full flex items-center justify-center text-white bg-[#${Math.floor(
|
|
179
|
+
Math.random() * 16777215,
|
|
180
|
+
).toString(16)}]`}
|
|
181
|
+
>
|
|
182
|
+
{usr.username
|
|
183
|
+
.match(/\b(\w)/g)
|
|
184
|
+
.join('')
|
|
185
|
+
.toUpperCase()}
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
<div className="flex-1 min-w-0">
|
|
189
|
+
<p className="text-sm font-medium text-gray-900">@{usr.username}</p>
|
|
190
|
+
<p className="text-sm text-gray-500 truncate">{usr.email}</p>
|
|
191
|
+
</div>
|
|
212
192
|
</div>
|
|
213
193
|
),
|
|
214
194
|
});
|
|
@@ -217,9 +197,7 @@ const Dashboard: React.FC = (props: any) => {
|
|
|
217
197
|
}
|
|
218
198
|
}, [usersToChat.data, usersToChat.loading]);
|
|
219
199
|
|
|
220
|
-
const refetchCall = () => {
|
|
221
|
-
// setClickedChannel({})
|
|
222
|
-
};
|
|
200
|
+
const refetchCall = () => {};
|
|
223
201
|
|
|
224
202
|
useEffect(() => {
|
|
225
203
|
if (!loading) {
|
|
@@ -258,9 +236,7 @@ const Dashboard: React.FC = (props: any) => {
|
|
|
258
236
|
}
|
|
259
237
|
});
|
|
260
238
|
}
|
|
261
|
-
// setChannels([...data.channelsByUser, ...fChannel])
|
|
262
239
|
setPublicChannels(joinedChannel);
|
|
263
|
-
// setModalPublicChannels(modelChannel)
|
|
264
240
|
setDirectMoreModal({ ...directMoreModal, modalPublicChannels: modelChannel });
|
|
265
241
|
setDirectChannels([
|
|
266
242
|
...data.channelsByUser.filter((chl) => chl.type === 'DIRECT'),
|
|
@@ -317,15 +293,7 @@ const Dashboard: React.FC = (props: any) => {
|
|
|
317
293
|
}, [addedDirectChannel.loading, addedDirectChannel.data]);
|
|
318
294
|
|
|
319
295
|
const handleClass = () => {
|
|
320
|
-
|
|
321
|
-
if (!oldClasses.left_bar.split(' ').includes('drawer_style')) {
|
|
322
|
-
setClasses({
|
|
323
|
-
left_bar: `${oldClasses.left_bar} drawer_style`,
|
|
324
|
-
root_div: `${oldClasses.root_div} clicked_class`,
|
|
325
|
-
});
|
|
326
|
-
} else {
|
|
327
|
-
setClasses({ left_bar: 'left_bar', root_div: 'root_div' });
|
|
328
|
-
}
|
|
296
|
+
setIsDrawerOpen(!isDrawerOpen);
|
|
329
297
|
};
|
|
330
298
|
|
|
331
299
|
const handleSelect = (selectedOption) => {
|
|
@@ -337,14 +305,14 @@ const Dashboard: React.FC = (props: any) => {
|
|
|
337
305
|
}, []);
|
|
338
306
|
|
|
339
307
|
return (
|
|
340
|
-
<div className=
|
|
341
|
-
<div className={
|
|
308
|
+
<div className="min-h-screen bg-gray-50">
|
|
309
|
+
<div className={`flex h-screen ${isDrawerOpen ? 'drawer-open' : ''}`}>
|
|
342
310
|
<DirectModal
|
|
343
|
-
|
|
311
|
+
show={showDirectChl}
|
|
312
|
+
onHide={() => handleClose('directChannel')}
|
|
344
313
|
handleGo={handleGo}
|
|
345
314
|
handleSelect={handleSelect}
|
|
346
315
|
selectedValues={selectedValues}
|
|
347
|
-
showDirectChl={showDirectChl}
|
|
348
316
|
options={options}
|
|
349
317
|
/>
|
|
350
318
|
<Modals
|
|
@@ -356,55 +324,53 @@ const Dashboard: React.FC = (props: any) => {
|
|
|
356
324
|
/>
|
|
357
325
|
<MenuHeader clickedChannel={clickedChannel} handleClass={handleClass} />
|
|
358
326
|
<div
|
|
359
|
-
className="
|
|
327
|
+
className="flex-1 flex overflow-hidden"
|
|
360
328
|
onClick={() => {
|
|
361
|
-
if (
|
|
329
|
+
if (isDrawerOpen) {
|
|
362
330
|
handleClass();
|
|
363
331
|
}
|
|
364
332
|
}}
|
|
365
333
|
>
|
|
366
|
-
<div
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
334
|
+
<div
|
|
335
|
+
className={`w-64 flex-shrink-0 bg-gray-800 overflow-y-auto transition-transform duration-300 ease-in-out ${
|
|
336
|
+
isDrawerOpen ? 'translate-x-0' : '-translate-x-full md:translate-x-0'
|
|
337
|
+
}`}
|
|
338
|
+
>
|
|
339
|
+
<div className="flex flex-col h-full">
|
|
340
|
+
<div className="space-y-4 py-4">
|
|
341
|
+
<div className="px-4">
|
|
342
|
+
<h4 className="text-gray-400 uppercase text-sm font-semibold flex justify-between items-center">
|
|
371
343
|
<span>{t('messenger_box_browser.PUBLIC_CHANNELS')}</span>
|
|
344
|
+
<button
|
|
345
|
+
className="text-gray-400 hover:text-white w-6 h-6 rounded flex items-center justify-center hover:bg-gray-700"
|
|
346
|
+
onClick={() => handleShow('publicChannel', 'Public Channel')}
|
|
347
|
+
>
|
|
348
|
+
<span>+</span>
|
|
349
|
+
</button>
|
|
372
350
|
</h4>
|
|
373
|
-
<
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
</button>
|
|
379
|
-
</li>
|
|
380
|
-
{/*{publicChannels.filter((item, index) => index < 3).map((chl, index) => {*/}
|
|
381
|
-
{publicChannels.map((chl, index) => {
|
|
382
|
-
return (
|
|
383
|
-
<Link
|
|
384
|
-
to={{
|
|
385
|
-
pathname: `/o/${location.pathname.split('/')[2]}/dashboard/channel/${
|
|
351
|
+
<ul className="mt-2 space-y-1">
|
|
352
|
+
{publicChannels.map((chl, index) => (
|
|
353
|
+
<Link
|
|
354
|
+
key={chl.id}
|
|
355
|
+
to={`/o/${location.pathname.split('/')[2]}/dashboard/channel/${
|
|
386
356
|
chl.title
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
);
|
|
403
|
-
})}
|
|
404
|
-
<li>
|
|
357
|
+
}`}
|
|
358
|
+
state={{ channel: chl, currentUser: currentUserRes.data.currentUser }}
|
|
359
|
+
>
|
|
360
|
+
<li className="group">
|
|
361
|
+
<a
|
|
362
|
+
className="flex items-center px-2 py-2 text-gray-300 rounded-md hover:bg-gray-700 hover:text-white group-hover:bg-gray-700"
|
|
363
|
+
onClick={() => handleChannelClick(chl)}
|
|
364
|
+
>
|
|
365
|
+
<BsGlobe2 className="mr-2 h-5 w-5" />
|
|
366
|
+
<span className="truncate">{chl.title}</span>
|
|
367
|
+
</a>
|
|
368
|
+
</li>
|
|
369
|
+
</Link>
|
|
370
|
+
))}
|
|
371
|
+
</ul>
|
|
405
372
|
<button
|
|
406
|
-
|
|
407
|
-
className="nav-more"
|
|
373
|
+
className="mt-2 text-sm text-gray-400 hover:text-white w-full text-left px-2 py-1"
|
|
408
374
|
onClick={() =>
|
|
409
375
|
setDirectMoreModal({
|
|
410
376
|
...directMoreModal,
|
|
@@ -412,112 +378,81 @@ const Dashboard: React.FC = (props: any) => {
|
|
|
412
378
|
})
|
|
413
379
|
}
|
|
414
380
|
>
|
|
415
|
-
|
|
381
|
+
{t('messenger_box_browser.more')}
|
|
416
382
|
</button>
|
|
417
|
-
</
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
<h4>
|
|
383
|
+
</div>
|
|
384
|
+
|
|
385
|
+
<div className="px-4">
|
|
386
|
+
<h4 className="text-gray-400 uppercase text-sm font-semibold flex justify-between items-center">
|
|
422
387
|
<span>{t('messenger_box_browser.PRIVATE_CHANNELS')}</span>
|
|
388
|
+
<button className="text-gray-400 hover:text-white w-6 h-6 rounded flex items-center justify-center hover:bg-gray-700">
|
|
389
|
+
<span>+</span>
|
|
390
|
+
</button>
|
|
423
391
|
</h4>
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
</ul>
|
|
429
|
-
<ul>
|
|
430
|
-
<li className="sidebar-section__header">
|
|
431
|
-
<h4>
|
|
392
|
+
</div>
|
|
393
|
+
|
|
394
|
+
<div className="px-4">
|
|
395
|
+
<h4 className="text-gray-400 uppercase text-sm font-semibold flex justify-between items-center">
|
|
432
396
|
<span>{t('messenger_box_browser.DIRECT_MESSAGES')}</span>
|
|
397
|
+
<button
|
|
398
|
+
className="text-gray-400 hover:text-white w-6 h-6 rounded flex items-center justify-center hover:bg-gray-700"
|
|
399
|
+
onClick={() => handleShow('directChannel')}
|
|
400
|
+
>
|
|
401
|
+
<span>+</span>
|
|
402
|
+
</button>
|
|
433
403
|
</h4>
|
|
434
|
-
<
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
return (
|
|
440
|
-
<Link
|
|
441
|
-
to={{
|
|
442
|
-
pathname: `/o/${location.pathname.split('/')[2]}/dashboard/message/${
|
|
404
|
+
<ul className="mt-2 space-y-1">
|
|
405
|
+
{directChannels.map((cnl) => (
|
|
406
|
+
<Link
|
|
407
|
+
key={cnl.id}
|
|
408
|
+
to={`/o/${location.pathname.split('/')[2]}/dashboard/message/${
|
|
443
409
|
cnl.displayName.split('_').length === 2
|
|
444
410
|
? cnl.displayName.split('_')[0].split('-')[0] !== currentUser.id
|
|
445
411
|
? cnl.displayName.split('_')[0].split('-')[1]
|
|
446
412
|
: cnl.displayName.split('_')[1].split('-')[1]
|
|
447
413
|
: cnl.title
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
) : (
|
|
474
|
-
<span className="icon icon__globe" color="white">
|
|
475
|
-
<RiAdminFill />
|
|
414
|
+
}`}
|
|
415
|
+
state={{
|
|
416
|
+
channel: cnl,
|
|
417
|
+
currentUser: currentUserRes.data.currentUser,
|
|
418
|
+
}}
|
|
419
|
+
>
|
|
420
|
+
<li className="group">
|
|
421
|
+
<a
|
|
422
|
+
className="flex items-center px-2 py-2 text-gray-300 rounded-md hover:bg-gray-700 hover:text-white group-hover:bg-gray-700"
|
|
423
|
+
onClick={() => handleChannelClick(cnl)}
|
|
424
|
+
>
|
|
425
|
+
{cnl.displayName.split(',').length > 1 ? (
|
|
426
|
+
<span className="w-5 h-5 flex items-center justify-center bg-gray-600 rounded-full text-xs mr-2">
|
|
427
|
+
{cnl.displayName.split(',').length}
|
|
428
|
+
</span>
|
|
429
|
+
) : (
|
|
430
|
+
<RiAdminFill className="mr-2 h-5 w-5" />
|
|
431
|
+
)}
|
|
432
|
+
<span className="truncate">
|
|
433
|
+
{cnl.displayName.split('_').length === 2
|
|
434
|
+
? cnl.displayName.split('_')[0].split('-')[0] !==
|
|
435
|
+
currentUser.id
|
|
436
|
+
? cnl.displayName.split('_')[0].split('-')[1]
|
|
437
|
+
: cnl.displayName.split('_')[1].split('-')[1]
|
|
438
|
+
: cnl.displayName}
|
|
476
439
|
</span>
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
: cnl.displayName.split('_')[1].split('-')[1]
|
|
485
|
-
: cnl.displayName}
|
|
486
|
-
{/*</span>*/}
|
|
487
|
-
</span>
|
|
488
|
-
</a>
|
|
489
|
-
</li>
|
|
490
|
-
|
|
491
|
-
{/*}*/}
|
|
492
|
-
</Link>
|
|
493
|
-
);
|
|
494
|
-
})}
|
|
495
|
-
</ul>
|
|
440
|
+
</a>
|
|
441
|
+
</li>
|
|
442
|
+
</Link>
|
|
443
|
+
))}
|
|
444
|
+
</ul>
|
|
445
|
+
</div>
|
|
446
|
+
</div>
|
|
496
447
|
</div>
|
|
497
448
|
</div>
|
|
498
|
-
<div className="
|
|
449
|
+
<div className="flex-1 overflow-auto bg-white">
|
|
499
450
|
<Routes>
|
|
500
451
|
{dashboardRoutes.map((route, index) => (
|
|
501
|
-
<Route key={index} path={route.path}
|
|
452
|
+
<Route key={index} path={route.path} element={<route.component />} />
|
|
502
453
|
))}
|
|
503
454
|
</Routes>
|
|
504
455
|
</div>
|
|
505
|
-
{/*Add channel Modal*/}
|
|
506
|
-
|
|
507
|
-
{/*{clickedChannel.id ? <div className="main_wraper">*/}
|
|
508
|
-
{/* <IntlProvider locale="en">*/}
|
|
509
|
-
{/* <div className='chat_head_mid'>*/}
|
|
510
|
-
{/* <PostViewPage channel={clickedChannel}*/}
|
|
511
|
-
{/* currentUsrId={currentUser.id}/>*/}
|
|
512
|
-
{/* </div>*/}
|
|
513
|
-
{/* <Messenger channel={clickedChannel} isRefetch={isRefetch}*/}
|
|
514
|
-
{/* currentUsrId={currentUser.id}/>*/}
|
|
515
|
-
{/* </IntlProvider>*/}
|
|
516
|
-
{/* </div>*/}
|
|
517
|
-
{/* : <h2 style={{display: 'flex', alignItems: 'center', margin: '0 auto', color: 'gray'}}>*/}
|
|
518
|
-
{/* Please select any channel*/}
|
|
519
|
-
{/* </h2>*/}
|
|
520
|
-
{/*}*/}
|
|
521
456
|
</div>
|
|
522
457
|
</div>
|
|
523
458
|
</div>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Await } from '@remix-run/react';
|
|
3
|
-
import { Spinner } from '@admin-layout/chakra-ui';
|
|
4
|
-
import { Alert } from '@chakra-ui/react';
|
|
5
3
|
import {
|
|
6
4
|
useGetChannelsByUserQuery,
|
|
7
5
|
useGetAllChannelQuery,
|
|
@@ -25,10 +23,20 @@ const DashboardWithLoader = (props) => {
|
|
|
25
23
|
const allChannels = useGetAllChannelQuery({ variables: {}, fetchPolicy: 'cache-only' });
|
|
26
24
|
|
|
27
25
|
return (
|
|
28
|
-
<React.Suspense
|
|
26
|
+
<React.Suspense
|
|
27
|
+
fallback={
|
|
28
|
+
<div className="flex items-center justify-center w-full h-full">
|
|
29
|
+
<div className="animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-blue-500"></div>
|
|
30
|
+
</div>
|
|
31
|
+
}
|
|
32
|
+
>
|
|
29
33
|
<Await
|
|
30
34
|
resolve={Promise.all([allUsers, usersToChat, currentUserRes, allChannels, getChannel])}
|
|
31
|
-
errorElement={
|
|
35
|
+
errorElement={
|
|
36
|
+
<div className="p-4 mb-4 text-sm text-red-700 bg-red-100 rounded-lg" role="alert">
|
|
37
|
+
Error loading Dashboard page!
|
|
38
|
+
</div>
|
|
39
|
+
}
|
|
32
40
|
>
|
|
33
41
|
<Dashboard data={[allUsers, usersToChat, currentUserRes, allChannels, getChannel]} {...props} />
|
|
34
42
|
</Await>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../src/components/InboxMessage/InboxDetails/style.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EA0BlB,GAAG,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const styleSheet = {
|
|
2
|
-
detailDrawerStyles: {
|
|
3
|
-
width: '100%',
|
|
4
|
-
'& .details': {
|
|
5
|
-
borderBottom: '1px solid #eaeaea',
|
|
6
|
-
height: '55px',
|
|
7
|
-
display: 'flex',
|
|
8
|
-
alignItems: 'center',
|
|
9
|
-
paddingLeft: '10px',
|
|
10
|
-
justifyContent: 'space-between',
|
|
11
|
-
'& h4': {
|
|
12
|
-
color: 'black',
|
|
13
|
-
fontSize: '1em',
|
|
14
|
-
fontWeight: 'bold'
|
|
15
|
-
},
|
|
16
|
-
'& .close-btn ': {
|
|
17
|
-
marginTop: '0',
|
|
18
|
-
'& svg': {
|
|
19
|
-
color: 'black'
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
'& .close-btn:hover ': {
|
|
23
|
-
background: '#eaeaea'
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
};export{styleSheet};//# sourceMappingURL=style.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../src/components/InboxMessage/InboxDetails/style.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAa,MAAA,UAAU,GAAG;AACtB,EAAA,kBAAA,EAAkB;AACd,IAAA,KAAA,EAAA,MAAa;AACb,IAAA,YAAA,EAAA;AACI,MAAA,YAAA,EAAA,mBAAiC;AACjC,MAAA,MAAA,EAAA,MAAQ;AACR,MAAA,OAAA,EAAA,MAAS;AACT,MAAA,UAAA,EAAA,QAAoB;AACpB,MAAA,WAAA,EAAA,MAAa;AACb,MAAA,cAAA,EAAA,eAA+B;AAC/B,MAAA,MAAA,EAAA;AACI,QAAA,KAAA,EAAA;AACA,QAAA,QAAA,EAAA,KAAA;AACA,QAAA,UAAA,EAAA;AACH,OAAA;AACD,MAAA,eAAA,EAAA;AACI,QAAA,SAAA,EAAA,GAAA;AACA,QAAA,OAAA,EAAA;AACI,UAAA,KAAA,EAAA;AACH;AACJ,OAAA;AACD,MAAA,qBAAA,EAAA;AACI,QAAA,UAAA,EAAA;AACH;AACJ;AACJ;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/InboxMessage/InboxSidebar/styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAwDlB,GAAG,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
const styleSheet = {
|
|
2
|
-
inboxSibarStyles: {
|
|
3
|
-
width: '100%',
|
|
4
|
-
marginRight: '20px',
|
|
5
|
-
cursor: 'pointer',
|
|
6
|
-
top: '0',
|
|
7
|
-
bottom: '0',
|
|
8
|
-
height: '100%',
|
|
9
|
-
overflow: 'auto',
|
|
10
|
-
padding: '10px',
|
|
11
|
-
'& .show-message': {
|
|
12
|
-
color: 'black',
|
|
13
|
-
textDecoration: 'none'
|
|
14
|
-
},
|
|
15
|
-
'& .username': {
|
|
16
|
-
color: 'black'
|
|
17
|
-
},
|
|
18
|
-
'& .inbox-contacts': {
|
|
19
|
-
display: 'flex',
|
|
20
|
-
marginTop: '10px',
|
|
21
|
-
paddingBottom: '15px',
|
|
22
|
-
width: '100%',
|
|
23
|
-
borderBottom: '1px solid #eaeaea',
|
|
24
|
-
paddingRight: '10px',
|
|
25
|
-
justifiedContent: 'space-between',
|
|
26
|
-
'& .last-message': {
|
|
27
|
-
marginLeft: '10px',
|
|
28
|
-
lineHeight: '3px'
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
'& .no-messages': {
|
|
32
|
-
textAlign: 'center',
|
|
33
|
-
margin: '0 auto',
|
|
34
|
-
padding: '10px',
|
|
35
|
-
'& h4': {
|
|
36
|
-
fontSize: '18px',
|
|
37
|
-
color: 'black'
|
|
38
|
-
},
|
|
39
|
-
'& p': {
|
|
40
|
-
color: 'rgb(113, 113, 113)',
|
|
41
|
-
fontSize: '16px'
|
|
42
|
-
},
|
|
43
|
-
'& .ant-btn': {
|
|
44
|
-
width: '110px',
|
|
45
|
-
height: '40px',
|
|
46
|
-
borderRadius: '7px',
|
|
47
|
-
border: '1px solid rgb(34 34 34)',
|
|
48
|
-
color: 'black',
|
|
49
|
-
fontWeight: '600',
|
|
50
|
-
'& :hover': {
|
|
51
|
-
color: 'black',
|
|
52
|
-
borderColor: 'black'
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
};export{styleSheet};//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/InboxMessage/InboxSidebar/styles.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAa,MAAA,UAAU,GAAG;AACtB,EAAA,gBAAA,EAAgB;AACZ,IAAA,KAAA,EAAA,MAAa;AACb,IAAA,WAAA,EAAA,MAAmB;AACnB,IAAA,MAAA,EAAA,SAAiB;AACjB,IAAA,GAAA,EAAA;AACA,IAAA,MAAA,EAAA;AACA,IAAA,MAAA,EAAA,MAAc;AACd,IAAA,QAAA,EAAA,MAAgB;AAChB,IAAA,OAAA,EAAA,MAAe;AACf,IAAA,iBAAA,EAAA;AACI,MAAA,KAAA,EAAA,OAAc;AACd,MAAA,cAAA,EAAA;AACH,KAAA;AACD,IAAA,aAAA,EAAA;AACI,MAAA,KAAA,EAAA;AACH,KAAA;AACD,IAAA,mBAAA,EAAA;AACI,MAAA,OAAA,EAAA,MAAS;AACT,MAAA,SAAA,EAAA,MAAW;AACX,MAAA,aAAA,EAAA,MAAe;AACf,MAAA,KAAA,EAAA,MAAO;AACP,MAAA,YAAA,EAAA,mBAAiC;AACjC,MAAA,YAAA,EAAA,MAAc;AACd,MAAA,gBAAA,EAAA,eAAiC;AACjC,MAAA,iBAAA,EAAA;AACI,QAAA,UAAA,EAAA,MAAU;AACV,QAAA,UAAA,EAAA;AACH;AACJ,KAAA;AACD,IAAA,gBAAA,EAAA;AACI,MAAA,SAAA,EAAA,QAAmB;AACnB,MAAA,MAAA,EAAA,QAAgB;AAChB,MAAA,OAAA,EAAA,MAAS;AACT,MAAA,MAAA,EAAA;AACI,QAAA,QAAA,EAAA,MAAQ;AACR,QAAA,KAAA,EAAA;AACH,OAAA;AACD,MAAA,KAAA,EAAA;AACI,QAAA,KAAA,EAAA,oBAA2B;AAC3B,QAAA,QAAA,EAAA;AACH,OAAA;AACD,MAAA,YAAA,EAAA;AACI,QAAA,KAAA,EAAA;AACA,QAAA,MAAA,EAAA,MAAM;AACN,QAAA,YAAA,EAAA,KAAA;AACA,QAAA,MAAA,EAAA,yBAAiC;AACjC,QAAA,KAAA,EAAA;AACA,QAAA,UAAA,EAAA,KAAA;AACA,QAAA,UAAA,EAAA;AACI,UAAA,KAAA,EAAA,OAAA;AACA,UAAA,WAAA,EAAA;AACH;AACJ;AACJ;AACJ;"}
|