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.
Files changed (188) hide show
  1. package/README.md +74 -0
  2. package/babel.config.js +6 -0
  3. package/dist/index.js +684 -0
  4. package/package.json +59 -0
  5. package/public/Logo-192x192.png +0 -0
  6. package/public/Logo-512x512.png +0 -0
  7. package/public/favicon.ico +0 -0
  8. package/public/fonts/BenjaminVictoria.ttf +0 -0
  9. package/public/icons/arrow_logo.svg +9 -0
  10. package/public/icons/assets/ic_placeholder_banner.svg +1 -0
  11. package/public/icons/attach-file.svg +9 -0
  12. package/public/icons/audio_pause.svg +1 -0
  13. package/public/icons/audio_play.svg +6 -0
  14. package/public/icons/back.svg +3 -0
  15. package/public/icons/bell.svg +1 -0
  16. package/public/icons/block.svg +1 -0
  17. package/public/icons/bottom-arrow.svg +1 -0
  18. package/public/icons/camera-switch.svg +12 -0
  19. package/public/icons/camera.svg +4 -0
  20. package/public/icons/cancel.svg +1 -0
  21. package/public/icons/chat empty placeholder.svg +58 -0
  22. package/public/icons/chat_audio_pause.png +0 -0
  23. package/public/icons/chat_audio_play.png +0 -0
  24. package/public/icons/close.svg +5 -0
  25. package/public/icons/crossCarousel.svg +3 -0
  26. package/public/icons/delete.svg +3 -0
  27. package/public/icons/disappear.svg +24 -0
  28. package/public/icons/document.png +0 -0
  29. package/public/icons/document.svg +1 -0
  30. package/public/icons/downloadCarousel.svg +6 -0
  31. package/public/icons/edit-pencil.svg +6 -0
  32. package/public/icons/emoji.svg +8 -0
  33. package/public/icons/emojiCarousel.svg +3 -0
  34. package/public/icons/filter.svg +1 -0
  35. package/public/icons/forwardCarousel.svg +3 -0
  36. package/public/icons/gallery.svg +1 -0
  37. package/public/icons/goToMessageCarousel.svg +3 -0
  38. package/public/icons/ic_uil_arrow-left.svg +1 -0
  39. package/public/icons/ic_uil_eye-slash.svg +1 -0
  40. package/public/icons/ic_uil_eye.svg +1 -0
  41. package/public/icons/leftArrowCarousel.svg +6 -0
  42. package/public/icons/light-mode.svg +14 -0
  43. package/public/icons/lock.svg +1 -0
  44. package/public/icons/login_background.png +0 -0
  45. package/public/icons/menu .svg +5 -0
  46. package/public/icons/menuCarousel.svg +5 -0
  47. package/public/icons/message.svg +3 -0
  48. package/public/icons/placeholder.svg +958 -0
  49. package/public/icons/poll.svg +1 -0
  50. package/public/icons/retake.png +0 -0
  51. package/public/icons/right-arrow.svg +3 -0
  52. package/public/icons/right.svg +3 -0
  53. package/public/icons/round-star.svg +1 -0
  54. package/public/icons/search.svg +3 -0
  55. package/public/icons/send.svg +10 -0
  56. package/public/icons/starCarousel.svg +3 -0
  57. package/public/icons/status.svg +1 -0
  58. package/public/icons/sticker.svg +1 -0
  59. package/public/icons/thumb-down.svg +1 -0
  60. package/public/icons/user.svg +1 -0
  61. package/public/icons/users.svg +1 -0
  62. package/public/icons/voice.png +0 -0
  63. package/public/index.html +38 -0
  64. package/public/logo192.png +0 -0
  65. package/public/logo512.png +0 -0
  66. package/public/manifest.json +25 -0
  67. package/public/offline.html +12 -0
  68. package/public/robots.txt +3 -0
  69. package/public/service-worker.js +81 -0
  70. package/src/App.js +15 -0
  71. package/src/App.test.js +8 -0
  72. package/src/Authpage.js +16 -0
  73. package/src/ChatContext.js +172 -0
  74. package/src/Data/index.js +110 -0
  75. package/src/assets/icons.js +49 -0
  76. package/src/assets/images/WhatsApp.html +258 -0
  77. package/src/assets/images/WhatsApp_files/301446776_522918349234681_1974693392291574064_n.jpg +0 -0
  78. package/src/assets/images/WhatsApp_files/app-bf223f825866ee433b07.css +242 -0
  79. package/src/assets/images/WhatsApp_files/app.77ee8aa7a4c593101105.js +77 -0
  80. package/src/assets/images/WhatsApp_files/lazy_loaded_high_priority_components.85a06e74a0a4ade1640b.css +16 -0
  81. package/src/assets/images/WhatsApp_files/lazy_loaded_low_priority_components.8621270bc215a9298a97.css +47 -0
  82. package/src/assets/images/WhatsApp_files/libsignal-protocol-ee5b8ba.min.js +21 -0
  83. package/src/assets/images/WhatsApp_files/main.48b845d68e066fb27a75.css +161 -0
  84. package/src/assets/images/WhatsApp_files/runtime.e6018f3c1e255e8f4dc7.js +2 -0
  85. package/src/assets/images/WhatsApp_files/stylex-d50abd61e6cf7eab2afd855adccf14e5.css +2841 -0
  86. package/src/assets/images/WhatsApp_files/vendor1_app.58a51d93a250f83ab555.js +79 -0
  87. package/src/assets/images/bg.jpeg +0 -0
  88. package/src/assets/images/drkbg.jpg +0 -0
  89. package/src/assets/images/notFound.jpeg +0 -0
  90. package/src/assets/images/watsapp.jpg +0 -0
  91. package/src/assets/images/watsappbg.png +0 -0
  92. package/src/assets/images/wb.jpg +0 -0
  93. package/src/assets/images/whatsapp.jpeg +0 -0
  94. package/src/components/ChatBox/AudioBubble.js +162 -0
  95. package/src/components/ChatBox/ChatBubble.js +232 -0
  96. package/src/components/ChatBox/DocumentBubble.js +87 -0
  97. package/src/components/ChatBox/MessagesBox.js +533 -0
  98. package/src/components/CustomModal.js +60 -0
  99. package/src/components/Icon.js +10 -0
  100. package/src/components/ImageComponent.js +24 -0
  101. package/src/components/MediaDocs.js +155 -0
  102. package/src/components/MediaDocumentContainer.js +55 -0
  103. package/src/components/MessageInfoDropdown.js +124 -0
  104. package/src/components/Modal/AllowMicPermissionModal.js +63 -0
  105. package/src/components/Modal/BlockUnblockChatModal.js +78 -0
  106. package/src/components/Modal/CameraPermissionBlockedModal.js +61 -0
  107. package/src/components/Modal/CameraPermissionRequestModal.js +60 -0
  108. package/src/components/Modal/ClearChatModal.js +78 -0
  109. package/src/components/Modal/DeleteChatModal.js +79 -0
  110. package/src/components/Modal/MicPermissionDisableModal.js +63 -0
  111. package/src/components/Modal/Modal.js +103 -0
  112. package/src/components/Modal/ModalDialog.js +103 -0
  113. package/src/components/Modal/ProfilePictureUploadPreview.js +160 -0
  114. package/src/components/OutsideAlerter/OutsideAlerter.js +38 -0
  115. package/src/components/ProfilePicture/ProfilePicture.js +127 -0
  116. package/src/components/Registration/Login.js +265 -0
  117. package/src/components/Registration/SignUp.js +322 -0
  118. package/src/components/SnackBar.js +42 -0
  119. package/src/components/common/Modal/useDetectOutsideClick.js +23 -0
  120. package/src/components/common/styled/PageWrapper.js +25 -0
  121. package/src/components/formcontrol/CustomButton.js +38 -0
  122. package/src/components/formcontrol/InputText.js +60 -0
  123. package/src/global-styles.js +42 -0
  124. package/src/hooks/useDeviceType.js +28 -0
  125. package/src/hooks/useThrottle.js +29 -0
  126. package/src/index.css +225 -0
  127. package/src/index.js +23 -0
  128. package/src/lib/constant.js +21 -0
  129. package/src/lib/functionality.js +13 -0
  130. package/src/lib/helpers.js +320 -0
  131. package/src/lib/mockData/index.js +76 -0
  132. package/src/lib/session/index.js +31 -0
  133. package/src/lib/validation.js +4 -0
  134. package/src/logo.svg +1 -0
  135. package/src/pages/WhatsappMainBox/index.js +574 -0
  136. package/src/reportWebVitals.js +13 -0
  137. package/src/services/deliveryStatus.js +27 -0
  138. package/src/setupTests.js +5 -0
  139. package/src/utils/chatSdk.js +14 -0
  140. package/src/utils/global.js +57 -0
  141. package/src/utils/media.js +79 -0
  142. package/src/view/component/BlockedContactSlide.js +134 -0
  143. package/src/view/component/Carousle/UpperMenuBar.js +106 -0
  144. package/src/view/component/Carousle/index.js +204 -0
  145. package/src/view/component/Chatbox.js/AudioRecorder.js +311 -0
  146. package/src/view/component/Chatbox.js/ChatBubbleReply.js +27 -0
  147. package/src/view/component/Chatbox.js/TakePhoto.js +363 -0
  148. package/src/view/component/Chatbox.js/index.js +856 -0
  149. package/src/view/component/Chatbox.js/styles.css +231 -0
  150. package/src/view/component/Contact/index.js +56 -0
  151. package/src/view/component/Contact/styles.css +208 -0
  152. package/src/view/component/ContactInfo/index.js +543 -0
  153. package/src/view/component/ContactInfo/styles.css +289 -0
  154. package/src/view/component/Context/index.js +3 -0
  155. package/src/view/component/DialogBox.js +15 -0
  156. package/src/view/component/ImageCropper/ImageCropper.js +128 -0
  157. package/src/view/component/Loader/Loader.js +52 -0
  158. package/src/view/component/Loader/UserPagingLoader.js +62 -0
  159. package/src/view/component/MainChatBox/index.js +819 -0
  160. package/src/view/component/MainChatBox/styles.css +124 -0
  161. package/src/view/component/Menu/index.js +261 -0
  162. package/src/view/component/Menu/styles.css +68 -0
  163. package/src/view/component/Profile/ProfileInfoContainer.js +112 -0
  164. package/src/view/component/Profile/ProfileUpdate.js +178 -0
  165. package/src/view/component/Profile/TakeProfilePhoto.js +391 -0
  166. package/src/view/component/Profile/index.js +550 -0
  167. package/src/view/component/Profile/styles.css +370 -0
  168. package/src/view/component/ReplyChatMessage/ReplyChatMessage.js +48 -0
  169. package/src/view/component/SeachBar/index.js +106 -0
  170. package/src/view/component/SeachBar/styles.css +53 -0
  171. package/src/view/component/Siderbar/index.js +512 -0
  172. package/src/view/component/Siderbar/styles.css +138 -0
  173. package/src/view/component/Toaster/Toaster.js +117 -0
  174. package/src/view/component/UserDetailsCard/UserDetailCard.js +337 -0
  175. package/src/view/component/deleteMessageMoal.js +80 -0
  176. package/src/view/component/emoji/index.js +22 -0
  177. package/src/view/component/emoji/sstyles.css +0 -0
  178. package/src/view/component/forwardData/index.js +327 -0
  179. package/src/view/component/forwardData/styles.css +112 -0
  180. package/src/view/component/forwardPopup/index.js +55 -0
  181. package/src/view/component/forwardPopup/styles.css +144 -0
  182. package/src/view/component/mediaList/index.js +92 -0
  183. package/src/view/component/menuDialog/index.js +71 -0
  184. package/src/view/component/menuDialog/styles.css +24 -0
  185. package/src/view/component/pagination/pagination.js +52 -0
  186. package/src/view/component/pagination/paginationForMsg.js +43 -0
  187. package/src/view/component/sidebarChat/index.js +321 -0
  188. package/src/view/component/sidebarChat/styles.css +109 -0
@@ -0,0 +1,370 @@
1
+ .profile .profile_image {
2
+ width: 200px !important;
3
+ height: 200px !important;
4
+ }
5
+
6
+ .statuss .status {
7
+ border-bottom: 2px solid #00a884;
8
+ }
9
+
10
+ .profile_name .statusField {
11
+ padding: 10px;
12
+ border: "3px solid";
13
+ }
14
+
15
+ .newGroup {
16
+ background-color: var(--gray_color);
17
+ height: 100vh;
18
+ position: absolute;
19
+ top: -41px !important;
20
+ left: -170px !important;
21
+ width: 30.5vw !important;
22
+ overflow-y: auto;
23
+ }
24
+
25
+ .mystatus span img {
26
+ height: 45px;
27
+ width: 46px;
28
+ border-radius: 20px;
29
+ }
30
+
31
+ .mystatus span {
32
+ /* width: 60px; */
33
+ padding-left: 16px;
34
+ }
35
+
36
+ .mystatus {
37
+ margin-top: 20px;
38
+ padding-bottom: 30px;
39
+ border-bottom: 1px solid rgb(175, 174, 174);
40
+ }
41
+
42
+ .profile_Container {
43
+ background-color: var(--white);
44
+ height: 100vh;
45
+ position: absolute;
46
+ top: 0px;
47
+ left: 0px;
48
+ width: 30vw;
49
+ overflow-y: auto;
50
+ }
51
+
52
+ .newgroupSlider input,
53
+ .communitySlider input {
54
+ margin-top: 30px;
55
+ outline: none;
56
+ margin-left: 34px;
57
+ width: 85%;
58
+ border-top: none;
59
+ border-left: none;
60
+ border-right: none;
61
+ border-bottom: 1px solid lightgray;
62
+ padding-top: 2px;
63
+ }
64
+
65
+ .description {
66
+ height: 20vh;
67
+ margin-bottom: 10px;
68
+ }
69
+ .communitySlider input {
70
+ margin-top: 50px !important;
71
+ }
72
+
73
+ .profile_Container .messageChat {
74
+ left: 0px;
75
+ /* margin-top: 110px; */
76
+ /* margin-bottom: 10px; */
77
+ position: relative;
78
+ }
79
+
80
+ .profile_Container .messageChat .bg-white span {
81
+ padding: 10px;
82
+ background: #00a884;
83
+ border-radius: 50px;
84
+ }
85
+
86
+ .profile_Container .messageChat .bg-white {
87
+ padding-left: 15px;
88
+ }
89
+
90
+ .profile_Container .message span {
91
+ padding: 10px;
92
+ background: #00a884;
93
+ border-radius: 50px;
94
+ /* background: #00a884/; */
95
+ }
96
+
97
+ .profile_Container .message {
98
+ padding-left: 15px;
99
+ }
100
+
101
+ .profile_Div{
102
+ position: fixed;
103
+ left: 0;
104
+ top: 0;
105
+ z-index: 999;
106
+ }
107
+
108
+ .profile_Contaner .profile_Div {
109
+ width: 100vw;
110
+ }
111
+
112
+ .profile_Div .profile_header {
113
+ height: 108px;
114
+ padding-left: 20px;
115
+ padding-top: 67px;
116
+ padding-right: 23px;
117
+ background-color: var(--profile-header);
118
+ display: flex;
119
+ width: 30vw;
120
+ color: white;
121
+ }
122
+
123
+ .profile_header .profile_arrowIcon {
124
+ cursor: pointer;
125
+ color: white;
126
+ }
127
+
128
+ .profile_header h {
129
+ color: white;
130
+ margin-left: 40px;
131
+ font-size: 18px;
132
+ }
133
+
134
+ .profile_Container .profile-avatar {
135
+ display: flex;
136
+ justify-content: center;
137
+ margin-top: 140px;
138
+ margin-bottom: 28px;
139
+ /* margin-top: 25px; */
140
+ position: relative;
141
+ }
142
+
143
+ .profile_Container .proAvatar {
144
+ animation: showMe 0.75s;
145
+ animation-iteration-count: 1;
146
+ }
147
+
148
+ .profile_Container {
149
+ animation: showMe 0.75s;
150
+ animation-iteration-count: 1;
151
+ position: relative;
152
+ }
153
+
154
+ .profile_Container .groupChat {
155
+ left: 0px;
156
+ margin-top: 110px;
157
+ margin-bottom: 10px;
158
+ position: relative;
159
+ border-bottom: 1px solid var(--border_color);
160
+ }
161
+
162
+ .profile_Container .groupChat div {
163
+ padding-left: 15px;
164
+ }
165
+ .profile_header_text{
166
+ font-size:18px;
167
+ margin-left:15px;
168
+
169
+ }
170
+
171
+ .profile_Container .groupChat div span {
172
+ padding: 10px;
173
+ background: #00a884;
174
+ border-radius: 50px;
175
+ }
176
+
177
+ .profile-avatar img,
178
+ .newCommunity input {
179
+ width: 200px;
180
+ height: 200px;
181
+ border-radius: 100px;
182
+ }
183
+
184
+ .newCommunity input {
185
+ border-radius: 55px !important;
186
+ background-color: rgba(84, 101, 111, 0.8) !important;
187
+ border: none !important;
188
+ }
189
+
190
+ .profile_Container .profile_name {
191
+ height: 100px;
192
+ /* background-color: var(--white); */
193
+ background-color: var(--primary-white);
194
+ padding: 0px 0px 0px 28px;
195
+ line-height: 0.1px;
196
+ }
197
+
198
+ .profile_name p {
199
+ color: var(--profile-name);
200
+ font-size: 14px;
201
+ position: relative;
202
+ top: 10px;
203
+ padding-top: 10px;
204
+ }
205
+
206
+ /* ATBBeHwyQE8vRCGfvgJjj24kqnxP3891D213 */
207
+
208
+ .profile_name .user_input_text {
209
+ display: flex;
210
+ justify-content: space-between;
211
+ }
212
+
213
+ .profile_name div input {
214
+ border: none;
215
+ outline: none;
216
+ width: 100%;
217
+ background: none;
218
+ padding-top: 10px;
219
+ color: var(--black);
220
+ padding-right:15px
221
+ }
222
+
223
+ .profile_name div .emoji_Icon {
224
+ display: flex;
225
+ align-items: center;
226
+ position: relative;
227
+ top: 8px;
228
+ /* right: 25px; */
229
+ }
230
+
231
+ .profile_name div .edit_Icon {
232
+ position: relative;
233
+ /* right: 30px; */
234
+ top: 8px;
235
+ }
236
+
237
+ .profile_Container .profile_bio {
238
+ margin-left: 20px;
239
+ margin-right: 30px;
240
+ font-size: 14px;
241
+ line-height: 20px;
242
+ margin-top: 18px;
243
+ margin-bottom: 28px;
244
+ color: var(--chat-msg-text);
245
+ }
246
+
247
+ .profile_name div .userStatus_emoji {
248
+ display: flex;
249
+ position: relative;
250
+ top: 8px;
251
+ /* right: 50px; */
252
+ }
253
+
254
+ @keyframes showMe {
255
+ 0% {
256
+ transform: scale(0, 0);
257
+ }
258
+
259
+ 80% {
260
+ transform: scale(0, 0);
261
+ }
262
+
263
+ 100% {
264
+ transform: scale(1, 1);
265
+ }
266
+ }
267
+
268
+ .profile_Container .profile_body {
269
+ position: relative;
270
+ overflow-y: auto;
271
+ }
272
+
273
+ .profile_name .inputField {
274
+ border-bottom: 2px solid lightgray;
275
+ border-color: var(--profile-color);
276
+ }
277
+
278
+ @keyframes show {
279
+ 0% {
280
+ opacity: 0;
281
+ transform: translateY(-50px);
282
+ }
283
+
284
+ 30% {
285
+ opacity: 0;
286
+ transform: translateY(-50px);
287
+ }
288
+
289
+ 100% {
290
+ opacity: 1;
291
+ transform: translateY(0px);
292
+ }
293
+ }
294
+
295
+ .newCommunity {
296
+ margin-top: 30px;
297
+ display: flex;
298
+ justify-content: center;
299
+ }
300
+
301
+ .newCommunity img {
302
+ border-radius: 44px !important;
303
+ }
304
+
305
+ .chat_container{
306
+ padding-top: 160px;
307
+ height: calc(100vh);
308
+ overflow: scroll;
309
+ }
310
+ .profile__header__text{
311
+ margin-left: 2rem;
312
+ color:white
313
+ }
314
+
315
+ #allMessages{
316
+ padding: 0 15px;
317
+ overflow-y: auto;
318
+ overflow-x: hidden;
319
+ flex: 1 1;
320
+ position: relative;
321
+ }
322
+
323
+ .no_result_text{
324
+ text-align: center;
325
+ padding: 4.5rem 3rem;
326
+ color: var(--black);
327
+ }
328
+
329
+ .profile_picture_uploader{
330
+ display: none
331
+ }
332
+
333
+ .profile_pic_container:hover .profile_picture_uploader{
334
+ display: flex;
335
+ }
336
+
337
+ .custom_padding_left{
338
+ padding-left: 1rem;
339
+ }
340
+
341
+ .custom_padding_bottom{
342
+ padding-bottom: 1rem;
343
+ }
344
+
345
+ .custom_padding_top{
346
+ padding-top: 1rem;
347
+ }
348
+
349
+
350
+ .input_maxlength_checker {
351
+ margin-bottom: 0;
352
+ top: 0 !important;
353
+ padding-top: 0 !important;
354
+ margin-right: 10px;
355
+ }
356
+
357
+ .input_maxlength_status_checker{
358
+ padding-top: 0 !important;
359
+ margin-right: 5px;
360
+ }
361
+
362
+ .danger__text{
363
+ color: var(--danger) !important;
364
+ }
365
+
366
+ @media (max-width: 420px) {
367
+ .chat_container{
368
+ height: calc(100vh - 60px);
369
+ }
370
+ }
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import ImageComponent from '../../../components/ImageComponent';
4
+ import { CLOSEICON, CLOSE_ICON } from '../../../utils/global';
5
+ import { decodeChatBody } from '../../../lib/helpers';
6
+ const ReplyChatMessageWrapper = styled.div`
7
+ background-color: var(--gray_color);
8
+ padding: 0.5rem 2rem 0 0;
9
+ position: absolute;
10
+ bottom: 68px;
11
+ width: 100%;
12
+ display: flex;
13
+ align-items: center;
14
+ .close_icon{
15
+ width: 15px;
16
+ height: 15px;
17
+ }
18
+ `;
19
+ const ReplyChatMessageTextWrapper = styled.div`
20
+ padding: 0.25rem 0.5rem;
21
+ margin-left: auto;
22
+ width: 93%;
23
+ border-left: 4px solid var(--profile-color);
24
+ border-radius:7.5px;
25
+ background-color:var(--reply-pannel-background)
26
+ `;
27
+ const SenderName = styled.h6`
28
+ color: var(--profile-color);
29
+ `;
30
+ const SenderText = styled.p`
31
+ color: var(--black);
32
+ margin-bottom: 0;
33
+ word-break: break-all;
34
+ `;
35
+ const ReplyChatMessage = (props) => {
36
+ const { theme, clickedMessageInfo, replyMessageCloseHandler, setReply, reply } = props;
37
+ return (
38
+ <ReplyChatMessageWrapper>
39
+ <ReplyChatMessageTextWrapper>
40
+ <SenderName>{reply?.data?.chat?.senderName}</SenderName>
41
+ <SenderText>{ decodeChatBody(reply?.data?.chat?.body)}</SenderText>
42
+ </ReplyChatMessageTextWrapper>
43
+ <ImageComponent src={CLOSE_ICON} onClick={()=>setReply({...reply , isreply:false, data:{}, showReplyMessage:false})} />
44
+ </ReplyChatMessageWrapper>
45
+ )
46
+ }
47
+ export default ReplyChatMessage;
48
+
@@ -0,0 +1,106 @@
1
+ import React, { useState } from "react";
2
+ import { BACKICON, CLOSE_ICON, SEARCH } from "../../../utils/global";
3
+ import { ArrowContext } from "../Context";
4
+ import "./styles.css";
5
+ import ImageComponent from "../../../components/ImageComponent";
6
+
7
+ function SearchBar(props) {
8
+ const [isArrowShow, setISArrowShow] = useState();
9
+ const initialValue = { search: "" };
10
+ const [formValue, setFormValue] = useState(initialValue);
11
+ const list = localStorage.getItem("index");
12
+ const contextType = ArrowContext;
13
+ const { userSearchEnteredData } = props;
14
+
15
+ const showHandler = () => {
16
+ setISArrowShow(false);
17
+ setFormValue({ ...formValue, search: "" });
18
+ {userSearchEnteredData && userSearchEnteredData(formValue)};
19
+ };
20
+
21
+ const changeHandler = (e) => {
22
+ const { name, value } = e.target;
23
+ setFormValue({ ...formValue, [name]: value });
24
+ setISArrowShow(true);
25
+ if (!e.target.value) setISArrowShow(false);
26
+ };
27
+
28
+ return (
29
+ <>
30
+ <div
31
+ style={{ width: "100%" }}
32
+ className={
33
+ props?.messageSliderOpen
34
+ ? "sidebar-search msg-search d-flex"
35
+ : "sidebar-search d-flex"
36
+ }
37
+ >
38
+ <div className="searchBox">
39
+ <div className="sidebar_search-container">
40
+ {isArrowShow ? (
41
+ <span>
42
+ <ImageComponent
43
+ onClick={showHandler}
44
+ src={BACKICON}
45
+ className={
46
+ props?.theme ? "darkicons" : "lighticons"
47
+ }
48
+ />
49
+ </span>
50
+ ) : (
51
+ <span data-testid="search" data-icon="search" class="">
52
+ <ImageComponent
53
+ src={SEARCH}
54
+ className={
55
+ props?.theme ? "darkicons" : "lighticons"
56
+ }
57
+ />
58
+ </span>
59
+ )}
60
+ </div>
61
+ <input
62
+ className={
63
+ props?.searchShow ? "sidebar-input truncate contact-search" : "sidebar-input"
64
+ }
65
+ size="small"
66
+ name="search"
67
+ value={formValue?.search}
68
+ type="text"
69
+ placeholder={`${props?.searchShow ? "search......" : ""} ${
70
+ props?.messageSliderOpen ? "New Contacts" : ""
71
+ } ${
72
+ !props?.messageSliderOpen && !props?.searchShow
73
+ ? "Search a New Chat"
74
+ : ""
75
+ } `}
76
+ onChange={(e) => {
77
+ {userSearchEnteredData && userSearchEnteredData(e.target.value)};
78
+ changeHandler(e);
79
+ }}
80
+ />
81
+ {isArrowShow ? (
82
+ <span data-testid="search" data-icon="search">
83
+ <ImageComponent
84
+ onClick={showHandler}
85
+ src={CLOSE_ICON}
86
+ className={
87
+ props?.theme ? "darkicons close_icon" : "lighticons close_icon"
88
+ }
89
+ />
90
+ </span>
91
+ ):""}
92
+ </div>
93
+ </div>
94
+ <style jsx>{`
95
+ @media(max-width:48rem){
96
+ .sidebar-input{
97
+ width:100%
98
+ }
99
+ }
100
+ `}
101
+ </style>
102
+ </>
103
+ );
104
+ }
105
+
106
+ export default SearchBar;
@@ -0,0 +1,53 @@
1
+ .sidebar-search {
2
+ padding: 8px 10px;
3
+ max-height: 50px;
4
+ text-align: center;
5
+ background-color: var(--primary-white);
6
+ align-items: center;
7
+ }
8
+
9
+ .msg-search {
10
+ /* position: fixed;
11
+ z-index: 2; */
12
+ }
13
+
14
+ .sidebar-search .searchBox {
15
+ display: flex;
16
+ background-color:var(--gray_color);
17
+ flex: 1;
18
+ border-radius: 10px;
19
+ height: 35px;
20
+ }
21
+ .sidebar-search .searchBox .close_icon {
22
+ padding:2px;
23
+ vertical-align:-webkit-baseline-middle;
24
+
25
+
26
+ }
27
+
28
+
29
+ .sidebar_search-container svg {
30
+ color: #54656f;
31
+ margin-left: 12px;
32
+ margin-top: 6px;
33
+ }
34
+
35
+ .sidebar-input {
36
+ position: relative;
37
+ padding-left: 15px !important;
38
+ padding-right: 15px !important;
39
+ font-size: 15px;
40
+ border: none;
41
+ outline: none;
42
+ background: none;
43
+ width: 23vw;
44
+ }
45
+
46
+ .contact-search{
47
+ min-width: 92%;
48
+ }
49
+
50
+ .filterIcon {
51
+ margin-top: 15px;
52
+ margin-right:10px;
53
+ }