@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
|
@@ -3,11 +3,8 @@ import { useTranslation } from 'react-i18next';
|
|
|
3
3
|
import { BiImage } from 'react-icons/bi';
|
|
4
4
|
import { BiArchiveIn } from 'react-icons/bi';
|
|
5
5
|
import { BsFillArrowUpCircleFill } from 'react-icons/bs';
|
|
6
|
-
import { css } from '@emotion/css';
|
|
7
|
-
import { Button, InputGroup, InputRightElement, Textarea, Tooltip } from '@chakra-ui/react';
|
|
8
6
|
import { useGetMessagesQuery, useSendMessagesMutation } from 'common/graphql';
|
|
9
7
|
import MsgList from '../MessagesList';
|
|
10
|
-
import { styleSheet } from './styles';
|
|
11
8
|
|
|
12
9
|
export default function Messages({ id, user, userId, currentUser }: any) {
|
|
13
10
|
const [message, setMessage] = useState('');
|
|
@@ -19,18 +16,22 @@ export default function Messages({ id, user, userId, currentUser }: any) {
|
|
|
19
16
|
channelId: id,
|
|
20
17
|
},
|
|
21
18
|
});
|
|
19
|
+
|
|
22
20
|
useEffect(() => {
|
|
23
21
|
if (!loading) {
|
|
24
22
|
setMessageList(data.messages.data);
|
|
25
23
|
}
|
|
26
24
|
}, [loading, id, data?.messages?.data, messageList]);
|
|
27
|
-
|
|
25
|
+
|
|
26
|
+
const [sendMsg] = useSendMessagesMutation({
|
|
28
27
|
context: {},
|
|
29
28
|
});
|
|
29
|
+
|
|
30
30
|
const messagesEndRef = useRef(null);
|
|
31
31
|
const scrollToBottom = () => {
|
|
32
32
|
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
|
|
33
33
|
};
|
|
34
|
+
|
|
34
35
|
const handleEnterBtn = () => {
|
|
35
36
|
if (message) {
|
|
36
37
|
sendMsg({
|
|
@@ -47,10 +48,11 @@ export default function Messages({ id, user, userId, currentUser }: any) {
|
|
|
47
48
|
setMessage('');
|
|
48
49
|
}
|
|
49
50
|
};
|
|
51
|
+
|
|
50
52
|
const item = user?.find((element) => {
|
|
51
53
|
return element.id !== userId;
|
|
52
54
|
});
|
|
53
|
-
|
|
55
|
+
|
|
54
56
|
const handleTextareaHeight = (e) => {
|
|
55
57
|
if (e.key === 'Enter' && message !== '') {
|
|
56
58
|
setHeight(40 + message.split('\n').length * 10 + 'px');
|
|
@@ -58,101 +60,60 @@ export default function Messages({ id, user, userId, currentUser }: any) {
|
|
|
58
60
|
setHeight('40px');
|
|
59
61
|
}
|
|
60
62
|
};
|
|
63
|
+
|
|
61
64
|
return (
|
|
62
|
-
<div className=
|
|
63
|
-
<div className="
|
|
64
|
-
<div className="
|
|
65
|
-
<h2>{item?.username}</h2>
|
|
66
|
-
<div>
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// bg="white"
|
|
72
|
-
display="flex"
|
|
73
|
-
alignItems="center"
|
|
74
|
-
width="60px"
|
|
75
|
-
borderRadius="10px"
|
|
76
|
-
fontSize="15px"
|
|
77
|
-
height="40px"
|
|
78
|
-
justifyContent="center"
|
|
79
|
-
marginTop="5px"
|
|
80
|
-
color="white"
|
|
81
|
-
boxShadow="0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)"
|
|
82
|
-
hasArrow={true}
|
|
65
|
+
<div className="flex flex-col h-full bg-white">
|
|
66
|
+
<div className="flex-1 overflow-hidden">
|
|
67
|
+
<div className="flex items-center justify-between px-4 py-3 border-b border-gray-200">
|
|
68
|
+
<h2 className="text-lg font-semibold">{item?.username}</h2>
|
|
69
|
+
<div className="relative group">
|
|
70
|
+
<button
|
|
71
|
+
className="p-2 rounded-full hover:bg-gray-100 transition-colors duration-200 group-hover:bg-gray-100"
|
|
72
|
+
onClick={handleEnterBtn}
|
|
73
|
+
title={t('messenger_box_browser.archive')}
|
|
83
74
|
>
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
onClick={handleEnterBtn}
|
|
90
|
-
borderRadius="50%"
|
|
91
|
-
_hover={{ backgroundColor: 'rgb(221, 221, 221)' }}
|
|
92
|
-
>
|
|
93
|
-
<BiArchiveIn />
|
|
94
|
-
</Button>
|
|
95
|
-
</Tooltip>
|
|
75
|
+
<BiArchiveIn className="w-5 h-5 text-gray-600" />
|
|
76
|
+
</button>
|
|
77
|
+
<div className="absolute hidden group-hover:block -bottom-10 right-0 px-2 py-1 text-sm text-white bg-black rounded shadow-lg">
|
|
78
|
+
{t('messenger_box_browser.archive')}
|
|
79
|
+
</div>
|
|
96
80
|
</div>
|
|
97
81
|
</div>
|
|
98
|
-
<div className="
|
|
82
|
+
<div className="flex flex-col h-[calc(100vh-200px)]">
|
|
99
83
|
<MsgList id={id} messageList={messageList} user={user} currentUser={currentUser} />
|
|
100
84
|
<div ref={messagesEndRef}></div>
|
|
101
|
-
<div className="
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
alignItems="center"
|
|
108
|
-
width="60px"
|
|
109
|
-
borderRadius="10px"
|
|
110
|
-
fontSize="15px"
|
|
111
|
-
height="40px"
|
|
112
|
-
justifyContent="center"
|
|
113
|
-
marginTop="5px"
|
|
114
|
-
color="black"
|
|
115
|
-
boxShadow="0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)"
|
|
116
|
-
hasArrow={true}
|
|
117
|
-
>
|
|
118
|
-
<Button
|
|
119
|
-
border="none"
|
|
120
|
-
borderRadius="50%"
|
|
121
|
-
bg="none"
|
|
122
|
-
marginRight="5px"
|
|
123
|
-
height="40px"
|
|
124
|
-
width="40px"
|
|
125
|
-
_hover={{ backgroundColor: 'rgb(221, 221, 221)' }}
|
|
126
|
-
>
|
|
127
|
-
<BiImage color="#464646" style={{ fontSize: '25px' }} />
|
|
128
|
-
</Button>
|
|
129
|
-
</Tooltip>
|
|
130
|
-
<InputGroup size="md">
|
|
131
|
-
<Textarea
|
|
132
|
-
placeholder={t('messenger_box_browser.type_your_message')}
|
|
133
|
-
value={message}
|
|
134
|
-
height={height}
|
|
135
|
-
onKeyUp={handleTextareaHeight}
|
|
136
|
-
// height={enter ? message.split('\n').length * 10 + 'px' : '40px'}
|
|
137
|
-
onChange={(e) => setMessage(e.target.value)}
|
|
138
|
-
/>
|
|
139
|
-
<InputRightElement>
|
|
140
|
-
<Button
|
|
141
|
-
border="none"
|
|
142
|
-
bg="none"
|
|
143
|
-
onClick={handleEnterBtn}
|
|
144
|
-
position="relative"
|
|
145
|
-
right="53px"
|
|
146
|
-
top="6px"
|
|
85
|
+
<div className="p-4 border-t border-gray-200">
|
|
86
|
+
<div className="flex items-center space-x-2">
|
|
87
|
+
<div className="relative group">
|
|
88
|
+
<button
|
|
89
|
+
className="p-2 rounded-full hover:bg-gray-100 transition-colors duration-200"
|
|
90
|
+
title={t('messenger_box_browser.image')}
|
|
147
91
|
>
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
92
|
+
<BiImage className="w-6 h-6 text-gray-600" />
|
|
93
|
+
</button>
|
|
94
|
+
<div className="absolute hidden group-hover:block -top-10 left-1/2 -translate-x-1/2 px-2 py-1 text-sm text-black bg-white rounded shadow-lg">
|
|
95
|
+
{t('messenger_box_browser.image')}
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
<div className="flex-1 relative">
|
|
99
|
+
<textarea
|
|
100
|
+
className="w-full px-4 py-2 text-gray-700 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none"
|
|
101
|
+
placeholder={t('messenger_box_browser.type_your_message')}
|
|
102
|
+
value={message}
|
|
103
|
+
style={{ height }}
|
|
104
|
+
onKeyUp={handleTextareaHeight}
|
|
105
|
+
onChange={(e) => setMessage(e.target.value)}
|
|
106
|
+
/>
|
|
107
|
+
{message !== '' && (
|
|
108
|
+
<button
|
|
109
|
+
className="absolute right-3 bottom-2 p-1 hover:bg-gray-100 rounded-full transition-colors duration-200"
|
|
110
|
+
onClick={handleEnterBtn}
|
|
111
|
+
>
|
|
112
|
+
<BsFillArrowUpCircleFill className="w-6 h-6 text-gray-800" />
|
|
113
|
+
</button>
|
|
114
|
+
)}
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
156
117
|
</div>
|
|
157
118
|
</div>
|
|
158
119
|
</div>
|
|
@@ -1,93 +1,81 @@
|
|
|
1
|
-
import React, { useState
|
|
2
|
-
import {
|
|
3
|
-
Avatar,
|
|
4
|
-
Box,
|
|
5
|
-
Text,
|
|
6
|
-
Modal,
|
|
7
|
-
ModalOverlay,
|
|
8
|
-
ModalContent,
|
|
9
|
-
ModalBody,
|
|
10
|
-
ModalCloseButton,
|
|
11
|
-
useDisclosure,
|
|
12
|
-
} from '@chakra-ui/react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
13
2
|
import Moment from 'moment';
|
|
14
3
|
import { AiFillFlag } from 'react-icons/ai';
|
|
15
4
|
import UserModalContent from '../UserModalContent';
|
|
16
5
|
|
|
17
6
|
export default function MsgList({ messageList, currentUser }: any) {
|
|
18
|
-
const
|
|
7
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
8
|
+
const [selectedUser, setSelectedUser] = useState<any>(null);
|
|
9
|
+
|
|
10
|
+
const openModal = (element: any) => {
|
|
11
|
+
setSelectedUser(element);
|
|
12
|
+
setIsOpen(true);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const closeModal = () => {
|
|
16
|
+
setIsOpen(false);
|
|
17
|
+
setSelectedUser(null);
|
|
18
|
+
};
|
|
19
|
+
|
|
19
20
|
return (
|
|
20
21
|
<>
|
|
21
|
-
{messageList?.map((element, index) =>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
22
|
+
{messageList?.map((element, index) => (
|
|
23
|
+
<div className="message-list" key={index}>
|
|
24
|
+
<div className="flex w-full">
|
|
25
|
+
<div
|
|
26
|
+
className="w-10 h-10 bg-gray-400 rounded-full mr-4 cursor-pointer overflow-hidden"
|
|
27
|
+
onClick={() => openModal(element)}
|
|
28
|
+
>
|
|
29
|
+
{element?.imageUrl && (
|
|
30
|
+
<img
|
|
31
|
+
src={element.imageUrl}
|
|
32
|
+
alt={element?.author?.username}
|
|
33
|
+
className="w-full h-full object-cover"
|
|
34
|
+
/>
|
|
35
|
+
)}
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div className="w-full">
|
|
39
|
+
<p className="text-xl text-black">{element?.author?.username}</p>
|
|
40
|
+
<div className="flex justify-between">
|
|
41
|
+
<p className="text-gray-500">{element?.message}</p>
|
|
42
|
+
{currentUser !== element?.author?.username && <AiFillFlag className="text-black" />}
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
))}
|
|
48
|
+
|
|
49
|
+
{/* Modal */}
|
|
50
|
+
{isOpen && (
|
|
51
|
+
<div className="fixed inset-0 z-50 overflow-y-auto">
|
|
52
|
+
<div className="flex items-center justify-center min-h-screen px-4">
|
|
53
|
+
{/* Overlay */}
|
|
54
|
+
<div
|
|
55
|
+
className="fixed inset-0 bg-black bg-opacity-30 transition-opacity"
|
|
56
|
+
onClick={closeModal}
|
|
57
|
+
></div>
|
|
58
|
+
|
|
59
|
+
{/* Modal content */}
|
|
60
|
+
<div className="relative bg-white w-[1036px] h-[700px] rounded-lg shadow-2xl">
|
|
61
|
+
<div className="flex justify-between border-b border-gray-200 py-4">
|
|
62
|
+
<button
|
|
63
|
+
onClick={closeModal}
|
|
64
|
+
className="ml-4 text-black hover:text-gray-700 w-8 h-8 flex items-center justify-center rounded-full hover:bg-gray-100"
|
|
46
65
|
>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
marginLeft="10px"
|
|
58
|
-
color="black"
|
|
59
|
-
_hover={{ color: 'black' }}
|
|
60
|
-
/>
|
|
61
|
-
</Box>
|
|
62
|
-
<ModalBody>
|
|
63
|
-
<UserModalContent
|
|
64
|
-
username={element?.author?.username}
|
|
65
|
-
image={element.imageUrl ? element.imageUrl : ''}
|
|
66
|
-
/>
|
|
67
|
-
</ModalBody>
|
|
68
|
-
</ModalContent>
|
|
69
|
-
</Modal>
|
|
70
|
-
<Box width="100%">
|
|
71
|
-
<Text fontSize="20px" color="black">
|
|
72
|
-
{element?.author?.username}
|
|
73
|
-
</Text>
|
|
74
|
-
<Box display="flex" justifyContent="space-between">
|
|
75
|
-
<Text color="grey">{element?.message}</Text>
|
|
76
|
-
{currentUser !== element?.author?.username ? <AiFillFlag color="black" /> : ''}
|
|
77
|
-
</Box>
|
|
78
|
-
</Box>
|
|
79
|
-
</Box>
|
|
66
|
+
×
|
|
67
|
+
</button>
|
|
68
|
+
</div>
|
|
69
|
+
<div className="p-6">
|
|
70
|
+
<UserModalContent
|
|
71
|
+
username={selectedUser?.author?.username}
|
|
72
|
+
image={selectedUser?.imageUrl || ''}
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
80
76
|
</div>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// else {
|
|
84
|
-
// return (
|
|
85
|
-
// <div className='message-list'>
|
|
86
|
-
// {element?.sendTo == user.username ? <Comment author={<p className='username'>{element?.author?.username}</p>} key={index} datetime={Moment().format('HH mm: A')} avatar={<Avatar>{element?.author?.username.charAt(0)}</Avatar>} content={<div className="message"><p>{element.message}</p></div>} /> : '' }
|
|
87
|
-
// </div>
|
|
88
|
-
// )
|
|
89
|
-
// }
|
|
90
|
-
})}
|
|
77
|
+
</div>
|
|
78
|
+
)}
|
|
91
79
|
</>
|
|
92
80
|
);
|
|
93
81
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { Button, Box } from '@chakra-ui/react';
|
|
4
|
-
import { css } from '@emotion/css';
|
|
5
|
-
import { styleSheet } from './style';
|
|
6
3
|
|
|
7
|
-
|
|
4
|
+
interface PopoverProps {
|
|
5
|
+
toggleDrawer: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default function Popover({ toggleDrawer }: PopoverProps) {
|
|
8
9
|
const { t } = useTranslation();
|
|
9
10
|
|
|
10
11
|
const content = [
|
|
@@ -20,41 +21,16 @@ export default function Popover({ toggleDrawer }: any) {
|
|
|
20
21
|
total: '0',
|
|
21
22
|
},
|
|
22
23
|
];
|
|
24
|
+
|
|
23
25
|
return (
|
|
24
|
-
<div className={
|
|
25
|
-
{content?.map((item, index) =>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
color="#282121"
|
|
33
|
-
variant="link"
|
|
34
|
-
bg="none"
|
|
35
|
-
height="30px"
|
|
36
|
-
>
|
|
37
|
-
{item.name}
|
|
38
|
-
</Button>
|
|
39
|
-
</Box>
|
|
40
|
-
);
|
|
41
|
-
} else {
|
|
42
|
-
return (
|
|
43
|
-
<Box _hover={{ bg: '#edecec' }} className="popover-style" key={index}>
|
|
44
|
-
<Button
|
|
45
|
-
border="none"
|
|
46
|
-
fontSize="15px"
|
|
47
|
-
color="#282121"
|
|
48
|
-
variant="link"
|
|
49
|
-
bg="none"
|
|
50
|
-
height="30px"
|
|
51
|
-
>
|
|
52
|
-
{item.name + `(${item.total})`}
|
|
53
|
-
</Button>
|
|
54
|
-
</Box>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
})}
|
|
26
|
+
<div className={`absolute z-50 bg-white shadow-lg rounded-md py-2 ${toggleDrawer ? 'right-0' : 'left-0'}`}>
|
|
27
|
+
{content?.map((item, index) => (
|
|
28
|
+
<div key={index} className="hover:bg-gray-100 px-4 py-1">
|
|
29
|
+
<button className="text-[15px] text-[#282121] h-[30px] w-full text-left focus:outline-none">
|
|
30
|
+
{item.total ? `${item.name} (${item.total})` : item.name}
|
|
31
|
+
</button>
|
|
32
|
+
</div>
|
|
33
|
+
))}
|
|
58
34
|
</div>
|
|
59
35
|
);
|
|
60
36
|
}
|
|
@@ -1,61 +1,58 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { AiOutlineSecurityScan
|
|
3
|
+
import { AiOutlineSecurityScan } from 'react-icons/ai';
|
|
4
4
|
import { FiCheck } from 'react-icons/fi';
|
|
5
5
|
import { BsFillStarFill } from 'react-icons/bs';
|
|
6
|
-
import { Avatar, Button, Text } from '@chakra-ui/react';
|
|
7
|
-
import { css } from '@emotion/css';
|
|
8
|
-
import { styleSheet } from './style';
|
|
9
6
|
|
|
10
7
|
export default function UserModalContent({ username, imageUrl }: any) {
|
|
11
8
|
const { t } = useTranslation();
|
|
12
9
|
return (
|
|
13
|
-
<div className=
|
|
14
|
-
<div className="
|
|
15
|
-
<div className="
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
width="200px"
|
|
21
|
-
height="200px"
|
|
22
|
-
borderRadius="50%"
|
|
23
|
-
marginBottom="10px"
|
|
24
|
-
/>
|
|
25
|
-
<a href="#">{t('messenger_box_browser.update_photo')}</a>
|
|
10
|
+
<div className="p-6">
|
|
11
|
+
<div className="flex flex-col items-center mb-8">
|
|
12
|
+
<div className="flex flex-col items-center mb-6">
|
|
13
|
+
<img className="w-48 h-48 rounded-full mb-2 bg-gray-300" src={imageUrl || ''} alt={username} />
|
|
14
|
+
<a href="#" className="text-blue-600 hover:text-blue-800">
|
|
15
|
+
{t('messenger_box_browser.update_photo')}
|
|
16
|
+
</a>
|
|
26
17
|
</div>
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
<div className="flex items-center mb-6">
|
|
19
|
+
<AiOutlineSecurityScan className="w-6 h-6 text-black mr-3" />
|
|
20
|
+
<div className="flex flex-col">
|
|
21
|
+
<h3 className="text-lg font-semibold mb-2">
|
|
22
|
+
{t('messenger_box_browser.identity_verification')}
|
|
23
|
+
</h3>
|
|
24
|
+
<p className="text-black mb-3">{t('messenger_box_browser.show_others_you_are_really_you')}</p>
|
|
25
|
+
<button className="text-black border border-black px-4 py-2 rounded hover:bg-gray-100">
|
|
26
|
+
{t('messenger_box_browser.get_the_badge')}
|
|
27
|
+
</button>
|
|
28
|
+
</div>
|
|
36
29
|
</div>
|
|
37
|
-
<div className="
|
|
38
|
-
<h3
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</
|
|
30
|
+
<div className="w-full">
|
|
31
|
+
<h3 className="text-lg font-semibold mb-3">
|
|
32
|
+
{t('messenger_box_browser.username_confirmed', { username })}
|
|
33
|
+
</h3>
|
|
34
|
+
<div className="flex items-center">
|
|
35
|
+
<FiCheck className="text-black mr-2" />
|
|
36
|
+
<p className="text-black">{t('messenger_box_browser.email_address')}</p>
|
|
44
37
|
</div>
|
|
45
38
|
</div>
|
|
46
39
|
</div>
|
|
47
|
-
<div className="
|
|
48
|
-
<div className="
|
|
49
|
-
<h2>{t('messenger_box_browser.hi_username', { username
|
|
50
|
-
<
|
|
51
|
-
<a>
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
<div className="border-t pt-6">
|
|
41
|
+
<div className="mb-6">
|
|
42
|
+
<h2 className="text-2xl font-bold mb-2">{t('messenger_box_browser.hi_username', { username })}</h2>
|
|
43
|
+
<p className="text-gray-600 mb-2">{t('messenger_box_browser.joined_in_date', { date: '2021' })}</p>
|
|
44
|
+
<a href="#" className="text-blue-600 hover:text-blue-800 block mb-4">
|
|
45
|
+
{t('messenger_box_browser.edit_profile')}
|
|
46
|
+
</a>
|
|
47
|
+
<h3 className="flex items-center text-lg font-semibold">
|
|
48
|
+
<BsFillStarFill className="text-black mr-2" />
|
|
54
49
|
{t('messenger_box_browser.reviews')}
|
|
55
50
|
</h3>
|
|
56
51
|
</div>
|
|
57
|
-
<div
|
|
58
|
-
<a>
|
|
52
|
+
<div>
|
|
53
|
+
<a href="#" className="text-blue-600 hover:text-blue-800">
|
|
54
|
+
{t('messenger_box_browser.reviews_by_you')}
|
|
55
|
+
</a>
|
|
59
56
|
</div>
|
|
60
57
|
</div>
|
|
61
58
|
</div>
|