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,320 @@
1
+ // eslint-disable-next-line import/no-extraneous-dependencies
2
+ import FingerprintJS from "@fingerprintjs/fingerprintjs";
3
+ import client from "../utils/chatSdk";
4
+ import { MAX_DOCUMENT_SIZE, MAX_IMAGE_SIZE, MAX_VIDEO_SIZE } from "./constant";
5
+ import { CAMERA, GALLERY, STICKER } from "../utils/global";
6
+
7
+ export const getDeviceId = async () => {
8
+ const fp = await FingerprintJS.load();
9
+ const result = await fp.get();
10
+ return result.visitorId;
11
+ };
12
+
13
+ export default { getDeviceId };
14
+
15
+
16
+
17
+ export const getUserConversationDetails = async (id) => {
18
+ try {
19
+ const res = await client?.Conversation?.getConversations({ ids: id });
20
+ return res.conversations[0];
21
+ } catch (error) {
22
+ console.log(error, "error");
23
+ }
24
+ };
25
+
26
+ export const getUserConversationListBySearch = async (searchQuery) => {
27
+ try{
28
+ const res = await client.Conversation.getConversations(searchQuery && {searchTag: searchQuery});
29
+ return res;
30
+ } catch (err) {
31
+ console.log(err, 'error');
32
+ }
33
+ }
34
+
35
+ export const uploadPicturePresignedURl = async (mediaExtension) => {
36
+ const getURl = await client?.user?.getPresignedurlUpdate({ mediaExtension: mediaExtension});
37
+ return getURl;
38
+ };
39
+
40
+ export const getMediaUrl = async (url, file, fileType ) => {
41
+ const getURL = await fetch(url , {
42
+ method: 'PUT',
43
+ body: file,
44
+ headers: {
45
+ 'Content-Type' : fileType
46
+ }
47
+ });
48
+ return getURL;
49
+ }
50
+
51
+ export const clearConversationSelfMessages = async (id) => {
52
+ const response = await client.Conversation.deleteConversationLocal({conversationId: id});
53
+ return response;
54
+ };
55
+
56
+ export const deleteConversationSelfMessages = async (id) => {
57
+ const response = await client.Conversation.deleteConversationClear({conversationId: id});
58
+ return response;
59
+ }
60
+
61
+ export const userProfilePicturePlaceholder = 'https://chat-storage.isometrik.io/60b1ef70ffcf750001d0440d/fc4bfc08-3243-420f-884d-1ce37d3f453b/Users/643f9aec09b87e00014625d2_1682328163954.png';
62
+
63
+ export const checkFileSize = (file) => {
64
+ const allowedTypes = ['image/png', 'image/jpg', 'image/jpeg'];
65
+
66
+ if (!allowedTypes.includes(file?.type)) {
67
+ return { valid: false, error: 'Invalid file type' };
68
+ }
69
+
70
+ if (file?.size > MAX_IMAGE_SIZE) {
71
+ return { valid: false, error: `File size should be less than ${MAX_IMAGE_SIZE / 1024 / 1024}MB` };
72
+ }
73
+
74
+ return { valid: true };
75
+ }
76
+
77
+ export const mediaUploadValidator = (file) => {
78
+ const allowedTypes = ['image/png', 'image/jpg', 'image/jpeg', 'video/mp4', 'image/gif'];
79
+ const maxFileSizeInBytes = file.type.split('/')[1] === 'mp4' ? MAX_VIDEO_SIZE : MAX_IMAGE_SIZE
80
+
81
+ if (!allowedTypes.includes(file.type)) {
82
+ return { valid: false, error: 'Invalid file type' };
83
+ }
84
+
85
+ if (file.size > maxFileSizeInBytes) {
86
+ return { valid: false, error: `File size should be less than ${maxFileSizeInBytes / 1024 / 1024}MB` };
87
+ }
88
+
89
+ return { valid: true };
90
+ }
91
+
92
+ export const validDocumentType = {
93
+ pdf : 'pdf',
94
+ msword : 'msword',
95
+ csv : 'csv',
96
+ plain : 'plain',
97
+ "vnd.ms-excel" : 'vns.ms-excel',
98
+ }
99
+
100
+ export const documentUploadValidator = (file) => {
101
+ const allowedTypes = ['image/png', 'image/jpg', 'image/jpeg', 'video/mp4', 'image/gif', 'text/plain', 'application/vnd.ms-excel', 'text/csv', 'application/msword', 'application/pdf'];
102
+ // const fileType = file.type.split('/')[1];
103
+ // const maxFileSizeInBytes = fileType === 'mp4' ? MAX_VIDEO_SIZE : validDocumentType[fileType] ? MAX_DOCUMENT_SIZE : MAX_IMAGE_SIZE;
104
+
105
+ if (!allowedTypes.includes(file.type)) {
106
+ return { valid: false, error: 'Invalid file type' };
107
+ }
108
+
109
+ if (file.size > MAX_DOCUMENT_SIZE) {
110
+ return { valid: false, error: `File size should be less than ${MAX_DOCUMENT_SIZE / 1024 / 1024}MB` };
111
+ }
112
+
113
+ return { valid: true };
114
+ }
115
+
116
+ export const getUserStatus = async (data) => {
117
+ try {
118
+ const res = await client.Conversation.patchDetails({
119
+ conversationId: data?.conversationId,
120
+ metaData: data?.metaData,
121
+ customType: data?.customType,
122
+ });
123
+ return res;
124
+ } catch (error) {
125
+ console.log(error, "error");
126
+ }
127
+ };
128
+
129
+ export const debounce = (func, delay) => {
130
+ let timerId;
131
+ return function() {
132
+ const context = this;
133
+ const args = arguments;
134
+ clearTimeout(timerId);
135
+ timerId = setTimeout(() => func.apply(context, args), delay);
136
+ };
137
+ };
138
+
139
+
140
+ // To check the 1st letter is in uppercase
141
+ export const checkLetterUppercase = (str) => {
142
+ if (str.charAt(0) === str.charAt(0).toUpperCase()) {
143
+ return true
144
+ }
145
+ return false;
146
+ }
147
+ export const postBlockUser = async (userId) => {
148
+ try {
149
+ const body = {
150
+ "opponentId" : userId
151
+ }
152
+ const response = await client.user.postUserBlock(body);
153
+ return response;
154
+ } catch (error) {
155
+ console.error('error', error);
156
+ }
157
+ }
158
+ export const postUnblockUser = async (userId) => {
159
+ try {
160
+ const body = {
161
+ "opponentId" : userId
162
+ }
163
+ const response = await client.user.postUserUnblock(body);
164
+ return response;
165
+ } catch (error) {
166
+ console.log('error', error);
167
+ }
168
+ }
169
+
170
+ export const getTimeWithMeridian = date => `${(date.getHours() % 12) || 12}:${date.getMinutes().toString().padStart(2, '0')} ${date.getHours() < 12 ? 'AM' : 'PM'}`
171
+
172
+
173
+ export const deletemesageForSelf = async (conversationId, messageId) => {
174
+ try {
175
+ const payload = {
176
+ conversationId: conversationId,
177
+ messageIds: messageId
178
+ }
179
+ const response = await client.message.deleteMessageSelf(payload);
180
+ return response;
181
+ } catch (error) {
182
+ const Error = JSON.parse(JSON.stringify({error}));
183
+ console.error('error', Error?.error?.errorMsg);
184
+ }
185
+ };
186
+
187
+ export const deleteMessageforEveryOne = async (conversationId, messageId) => {
188
+ try {
189
+
190
+ const payload = {
191
+ conversationId: conversationId,
192
+ messageIds: messageId,
193
+
194
+ }
195
+ const response = await client.message.deleteMessagesEveryone(payload);
196
+ return response;
197
+ } catch (error) {
198
+ console.log('error', error);
199
+ }
200
+ }
201
+ export const generatedMessagePresignedUrls = async (payload) => {
202
+ const response = await client.message.postMessagesPresignedurls(payload);
203
+ return response;
204
+ };
205
+
206
+ export const isImage = (fileExtension) => {
207
+ const imageFormats = ['jpg', 'jpeg', 'png', 'gif']; // Add more image formats if needed
208
+ return imageFormats.includes(fileExtension.toLowerCase());
209
+ };
210
+
211
+ export const isVideo = (fileExtension) => {
212
+ const videoFormats = ['mp4']; // Add more video formats if needed
213
+ return videoFormats.includes(fileExtension.toLowerCase());
214
+ };
215
+
216
+
217
+ export function dataURLtoFile(dataURL, filename) {
218
+ const arr = dataURL.split(',');
219
+ const mime = arr[0].match(/:(.*?);/)[1];
220
+ const bstr = atob(arr[1]);
221
+ let n = bstr.length;
222
+ const u8arr = new Uint8Array(n);
223
+ while (n--) {
224
+ u8arr[n] = bstr.charCodeAt(n);
225
+ }
226
+ return new File([u8arr], filename, { type: mime });
227
+ }
228
+
229
+
230
+ export const formatDate=(timestamp)=> {
231
+ const date = new Date(timestamp);
232
+ const today = new Date();
233
+ const yesterday = new Date(today);
234
+ yesterday.setDate(yesterday.getDate() - 1);
235
+
236
+ if (date.toDateString() === today.toDateString()) {
237
+ // Current day
238
+ const currentTime = date.toLocaleTimeString([], { hour: 'numeric', minute: '2-digit', hour12: true }).toUpperCase();
239
+ return currentTime;
240
+ } else if (date.toDateString() === yesterday.toDateString()) {
241
+ // Previous day
242
+ return 'Yesterday';
243
+ } else {
244
+ // Rest of the days
245
+ const day = date.getDate().toString().padStart(2, '0');
246
+ const month = (date.getMonth() + 1).toString().padStart(2, '0');
247
+ const year = date.getFullYear().toString();
248
+ return day + '/' + month + '/' + year;
249
+ }
250
+ }
251
+
252
+ export function getMonth(timestamp) {
253
+ const currentMonth = new Date(timestamp).getMonth();
254
+ const currentYear = new Date(timestamp).getFullYear();
255
+ const currentDate = new Date().getDate();
256
+ const currentMonthNow = new Date().getMonth();
257
+ const currentYearNow = new Date().getFullYear();
258
+
259
+ if (currentYear === currentYearNow && currentMonth === currentMonthNow) {
260
+ return "THIS MONTH"; // Current month
261
+ } else {
262
+ return new Date(timestamp).toLocaleString('default', { month: 'long' }).toUpperCase(); // Other months
263
+ }
264
+ }
265
+ export const chatAttachmentOptions = [{id: 0, title: 'Camera', imageUrl: CAMERA}, {id: 1, title: 'Document', imageUrl: STICKER}, {id: 2, title: 'Photos & Videos', imageUrl: GALLERY}, ];
266
+
267
+
268
+ export const getMessageDateSorted = (timeStamp) => {
269
+ const todayDate = new Date();
270
+ const d = new Date(timeStamp);
271
+ const [DD,MM,YYYY] = [d.getDate(),d.getMonth(),d.getFullYear()];
272
+ if (todayDate.getDate() === DD && todayDate.getMonth() === MM && todayDate.getFullYear() === YYYY ) {
273
+ return `Today`;
274
+ }else if (todayDate.getDate() - 1 === DD && todayDate.getMonth() === MM && todayDate.getFullYear() === YYYY ) {
275
+ return 'Yesterday';
276
+ }
277
+ return `${String(DD).padStart('2',0)}/${String(MM).padStart('2', 0)}/${YYYY}`;
278
+ }
279
+
280
+ export const decodeChatBody = (data) => {
281
+ try {
282
+ return atob(data);
283
+ } catch (error) {
284
+ return data;
285
+ }
286
+ }
287
+
288
+ export const formatBytes = (bytes) => {
289
+ if (bytes < 1024) {
290
+ return bytes + ' b';
291
+ } else if (bytes < 1024 * 1024) {
292
+ return (bytes / 1024).toFixed(2) + ' KB';
293
+ } else {
294
+ return (bytes / (1024 * 1024)).toFixed(2) + ' MB';
295
+ }
296
+ }
297
+
298
+ export const encodeChatBody = (data) => {
299
+ try {
300
+ return btoa(data);
301
+ } catch (error) {
302
+ return data;
303
+ }
304
+ }
305
+
306
+ export const convertSecondsToMinutes = (seconds) => {
307
+ try {
308
+ let minutes = Math.floor(seconds / 60);
309
+ let remainingSeconds = seconds % 60;
310
+ if (minutes < 10) {
311
+ minutes = `0${minutes}`
312
+ }
313
+ if (remainingSeconds < 10) {
314
+ remainingSeconds = `0${remainingSeconds}`
315
+ }
316
+ return `${minutes}:${remainingSeconds}`;
317
+ } catch (error) {
318
+ }
319
+ }
320
+
@@ -0,0 +1,76 @@
1
+ export const mediaListing = [
2
+
3
+
4
+ {
5
+ id: '1',
6
+ img: 'https://i.pravatar.cc/250?u=mail@ashallendesign.co.uk',
7
+ day: 'Today',
8
+ },
9
+
10
+ {
11
+ id: '2',
12
+ img: 'https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250',
13
+ day: 'Today',
14
+ },
15
+ {
16
+ id: '3',
17
+ img: 'https://i.pravatar.cc/250?u=mail@ashallendesign.co.uk',
18
+ day: 'Today',
19
+ },
20
+
21
+
22
+
23
+ ]
24
+
25
+ export const userMenuOptions = [
26
+ // {
27
+ // label: "Reply",
28
+ // header: 'Reply',
29
+ // },
30
+ // {
31
+ // label: "React to message",
32
+ // header: 'React to message',
33
+ // },
34
+ // {
35
+ // label: "Forward message",
36
+ // header: 'Forward message',
37
+ // },
38
+ // {
39
+ // lable: "Star message",
40
+ // header: 'Star message',
41
+ // },
42
+
43
+ {
44
+ label: "Delete Message",
45
+ header: 'Delete Message',
46
+ },
47
+
48
+ // {
49
+ // id: 5,
50
+ // name: 'Delete Message',
51
+ // },
52
+ ];
53
+
54
+
55
+ export const userChatMessageOption = [
56
+ {
57
+ lable:"Message info",
58
+ header: 'Message info',
59
+ },
60
+ // {
61
+ // label: "Reply",
62
+ // header: 'Reply',
63
+ // },
64
+ // {
65
+ // lable:"React to message",
66
+ // header: 'React to message',
67
+ // },
68
+ // {
69
+ // lable: "Forward message",
70
+ // header: 'Forward message',
71
+ // },
72
+ {
73
+ lable: "Delete Message",
74
+ header: 'Delete Message',
75
+ },
76
+ ];
@@ -0,0 +1,31 @@
1
+ import cookie from 'js-cookie';
2
+
3
+ export const setCookie = (key, value) => {
4
+ cookie.set(key, value);
5
+ };
6
+
7
+ export const removeCookie = (key) => {
8
+ cookie.remove(key, {
9
+ expires: 1
10
+ });
11
+ };
12
+
13
+ export const authClear = () => {
14
+ removeCookie("userToken");
15
+ removeCookie("userId");
16
+ window.location.href = "/";
17
+ };
18
+
19
+ export const getCookie = (key) => getCookieFromBrowser(key);
20
+
21
+ const getCookieFromBrowser = (key) => cookie.get(key);
22
+
23
+ export const setLocalStorage = (key, value) => {
24
+ localStorage.setItem(key, value);
25
+ return null;
26
+ };
27
+
28
+ export const getLocalStorage = (key) => localStorage.getItem(key);
29
+
30
+ export const removeLocalStorage = (key) => localStorage.removeItem(key);
31
+
@@ -0,0 +1,4 @@
1
+ export const uppercaseRegExp = /(?=.*?[A-Z])/;
2
+ export const digitsRegExp = /(?=.*?[0-9])/;
3
+ export const specialCharRegExp = /(?=.*?[#?!@$%^&*-])/;
4
+ export const minLengthRegExp = /.{8,}/;
package/src/logo.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>