isometrik-chat 0.1.0
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/README.md +74 -0
- package/babel.config.js +6 -0
- package/dist/index.js +684 -0
- package/package.json +59 -0
- package/public/Logo-192x192.png +0 -0
- package/public/Logo-512x512.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/fonts/BenjaminVictoria.ttf +0 -0
- package/public/icons/arrow_logo.svg +9 -0
- package/public/icons/assets/ic_placeholder_banner.svg +1 -0
- package/public/icons/attach-file.svg +9 -0
- package/public/icons/audio_pause.svg +1 -0
- package/public/icons/audio_play.svg +6 -0
- package/public/icons/back.svg +3 -0
- package/public/icons/bell.svg +1 -0
- package/public/icons/block.svg +1 -0
- package/public/icons/bottom-arrow.svg +1 -0
- package/public/icons/camera-switch.svg +12 -0
- package/public/icons/camera.svg +4 -0
- package/public/icons/cancel.svg +1 -0
- package/public/icons/chat empty placeholder.svg +58 -0
- package/public/icons/chat_audio_pause.png +0 -0
- package/public/icons/chat_audio_play.png +0 -0
- package/public/icons/close.svg +5 -0
- package/public/icons/crossCarousel.svg +3 -0
- package/public/icons/delete.svg +3 -0
- package/public/icons/disappear.svg +24 -0
- package/public/icons/document.png +0 -0
- package/public/icons/document.svg +1 -0
- package/public/icons/downloadCarousel.svg +6 -0
- package/public/icons/edit-pencil.svg +6 -0
- package/public/icons/emoji.svg +8 -0
- package/public/icons/emojiCarousel.svg +3 -0
- package/public/icons/filter.svg +1 -0
- package/public/icons/forwardCarousel.svg +3 -0
- package/public/icons/gallery.svg +1 -0
- package/public/icons/goToMessageCarousel.svg +3 -0
- package/public/icons/ic_uil_arrow-left.svg +1 -0
- package/public/icons/ic_uil_eye-slash.svg +1 -0
- package/public/icons/ic_uil_eye.svg +1 -0
- package/public/icons/leftArrowCarousel.svg +6 -0
- package/public/icons/light-mode.svg +14 -0
- package/public/icons/lock.svg +1 -0
- package/public/icons/login_background.png +0 -0
- package/public/icons/menu .svg +5 -0
- package/public/icons/menuCarousel.svg +5 -0
- package/public/icons/message.svg +3 -0
- package/public/icons/placeholder.svg +958 -0
- package/public/icons/poll.svg +1 -0
- package/public/icons/retake.png +0 -0
- package/public/icons/right-arrow.svg +3 -0
- package/public/icons/right.svg +3 -0
- package/public/icons/round-star.svg +1 -0
- package/public/icons/search.svg +3 -0
- package/public/icons/send.svg +10 -0
- package/public/icons/starCarousel.svg +3 -0
- package/public/icons/status.svg +1 -0
- package/public/icons/sticker.svg +1 -0
- package/public/icons/thumb-down.svg +1 -0
- package/public/icons/user.svg +1 -0
- package/public/icons/users.svg +1 -0
- package/public/icons/voice.png +0 -0
- package/public/index.html +38 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/offline.html +12 -0
- package/public/robots.txt +3 -0
- package/public/service-worker.js +81 -0
- package/src/App.js +15 -0
- package/src/App.test.js +8 -0
- package/src/Authpage.js +16 -0
- package/src/ChatContext.js +172 -0
- package/src/Data/index.js +110 -0
- package/src/assets/icons.js +49 -0
- package/src/assets/images/WhatsApp.html +258 -0
- package/src/assets/images/WhatsApp_files/301446776_522918349234681_1974693392291574064_n.jpg +0 -0
- package/src/assets/images/WhatsApp_files/app-bf223f825866ee433b07.css +242 -0
- package/src/assets/images/WhatsApp_files/app.77ee8aa7a4c593101105.js +77 -0
- package/src/assets/images/WhatsApp_files/lazy_loaded_high_priority_components.85a06e74a0a4ade1640b.css +16 -0
- package/src/assets/images/WhatsApp_files/lazy_loaded_low_priority_components.8621270bc215a9298a97.css +47 -0
- package/src/assets/images/WhatsApp_files/libsignal-protocol-ee5b8ba.min.js +21 -0
- package/src/assets/images/WhatsApp_files/main.48b845d68e066fb27a75.css +161 -0
- package/src/assets/images/WhatsApp_files/runtime.e6018f3c1e255e8f4dc7.js +2 -0
- package/src/assets/images/WhatsApp_files/stylex-d50abd61e6cf7eab2afd855adccf14e5.css +2841 -0
- package/src/assets/images/WhatsApp_files/vendor1_app.58a51d93a250f83ab555.js +79 -0
- package/src/assets/images/bg.jpeg +0 -0
- package/src/assets/images/drkbg.jpg +0 -0
- package/src/assets/images/notFound.jpeg +0 -0
- package/src/assets/images/watsapp.jpg +0 -0
- package/src/assets/images/watsappbg.png +0 -0
- package/src/assets/images/wb.jpg +0 -0
- package/src/assets/images/whatsapp.jpeg +0 -0
- package/src/components/ChatBox/AudioBubble.js +162 -0
- package/src/components/ChatBox/ChatBubble.js +232 -0
- package/src/components/ChatBox/DocumentBubble.js +87 -0
- package/src/components/ChatBox/MessagesBox.js +533 -0
- package/src/components/CustomModal.js +60 -0
- package/src/components/Icon.js +10 -0
- package/src/components/ImageComponent.js +24 -0
- package/src/components/MediaDocs.js +155 -0
- package/src/components/MediaDocumentContainer.js +55 -0
- package/src/components/MessageInfoDropdown.js +124 -0
- package/src/components/Modal/AllowMicPermissionModal.js +63 -0
- package/src/components/Modal/BlockUnblockChatModal.js +78 -0
- package/src/components/Modal/CameraPermissionBlockedModal.js +61 -0
- package/src/components/Modal/CameraPermissionRequestModal.js +60 -0
- package/src/components/Modal/ClearChatModal.js +78 -0
- package/src/components/Modal/DeleteChatModal.js +79 -0
- package/src/components/Modal/MicPermissionDisableModal.js +63 -0
- package/src/components/Modal/Modal.js +103 -0
- package/src/components/Modal/ModalDialog.js +103 -0
- package/src/components/Modal/ProfilePictureUploadPreview.js +160 -0
- package/src/components/OutsideAlerter/OutsideAlerter.js +38 -0
- package/src/components/ProfilePicture/ProfilePicture.js +127 -0
- package/src/components/Registration/Login.js +265 -0
- package/src/components/Registration/SignUp.js +322 -0
- package/src/components/SnackBar.js +42 -0
- package/src/components/common/Modal/useDetectOutsideClick.js +23 -0
- package/src/components/common/styled/PageWrapper.js +25 -0
- package/src/components/formcontrol/CustomButton.js +38 -0
- package/src/components/formcontrol/InputText.js +60 -0
- package/src/global-styles.js +42 -0
- package/src/hooks/useDeviceType.js +28 -0
- package/src/hooks/useThrottle.js +29 -0
- package/src/index.css +225 -0
- package/src/index.js +23 -0
- package/src/lib/constant.js +21 -0
- package/src/lib/functionality.js +13 -0
- package/src/lib/helpers.js +320 -0
- package/src/lib/mockData/index.js +76 -0
- package/src/lib/session/index.js +31 -0
- package/src/lib/validation.js +4 -0
- package/src/logo.svg +1 -0
- package/src/pages/WhatsappMainBox/index.js +574 -0
- package/src/reportWebVitals.js +13 -0
- package/src/services/deliveryStatus.js +27 -0
- package/src/setupTests.js +5 -0
- package/src/utils/chatSdk.js +14 -0
- package/src/utils/global.js +57 -0
- package/src/utils/media.js +79 -0
- package/src/view/component/BlockedContactSlide.js +134 -0
- package/src/view/component/Carousle/UpperMenuBar.js +106 -0
- package/src/view/component/Carousle/index.js +204 -0
- package/src/view/component/Chatbox.js/AudioRecorder.js +311 -0
- package/src/view/component/Chatbox.js/ChatBubbleReply.js +27 -0
- package/src/view/component/Chatbox.js/TakePhoto.js +363 -0
- package/src/view/component/Chatbox.js/index.js +856 -0
- package/src/view/component/Chatbox.js/styles.css +231 -0
- package/src/view/component/Contact/index.js +56 -0
- package/src/view/component/Contact/styles.css +208 -0
- package/src/view/component/ContactInfo/index.js +543 -0
- package/src/view/component/ContactInfo/styles.css +289 -0
- package/src/view/component/Context/index.js +3 -0
- package/src/view/component/DialogBox.js +15 -0
- package/src/view/component/ImageCropper/ImageCropper.js +128 -0
- package/src/view/component/Loader/Loader.js +52 -0
- package/src/view/component/Loader/UserPagingLoader.js +62 -0
- package/src/view/component/MainChatBox/index.js +819 -0
- package/src/view/component/MainChatBox/styles.css +124 -0
- package/src/view/component/Menu/index.js +261 -0
- package/src/view/component/Menu/styles.css +68 -0
- package/src/view/component/Profile/ProfileInfoContainer.js +112 -0
- package/src/view/component/Profile/ProfileUpdate.js +178 -0
- package/src/view/component/Profile/TakeProfilePhoto.js +391 -0
- package/src/view/component/Profile/index.js +550 -0
- package/src/view/component/Profile/styles.css +370 -0
- package/src/view/component/ReplyChatMessage/ReplyChatMessage.js +48 -0
- package/src/view/component/SeachBar/index.js +106 -0
- package/src/view/component/SeachBar/styles.css +53 -0
- package/src/view/component/Siderbar/index.js +512 -0
- package/src/view/component/Siderbar/styles.css +138 -0
- package/src/view/component/Toaster/Toaster.js +117 -0
- package/src/view/component/UserDetailsCard/UserDetailCard.js +337 -0
- package/src/view/component/deleteMessageMoal.js +80 -0
- package/src/view/component/emoji/index.js +22 -0
- package/src/view/component/emoji/sstyles.css +0 -0
- package/src/view/component/forwardData/index.js +327 -0
- package/src/view/component/forwardData/styles.css +112 -0
- package/src/view/component/forwardPopup/index.js +55 -0
- package/src/view/component/forwardPopup/styles.css +144 -0
- package/src/view/component/mediaList/index.js +92 -0
- package/src/view/component/menuDialog/index.js +71 -0
- package/src/view/component/menuDialog/styles.css +24 -0
- package/src/view/component/pagination/pagination.js +52 -0
- package/src/view/component/pagination/paginationForMsg.js +43 -0
- package/src/view/component/sidebarChat/index.js +321 -0
- package/src/view/component/sidebarChat/styles.css +109 -0
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
import React, { useRef, useState, useEffect } from "react";
|
|
2
|
+
import SliderChat from "../sidebarChat";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
import Profile from "../Profile";
|
|
5
|
+
import SearchBar from "../SeachBar";
|
|
6
|
+
import MenuDialog from "../menuDialog/index";
|
|
7
|
+
import {setCookie } from "../../../lib/session";
|
|
8
|
+
import client from "../../../utils/chatSdk";
|
|
9
|
+
import ImageComponent from "../../../components/ImageComponent";
|
|
10
|
+
import styled, { css } from "styled-components";
|
|
11
|
+
import {
|
|
12
|
+
LIGHT_MODE,
|
|
13
|
+
MENU_ICON,
|
|
14
|
+
MESSAGE,
|
|
15
|
+
CLOSE_ICON
|
|
16
|
+
} from "../../../utils/global";
|
|
17
|
+
import { mobile } from "../../../utils/media";
|
|
18
|
+
import OutsideAlerter from "../../../components/OutsideAlerter/OutsideAlerter";
|
|
19
|
+
import { debounce, getUserConversationListBySearch } from "../../../lib/helpers";
|
|
20
|
+
import { ChatState } from "../../../ChatContext";
|
|
21
|
+
const FilterIcon = styled.div`
|
|
22
|
+
margin-right:10px;
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const SideBarHeader = styled.div`
|
|
26
|
+
${mobile(css`
|
|
27
|
+
width:100vw;
|
|
28
|
+
`)}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
const SideBarBox = styled.div`
|
|
34
|
+
position: relative;
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
const NotificationsPermission = styled.div`
|
|
38
|
+
padding: 12px 18px;
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: space-between;
|
|
41
|
+
align-items: center;
|
|
42
|
+
background: lightpink;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
const ModalContainer = styled.div`
|
|
47
|
+
background: var(--modal_color);
|
|
48
|
+
color:var(--black);
|
|
49
|
+
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
|
50
|
+
border-radius: 4px;
|
|
51
|
+
padding: 1rem 0;
|
|
52
|
+
position: absolute;
|
|
53
|
+
top: 45px;
|
|
54
|
+
left: 165px;
|
|
55
|
+
width: 50%;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
visibility: hidden;
|
|
58
|
+
transform: translateY(-10px);
|
|
59
|
+
transition: opacity 331ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
|
|
60
|
+
transform 220ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
61
|
+
transform-origin: left top;
|
|
62
|
+
z-index: 999;
|
|
63
|
+
|
|
64
|
+
${(props) =>
|
|
65
|
+
props.isMenu &&
|
|
66
|
+
css`
|
|
67
|
+
opacity: 1;
|
|
68
|
+
visibility: visible;
|
|
69
|
+
transform: translateY(0);
|
|
70
|
+
`}
|
|
71
|
+
|
|
72
|
+
${mobile(css`
|
|
73
|
+
top:50px;
|
|
74
|
+
left:180px;
|
|
75
|
+
`)}
|
|
76
|
+
`;
|
|
77
|
+
|
|
78
|
+
const userHeaderMenu = [
|
|
79
|
+
// {
|
|
80
|
+
// id: 1,
|
|
81
|
+
// header: "New Group",
|
|
82
|
+
// },
|
|
83
|
+
// {
|
|
84
|
+
// id: 2,
|
|
85
|
+
// header: "New Community",
|
|
86
|
+
// },
|
|
87
|
+
// {
|
|
88
|
+
// id: 3,
|
|
89
|
+
// header: "Started Message",
|
|
90
|
+
// },
|
|
91
|
+
{
|
|
92
|
+
id: 4,
|
|
93
|
+
header: "Blocked Contacts",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: 5,
|
|
97
|
+
header: "Logout",
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
function Sidebar(props) {
|
|
102
|
+
const {
|
|
103
|
+
sideData,
|
|
104
|
+
sidebarData,
|
|
105
|
+
disabledKey,
|
|
106
|
+
state,
|
|
107
|
+
dispatch,
|
|
108
|
+
userDetails,
|
|
109
|
+
setState,
|
|
110
|
+
getPaginationHomePageData,
|
|
111
|
+
preventConversationRef,
|
|
112
|
+
setIsSidebarShow,
|
|
113
|
+
isLogOut,
|
|
114
|
+
setIsLogOut,
|
|
115
|
+
findUserId,
|
|
116
|
+
sidebarChatItem,
|
|
117
|
+
getHomePageConversationData,
|
|
118
|
+
setUserDetails,
|
|
119
|
+
setShowLoader,
|
|
120
|
+
setShowProfilePicture,
|
|
121
|
+
showConversationPagingLoader,
|
|
122
|
+
setToastStatus,
|
|
123
|
+
setUserConversationDetail,
|
|
124
|
+
profileClose,
|
|
125
|
+
setMediaDocs,
|
|
126
|
+
showSideChatHeader,
|
|
127
|
+
} = props;
|
|
128
|
+
|
|
129
|
+
const [slideShow, setslideShow] = React.useState(false);
|
|
130
|
+
const [group, setGroup] = React.useState(false);
|
|
131
|
+
const [isMenu, setIsMenu] = useState(false);
|
|
132
|
+
const [status, setStatus] = useState(false);
|
|
133
|
+
const [messageSliderOpen, setmessageSliderOpen] = useState(false);
|
|
134
|
+
const [paginationToken, setPaginationToken] = useState(null);
|
|
135
|
+
const apiCallStatusRef = useRef(false);
|
|
136
|
+
const [currentUserConversationDetails, setCurrentUserConversationDetails] =
|
|
137
|
+
useState({ id: "", message: "", conversationId: "" });
|
|
138
|
+
const [showUserPaginationLoader, setShowUserPaginationLoader] =
|
|
139
|
+
useState(false);
|
|
140
|
+
const [isBlockedList , setIsBlockedList] = useState(false);
|
|
141
|
+
const [askFornotificationPermissions, setAskForNotificationPermissions] = useState(false);
|
|
142
|
+
|
|
143
|
+
const { theme, setTheme } = ChatState();
|
|
144
|
+
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
const checkForPermisions = () => {
|
|
147
|
+
if (!("Notification" in window)) {
|
|
148
|
+
// Check if the browser supports notifications
|
|
149
|
+
console.log("This browser does not support desktop notification");
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
return navigator.permissions
|
|
153
|
+
.query({name:'notifications'})
|
|
154
|
+
.then((res) => {
|
|
155
|
+
if(res.state === "granted") {
|
|
156
|
+
setAskForNotificationPermissions(false);
|
|
157
|
+
} else if(res.state === "denied") {
|
|
158
|
+
setAskForNotificationPermissions(false);
|
|
159
|
+
} else {
|
|
160
|
+
setAskForNotificationPermissions(true);
|
|
161
|
+
}
|
|
162
|
+
})
|
|
163
|
+
.catch((err) => console.log('err while checking for nitifications permissions', err));
|
|
164
|
+
}
|
|
165
|
+
checkForPermisions();
|
|
166
|
+
}, [])
|
|
167
|
+
|
|
168
|
+
const handleBrowserPushNotifications = () => {
|
|
169
|
+
try {
|
|
170
|
+
if(typeof window != 'undefined') {
|
|
171
|
+
if (!("Notification" in window)) {
|
|
172
|
+
// Check if the browser supports notifications
|
|
173
|
+
console.log("This browser does not support desktop notification");
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
window.Notification.requestPermission().then((permission) => {
|
|
177
|
+
console.log('permission -- ', permission);
|
|
178
|
+
if(permission === 'granted') {
|
|
179
|
+
console.log('Browser Push Notification Permission granted !!!');
|
|
180
|
+
setAskForNotificationPermissions(false);
|
|
181
|
+
} else if (permission === 'denied') {
|
|
182
|
+
console.log('Notification permission denied');
|
|
183
|
+
setAskForNotificationPermissions(false);
|
|
184
|
+
} else {
|
|
185
|
+
console.log('Notification permission dismissed');
|
|
186
|
+
setAskForNotificationPermissions(false);
|
|
187
|
+
}
|
|
188
|
+
}).catch((err) => {
|
|
189
|
+
console.log('Error while asking For Notification Permissions -- ', err);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
catch(err) {
|
|
194
|
+
console.log('error while asking for brower push notification permissions -- ', err);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const payload = {
|
|
199
|
+
sort: 1,
|
|
200
|
+
limit: 20,
|
|
201
|
+
skip: 0,
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
useEffect(() => {
|
|
205
|
+
setState((prev) => {
|
|
206
|
+
return {
|
|
207
|
+
...prev,
|
|
208
|
+
selectedConvId: currentUserConversationDetails?.conversationId,
|
|
209
|
+
};
|
|
210
|
+
});
|
|
211
|
+
}, [currentUserConversationDetails.conversationId]);
|
|
212
|
+
const handleClick = () => {
|
|
213
|
+
setIsMenu(!isMenu);
|
|
214
|
+
};
|
|
215
|
+
const dataHandler = (data) => {
|
|
216
|
+
setIsSidebarShow(true);
|
|
217
|
+
setCookie("isShow", true);
|
|
218
|
+
sidebarData(data);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const handleClickslideShow = () => {
|
|
222
|
+
setslideShow(true);
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
const handleClosee = () => {
|
|
226
|
+
setslideShow(false);
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
const groupClick = () => {
|
|
230
|
+
setGroup(true);
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
const groupClose = () => {
|
|
234
|
+
setGroup(false);
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
const messageSlidebar = async (body = payload) => {
|
|
238
|
+
apiCallStatusRef.current = true;
|
|
239
|
+
try {
|
|
240
|
+
body?.skip && setShowUserPaginationLoader(true);
|
|
241
|
+
setmessageSliderOpen(true);
|
|
242
|
+
const res = await client?.user?.getUserNonblock(body);
|
|
243
|
+
setPaginationToken(res?.pageToken || null);
|
|
244
|
+
setState((prev) => {
|
|
245
|
+
return {
|
|
246
|
+
...prev,
|
|
247
|
+
users: [...prev.users, ...res?.users],
|
|
248
|
+
};
|
|
249
|
+
});
|
|
250
|
+
setShowLoader(false);
|
|
251
|
+
setShowUserPaginationLoader(false);
|
|
252
|
+
} catch (error) {
|
|
253
|
+
setShowLoader(false);
|
|
254
|
+
setShowUserPaginationLoader(false);
|
|
255
|
+
console.log(error, "err");
|
|
256
|
+
} finally {
|
|
257
|
+
setShowLoader(false);
|
|
258
|
+
apiCallStatusRef.current = false;
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
const messageSlideClose = () => {
|
|
263
|
+
setmessageSliderOpen(false);
|
|
264
|
+
setState((prev) => {
|
|
265
|
+
return {
|
|
266
|
+
...prev,
|
|
267
|
+
users: [],
|
|
268
|
+
};
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
const logOutModalHandle = (logout) => {
|
|
274
|
+
console.log("hello", logout);
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
const statusHandler = () => {
|
|
278
|
+
setStatus(true);
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
const statusClose = () => {
|
|
282
|
+
setStatus(false);
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
const getPaginationData = () => {
|
|
286
|
+
if (apiCallStatusRef.current || state?.users?.length < payload.limit ||
|
|
287
|
+
state?.users?.length % payload.limit !== 0) return;
|
|
288
|
+
payload.skip = (state?.users?.length / payload.limit) * payload.limit;
|
|
289
|
+
messageSlidebar(payload);
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
const getSearchConversationsList = async (value) => {
|
|
293
|
+
try {
|
|
294
|
+
const response = await getUserConversationListBySearch(value);
|
|
295
|
+
setState((prev) => {
|
|
296
|
+
return {
|
|
297
|
+
...prev,
|
|
298
|
+
conversations: response?.conversations,
|
|
299
|
+
};
|
|
300
|
+
});
|
|
301
|
+
} catch (error) {
|
|
302
|
+
setState((prev) => {
|
|
303
|
+
return {
|
|
304
|
+
...prev,
|
|
305
|
+
conversations: [],
|
|
306
|
+
};
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
const debounceMyFunction = debounce(getSearchConversationsList, 900);
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
return (
|
|
315
|
+
<>
|
|
316
|
+
<SideBarBox className="sidebar">
|
|
317
|
+
{
|
|
318
|
+
showSideChatHeader &&
|
|
319
|
+
<SideBarHeader className="sidebar_header d-flex">
|
|
320
|
+
<div>
|
|
321
|
+
<img
|
|
322
|
+
className="user_image "
|
|
323
|
+
onClick={handleClickslideShow}
|
|
324
|
+
src={userDetails?.userProfileImageUrl}
|
|
325
|
+
/>
|
|
326
|
+
</div>
|
|
327
|
+
<div
|
|
328
|
+
className={
|
|
329
|
+
slideShow || group || messageSliderOpen || status || isBlockedList
|
|
330
|
+
? "sliderr"
|
|
331
|
+
: "slider"
|
|
332
|
+
}
|
|
333
|
+
>
|
|
334
|
+
<Profile
|
|
335
|
+
allUsers={state?.users}
|
|
336
|
+
statusClose={statusClose}
|
|
337
|
+
logOutModalHandle={logOutModalHandle}
|
|
338
|
+
status={status}
|
|
339
|
+
messageSlideClose={messageSlideClose}
|
|
340
|
+
messageSliderOpen={messageSliderOpen}
|
|
341
|
+
handleClosee={handleClosee}
|
|
342
|
+
slideShow={slideShow}
|
|
343
|
+
group={group}
|
|
344
|
+
groupClose={groupClose}
|
|
345
|
+
messageSlidebar={messageSlidebar}
|
|
346
|
+
userDetails={userDetails}
|
|
347
|
+
paginationToken={paginationToken}
|
|
348
|
+
getPaginationData={getPaginationData}
|
|
349
|
+
theme={theme}
|
|
350
|
+
setTheme={setTheme}
|
|
351
|
+
sidebarData={sidebarData}
|
|
352
|
+
state={state}
|
|
353
|
+
setState={setState}
|
|
354
|
+
setCurrentUserConversationDetails={
|
|
355
|
+
setCurrentUserConversationDetails
|
|
356
|
+
}
|
|
357
|
+
currentUserConversationDetails={currentUserConversationDetails}
|
|
358
|
+
setIsSidebarShow={setIsSidebarShow}
|
|
359
|
+
setUserDetails={setUserDetails}
|
|
360
|
+
setShowLoader={setShowLoader}
|
|
361
|
+
setShowProfilePicture={setShowProfilePicture}
|
|
362
|
+
showUserPaginationLoader={showUserPaginationLoader}
|
|
363
|
+
setToastStatus={setToastStatus}
|
|
364
|
+
setIsBlockedList={setIsBlockedList}
|
|
365
|
+
isBlockedList={isBlockedList}
|
|
366
|
+
setUserConversationDetail={setUserConversationDetail}
|
|
367
|
+
/>
|
|
368
|
+
</div>
|
|
369
|
+
|
|
370
|
+
<div className="sidebar-right d-flex">
|
|
371
|
+
<span>
|
|
372
|
+
{theme ? (
|
|
373
|
+
<ImageComponent
|
|
374
|
+
src={LIGHT_MODE}
|
|
375
|
+
className="darkicons"
|
|
376
|
+
onClick={() => setTheme(false)}
|
|
377
|
+
style={{ filter: "invert(1)" }}
|
|
378
|
+
/>
|
|
379
|
+
) : (
|
|
380
|
+
<ImageComponent
|
|
381
|
+
src={LIGHT_MODE}
|
|
382
|
+
className="lighticons"
|
|
383
|
+
onClick={() => setTheme(true)}
|
|
384
|
+
/>
|
|
385
|
+
)}
|
|
386
|
+
</span>
|
|
387
|
+
|
|
388
|
+
{/* <span
|
|
389
|
+
data-testid="community-tab-unread"
|
|
390
|
+
onClick={groupClick}
|
|
391
|
+
data-icon="community-tab-unread"
|
|
392
|
+
class=""
|
|
393
|
+
>
|
|
394
|
+
<ImageComponent
|
|
395
|
+
src={USERS}
|
|
396
|
+
className={
|
|
397
|
+
theme ? "darkicons" : "lighticons"
|
|
398
|
+
}
|
|
399
|
+
/>
|
|
400
|
+
</span> */}
|
|
401
|
+
|
|
402
|
+
{/* <span
|
|
403
|
+
onClick={statusHandler}
|
|
404
|
+
data-testid="status-v3-unread"
|
|
405
|
+
data-icon="status-v3-unread"
|
|
406
|
+
class=""
|
|
407
|
+
>
|
|
408
|
+
<ImageComponent
|
|
409
|
+
src={STATUS}
|
|
410
|
+
className={
|
|
411
|
+
theme ? "darkicons" : "lighticons"
|
|
412
|
+
}
|
|
413
|
+
/>
|
|
414
|
+
</span> */}
|
|
415
|
+
|
|
416
|
+
<span
|
|
417
|
+
onClick={() => messageSlidebar()}
|
|
418
|
+
data-testid="chat"
|
|
419
|
+
data-icon="chat"
|
|
420
|
+
class=""
|
|
421
|
+
>
|
|
422
|
+
<ImageComponent
|
|
423
|
+
src={MESSAGE}
|
|
424
|
+
className={theme ? "darkicons" : "lighticons"}
|
|
425
|
+
/>
|
|
426
|
+
</span>
|
|
427
|
+
<OutsideAlerter onClose={() => setIsMenu(false)} >
|
|
428
|
+
<span
|
|
429
|
+
onClick={()=>setIsMenu(!isMenu)}
|
|
430
|
+
data-testid="menu"
|
|
431
|
+
data-icon="menu"
|
|
432
|
+
class=""
|
|
433
|
+
>
|
|
434
|
+
<ImageComponent
|
|
435
|
+
src={MENU_ICON}
|
|
436
|
+
className={theme ? "darkicons" : "lighticons"}
|
|
437
|
+
/>
|
|
438
|
+
|
|
439
|
+
<ModalContainer className="modalContainer" isMenu={isMenu}>
|
|
440
|
+
<MenuDialog
|
|
441
|
+
menuData={userHeaderMenu}
|
|
442
|
+
dispatch={dispatch}
|
|
443
|
+
state={state}
|
|
444
|
+
isMenu={isMenu}
|
|
445
|
+
setIsMenu={setIsMenu}
|
|
446
|
+
isLogOut={isLogOut}
|
|
447
|
+
setIsLogOut={setIsLogOut}
|
|
448
|
+
theme={theme}
|
|
449
|
+
setTheme={setTheme}
|
|
450
|
+
setIsBlockedList={setIsBlockedList}
|
|
451
|
+
|
|
452
|
+
/>
|
|
453
|
+
</ModalContainer>
|
|
454
|
+
</span>
|
|
455
|
+
</OutsideAlerter>
|
|
456
|
+
</div>
|
|
457
|
+
</SideBarHeader>
|
|
458
|
+
}
|
|
459
|
+
<div className="d-flex align-items-center border_bottom searchContainer">
|
|
460
|
+
<SearchBar theme={theme} setTheme={setTheme} userSearchEnteredData={debounceMyFunction} />
|
|
461
|
+
{/* <FilterIcon>
|
|
462
|
+
<ImageComponent src={FILTER}
|
|
463
|
+
className={
|
|
464
|
+
theme ? "darkicons" : "lighticons"
|
|
465
|
+
}>
|
|
466
|
+
|
|
467
|
+
</ImageComponent>
|
|
468
|
+
</FilterIcon> */}
|
|
469
|
+
</div>
|
|
470
|
+
{askFornotificationPermissions && <NotificationsPermission>
|
|
471
|
+
<div className="d-flex flex-column" onClick={handleBrowserPushNotifications}>
|
|
472
|
+
<span>Get Notifications for of new messages messages</span>
|
|
473
|
+
<span style={{ textDecoration: 'underline' }}>Turn on desktop notifications</span>
|
|
474
|
+
</div>
|
|
475
|
+
<img src={CLOSE_ICON} style={{ width: '12px', height: '12px' }} onClick={() => setAskForNotificationPermissions(false)} />
|
|
476
|
+
</NotificationsPermission>}
|
|
477
|
+
<div>
|
|
478
|
+
<div className="chat d-flex">
|
|
479
|
+
<SliderChat
|
|
480
|
+
sideData={sideData}
|
|
481
|
+
dataHandler={dataHandler}
|
|
482
|
+
disabledKey={disabledKey}
|
|
483
|
+
state={state}
|
|
484
|
+
dispatch={dispatch}
|
|
485
|
+
getPaginationHomePageData={getPaginationHomePageData}
|
|
486
|
+
preventConversationRef={preventConversationRef}
|
|
487
|
+
theme={theme}
|
|
488
|
+
setTheme={setTheme}
|
|
489
|
+
findUserId={findUserId}
|
|
490
|
+
setCurrentUserConversationDetails={
|
|
491
|
+
setCurrentUserConversationDetails
|
|
492
|
+
}
|
|
493
|
+
currentUserConversationDetails={currentUserConversationDetails}
|
|
494
|
+
sidebarChatItem={sidebarChatItem}
|
|
495
|
+
getHomePageConversationData={getHomePageConversationData}
|
|
496
|
+
setShowLoader={setShowLoader}
|
|
497
|
+
showConversationPagingLoader={showConversationPagingLoader}
|
|
498
|
+
sidebarData={sidebarData}
|
|
499
|
+
userDetails={userDetails}
|
|
500
|
+
messageSlideClose={messageSlideClose}
|
|
501
|
+
messageSliderOpen={messageSliderOpen}
|
|
502
|
+
messageSlidebar={messageSlidebar}
|
|
503
|
+
profileClose={profileClose}
|
|
504
|
+
setMediaDocs={setMediaDocs}
|
|
505
|
+
/>
|
|
506
|
+
</div>
|
|
507
|
+
</div>
|
|
508
|
+
</SideBarBox>
|
|
509
|
+
</>
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
export default Sidebar;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
.sidebar_header {
|
|
2
|
+
justify-content: space-between;
|
|
3
|
+
padding: 13px;
|
|
4
|
+
background-color:var(--gray_color);
|
|
5
|
+
border-right: 1px solid var(--border_color);
|
|
6
|
+
align-items: center;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.sidebar {
|
|
10
|
+
max-width: 30vw;
|
|
11
|
+
flex: 0.3;
|
|
12
|
+
background-color:var(--white);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.sidebar .bgWhite{
|
|
16
|
+
background-color: var(--primary-white);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.sidebar .sidebar_header .sliderr {
|
|
20
|
+
height: 100vh;
|
|
21
|
+
width: 35vw;
|
|
22
|
+
position: fixed;
|
|
23
|
+
z-index: 1;
|
|
24
|
+
top: 0px;
|
|
25
|
+
left: 0px;
|
|
26
|
+
overflow-x: hidden;
|
|
27
|
+
transition: 0.2s;
|
|
28
|
+
overflow: auto;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.sidebar .sidebar_header .slider {
|
|
32
|
+
height: 100vh;
|
|
33
|
+
width: 0px;
|
|
34
|
+
position: fixed;
|
|
35
|
+
z-index: 1;
|
|
36
|
+
top: 0px;
|
|
37
|
+
left: 0px;
|
|
38
|
+
overflow-x: hidden;
|
|
39
|
+
transition: 0.2s;
|
|
40
|
+
overflow: auto;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.sidebar-search {
|
|
44
|
+
padding: 10px;
|
|
45
|
+
text-align: center;
|
|
46
|
+
align-items: center;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.sidebar-right {
|
|
50
|
+
width: 40%;
|
|
51
|
+
justify-content: space-around;
|
|
52
|
+
align-items: center;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.sidebar-input {
|
|
56
|
+
position: relative;
|
|
57
|
+
padding-left: 15px !important;
|
|
58
|
+
font-size: 15px;
|
|
59
|
+
border: none;
|
|
60
|
+
outline: none;
|
|
61
|
+
background: none;
|
|
62
|
+
color: var(--black);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.sidebar_search-container svg {
|
|
66
|
+
color: #54656f;
|
|
67
|
+
margin-left: 12px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.chat {
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
padding: 0;
|
|
73
|
+
background-color: var(--primary-white);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
::-webkit-scrollbar-thumb {
|
|
77
|
+
background-color: #e9ecef;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
::-webkit-scrollbar-track {
|
|
81
|
+
background: var(--white) !important;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
::-webkit-scrollbar {
|
|
85
|
+
width: 6px !important;
|
|
86
|
+
height: 6px !important;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
::-webkit-scrollbar-thumb {
|
|
90
|
+
background:var(--gray_color)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.css-1t1j96h-MuiPaper-root-MuiDialog-paper {
|
|
94
|
+
margin: 0px !important;
|
|
95
|
+
padding: 0px !important;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.css-hz1bth-MuiDialog-container {
|
|
99
|
+
height: auto !important;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.css-uhb5lp {
|
|
103
|
+
margin: 0px !important;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.css-ekeie0 {
|
|
107
|
+
height: none !important;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.css-ekeie0 {
|
|
111
|
+
height: auto !important;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.css-1t1j96h-MuiPaper-root-MuiDialog-paper {
|
|
115
|
+
border-radius: 0px !important;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.sidebar_header .user_image {
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.filter {
|
|
123
|
+
height: 20px !important;
|
|
124
|
+
width: 20px !important;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.sidebar-search .searchBox {
|
|
128
|
+
display: flex;
|
|
129
|
+
background-color: var(--gray_color);
|
|
130
|
+
flex: 1;
|
|
131
|
+
border-radius: 10px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@media (max-width: 768px) {
|
|
135
|
+
.sidebar{
|
|
136
|
+
max-width: 100vw;
|
|
137
|
+
}
|
|
138
|
+
}
|