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,60 @@
1
+ import React from "react";
2
+ import styled, { css } from "styled-components";
3
+ import { ipadSM } from "../../utils/media";
4
+
5
+ const CustomInputText = styled.input`
6
+ background: #f3f3f9;
7
+ border-radius: 8px;
8
+ font-family: "Inter";
9
+ font-style: normal;
10
+ font-weight: 400;
11
+ font-size: 16px;
12
+ line-height: 22px;
13
+ display: flex;
14
+ align-items: center;
15
+ letter-spacing: 0.39996px;
16
+ color: #1d1c21;
17
+ border: ${(props) =>
18
+ props.error ? "1px solid #B00020" : " 1px solid #b1b1b1"};
19
+ height: 3em;
20
+ width: 100%;
21
+ margin: ${(props) => (props.error ? "8px auto" : "8px auto 1rem auto")};
22
+ padding: 0 9px;
23
+
24
+ ${ipadSM(css`
25
+ margin: 6px auto;
26
+ `)}
27
+
28
+ &:focus {
29
+ outline: none;
30
+ }
31
+ &:-webkit-autofill,
32
+ &:-webkit-autofill:hover,
33
+ &:-webkit-autofill:focus,
34
+ &:-webkit-autofill:active {
35
+ -webkit-transition: "color 9999s ease-out, background-color 9999s ease-out";
36
+ -webkit-transition-delay: 9999s;
37
+ color: #8b8b8b;
38
+ }
39
+ `;
40
+
41
+ const ErrorText = styled.div`
42
+ color: #b00020;
43
+ padding: 2px 0;
44
+ `;
45
+
46
+ const InputText = (props) => {
47
+ const { type = "text", error } = props;
48
+
49
+ return (
50
+ <div>
51
+ <CustomInputText type={type} {...props} error={props.error} />
52
+ {error && error !== "" && (
53
+ <ErrorText errorMessage={error}>{error}</ErrorText>
54
+ )}
55
+ </div>
56
+ );
57
+ };
58
+
59
+ export default React.forwardRef(InputText);
60
+
@@ -0,0 +1,42 @@
1
+ import { createGlobalStyle } from "styled-components";
2
+
3
+ const GlobalStyle = createGlobalStyle`
4
+ *{
5
+ -webkit-overflow-scrolling: touch;
6
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
7
+ }
8
+
9
+ html{
10
+ -webkit-font-smoothing: antialiased;
11
+ -moz-osx-font-smoothing: grayscale;
12
+
13
+ text-size-adjust: 100%;
14
+
15
+ text-rendering: optimizeLegibility;
16
+ scroll-behavior: smooth;
17
+ }
18
+
19
+ body {
20
+ padding: 0;
21
+ margin: 0;
22
+ font-size: 16px;
23
+ font-family: 'PT Sans', sans-serif;
24
+ overflow: hidden;
25
+
26
+ a{
27
+ text-decoration: none;
28
+ }
29
+
30
+ main {
31
+ // margin-top: 105px;
32
+ // background-color: #fff;
33
+ }
34
+ }
35
+
36
+ @font-face {
37
+ font-family: 'Arima Madurai';
38
+ src: url('/fonts/BenjaminVictoria.ttf');
39
+ }
40
+ `;
41
+
42
+ export default GlobalStyle;
@@ -0,0 +1,28 @@
1
+ import { useEffect, useState } from "react";
2
+
3
+ const useDeviceType = () => {
4
+ const [isMobileType, setIsMobileType] = useState(false);
5
+
6
+ const detectDeviceType = () => {
7
+ if (typeof window !== "undefined") {
8
+ // Client-side-only code
9
+ if ("navigator" in window) {
10
+ const { navigator } = window;
11
+ const isMobileViewServer = (
12
+ navigator?.userAgent
13
+ ).match(/Android|BlackBerry|iPhone|iPod|Opera Mini|IEMobile|WPDesktop/i);
14
+
15
+ setIsMobileType(Boolean(isMobileViewServer));
16
+ }
17
+ }
18
+ };
19
+
20
+ useEffect(() => {
21
+ detectDeviceType();
22
+ }, []);
23
+
24
+ return isMobileType;
25
+ };
26
+
27
+ export default useDeviceType;
28
+
@@ -0,0 +1,29 @@
1
+ import { useState, useEffect, useRef, useCallback } from "react";
2
+
3
+ function useThrottle(functionParams, delayParams, immediateParams = false) {
4
+ const [isReady, setIsReady] = useState(true);
5
+ const savedFn = useRef();
6
+
7
+ useEffect(() => {
8
+ savedFn.current = functionParams;
9
+ }, [functionParams]);
10
+
11
+ const throttledFn = useCallback(
12
+ (...args) => {
13
+ if (isReady) {
14
+ setIsReady(false);
15
+ savedFn.current(...args);
16
+ if (immediateParams) {
17
+ setIsReady(true);
18
+ } else {
19
+ setTimeout(() => setIsReady(true), delayParams);
20
+ }
21
+ }
22
+ },
23
+ [delayParams, immediateParams, isReady, savedFn]
24
+ );
25
+
26
+ return throttledFn;
27
+ }
28
+
29
+ export default useThrottle;
package/src/index.css ADDED
@@ -0,0 +1,225 @@
1
+ body {
2
+ margin: 0;
3
+ font-family: Segoe UI, Helvetica Neue, Helvetica, Lucida Grande, Arial, Ubuntu,
4
+ Cantarell, Fira Sans, sans-serif !important;
5
+ font-feature-settings: "kern";
6
+ }
7
+
8
+ :root {
9
+ --shadow-rgb: 11, 20, 26;
10
+ --chat-msg-text: #667781;
11
+ --profile-header: #F53872;
12
+ --black: #111b21;
13
+ --bg-white: #f5f6f6;
14
+ --primary-white: #fff;
15
+ --gray_color: #ededed;
16
+ --icon_color: #54656f;
17
+ --white: #f5f6f6;
18
+ --border_color: #e9edef;
19
+ --chat_hover: #ebebeb;
20
+ --sender_chatbg: #d9fdd3;
21
+ --chat_timing: #667781;
22
+ --input_bg: #fff;
23
+ --profile_bg: #ededed;
24
+ --contact-profile-bg: #ededed;
25
+ --profile-name: #F53872;
26
+ --profile-color:#F53872;
27
+ --danger: red;
28
+ --contact-media-text: #fff;
29
+ --button-primary-background:#00a884;
30
+ --modal_color:#fff;
31
+ --encrypted_color: rgb(0, 0, 0);
32
+ --photopicker_overlay_background: rgba(84,101,111,0.8);
33
+ --modal-backdrop: hsla(0,0%,100%,0.85);
34
+ --toast-background:#0b141a;
35
+ --modal-backDrop:hsla(0,0%,100%,0.85);
36
+ --chat-info-drawer-media-background:#f0f2f5;
37
+ --chat-info-background:linear-gradient(15deg,rgba(var(--overlay-rgb),0),rgba(var(--overlay-rgb),0) 45%,rgba(var(--overlay-rgb),.12) 70%,rgba(var(--overlay-rgb),.33));
38
+ --intro-background:#f0f2f5;
39
+ --reply-background-color: #d1f4cc;
40
+ --reply-pannel-background:rgba(11,20,26,0.05);
41
+ --audio-control-outgoing:#6f8171;
42
+ --toaster-success-bgcolor: #2E7D32;
43
+ --toaster-error-bgcolor: #D32F2F;
44
+ }
45
+
46
+ .dark-theme {
47
+ --chat-msg-text: #667781;
48
+ --profile-header: #202c33;
49
+ --black: #fff;
50
+ --bg-white: #111b21;
51
+ --primary-white: #111b21;
52
+ --gray_color: #202c33;
53
+ --icon_color: #aebac1;
54
+ --white: #111b21;
55
+ --border_color: #2a3942;
56
+ --chat_hover: #202c33;
57
+ --sender_chatbg: #005c4b;
58
+ --chat_timing: hsla(0, 0%, 100%, 0.6);
59
+ --input_bg: #2a3942;
60
+ --profile_bg: #111b21;
61
+ --contact-profile-bg: black;
62
+ --profile-name: #008069;
63
+ --danger: #f15c6d;
64
+ --contact-media-text: #fff;
65
+ --modal_color:#202c33;
66
+ --encrypted_color: rgb(250, 217, 100);
67
+ --photopicker_overlay_background: rgba(84,101,111,0.8);
68
+ --modal-backdrop: rgba(11,20,26,0.85);
69
+ --intro-background:#222e35;
70
+ --toast-background:#0b141a;
71
+ --modal-backDrop:rgba(11,20,26,0.85);
72
+ --chat-info-drawer-media-background:rgb(42, 57, 66);
73
+ --chat-info-background:linear-gradient(15deg,rgba(var(--overlay-rgb),0),rgba(var(--overlay-rgb),0) 45%,rgba(var(--overlay-rgb),.12) 70%,rgba(var(--overlay-rgb),.33));
74
+ --reply-background-color:#025144;
75
+ --audio-control-outgoing: #d1d7db;
76
+ --toaster-success-bgcolor: #2E7D32;
77
+ --toaster-error-bgcolor: #D32F2F;
78
+ }
79
+
80
+ .icons {
81
+ height: 24px;
82
+ width: 24px;
83
+ color: var(--icon_color);
84
+ cursor: pointer;
85
+ }
86
+
87
+ .darkicons {
88
+ height: 20px;
89
+ width: 20px;
90
+ color: var(--icon_color);
91
+ filter: invert(1);
92
+ cursor: pointer;
93
+ }
94
+
95
+ .lighticons {
96
+ height: 20px;
97
+ width: 20px;
98
+ color: var(--icon_color);
99
+ filter: opacity(0.5);
100
+ cursor: pointer;
101
+ }
102
+ .light_footer_icons{
103
+ margin-left:10px;
104
+ height: 22px;
105
+ width: 22px;
106
+ color: var(--icon_color);
107
+ cursor: pointer;
108
+
109
+ }
110
+
111
+ .MuiDrawer-paper{
112
+ background-color: var(--primary-white) !important;
113
+ }
114
+
115
+ .MuiPaper-root{
116
+ background-color: var(--primary-white) !important;
117
+ }
118
+ .dark_footer_icons{
119
+ margin-left:10px;
120
+ height: 22px;
121
+ width: 22px;
122
+ color: var(--icon_color);
123
+ filter: invert(1);
124
+ cursor: pointer;
125
+
126
+ }
127
+
128
+ .grpicons {
129
+ height: 28px;
130
+ width: 28px;
131
+ color: var(--icon_color);
132
+ cursor: pointer;
133
+ }
134
+
135
+ .user_image {
136
+ height: 41px;
137
+ width: 41px;
138
+ border-radius: 25px;
139
+ }
140
+
141
+ .userContact_image {
142
+ height: 49px;
143
+ width: 49px;
144
+ border-radius: 25px;
145
+ font-size: xx-large;
146
+ color: var(--black);
147
+ background-color: var(--icon_color);
148
+ }
149
+
150
+ .text_Color {
151
+ color: var(--chat-msg-text);
152
+ }
153
+
154
+ .icons {
155
+ color: var(--icon_color);
156
+ }
157
+
158
+ .pointer {
159
+ cursor: pointer;
160
+ }
161
+
162
+ .margin {
163
+ margin-left: 7px;
164
+ }
165
+
166
+ .header {
167
+ /* position: fixed; */
168
+ z-index: 2;
169
+ top: 0px;
170
+ }
171
+
172
+ .msgFont {
173
+ font-size: 14px;
174
+ }
175
+ .sidebar_search-container {
176
+ padding: 5px 5px 5px 10px;
177
+ }
178
+
179
+ .sidebar_search-container span img{
180
+ padding:2px;
181
+ }
182
+
183
+ .truncate {
184
+ width: 25vw !important;
185
+ /* white-space: nowrap;
186
+ overflow: hidden;
187
+ text-overflow: ellipsis; */
188
+ }
189
+
190
+ .sliderContainer{
191
+ background-color: var(--white);
192
+ }
193
+
194
+ .textColor {
195
+ color:var(--black)
196
+ }
197
+
198
+ .border_color{
199
+ border-color: var(--border_color);
200
+ }
201
+
202
+ .border_bottom {
203
+ border-bottom: 1px solid var(--border_color);
204
+ }
205
+
206
+ .searchContainer{
207
+ background-color: var(--primary-white);
208
+ }
209
+
210
+ .disable_UI{
211
+ pointer-events: none;
212
+ opacity: 0.4;
213
+ }
214
+
215
+ .absolute{
216
+ position: absolute;
217
+ }
218
+
219
+ .objCover{
220
+ object-fit: cover;
221
+ }
222
+
223
+ .objContain{
224
+ object-fit: contain;
225
+ }
package/src/index.js ADDED
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import ReactDOM from "react-dom/client";
3
+ import "./index.css";
4
+ import "bootstrap/dist/css/bootstrap.css";
5
+ import reportWebVitals from "./reportWebVitals";
6
+ import GlobalStyle from "./global-styles";
7
+ import App from "./App";
8
+ import ChatContext from "./ChatContext";
9
+
10
+ // const store = configureStore()
11
+
12
+ const root = ReactDOM.createRoot(document.getElementById("root"));
13
+
14
+ root.render(
15
+ <>
16
+ <ChatContext mqttCreds={{ licenseKey: "lic-IMKw4CVRR6IHZ26+FhU7S+eG2Egi9NIHjMB", projectId: "fc4bfc08-3243-420f-884d-1ce37d3f453b", keysetId: "2f7d22d7-b743-4714-837e-af0b129bd542", accountId: "60b1ef70ffcf750001d0440d" }}>
17
+ <GlobalStyle />
18
+ <App />
19
+ </ChatContext>
20
+ </>
21
+ );
22
+
23
+ reportWebVitals();
@@ -0,0 +1,21 @@
1
+ export const USER_NAME_MAX_LENGTH = 25;
2
+ export const USER_BIO_MAX_LENGTH = 110;
3
+ export const SECONDS = 1000;
4
+ export const MINUTES = SECONDS * 60;
5
+ export const HOURS = MINUTES * 60;
6
+ export const DAYS = HOURS * 24;
7
+ export const MONTHS = DAYS * 30;
8
+ export const YEARS = MONTHS * 12;
9
+ export const DELETE_CHAT = 'deleteConversationLocally';
10
+ export const CLEAR_CHAT = 'clearConversation';
11
+ export const MESSAGE_DELIVERED = 'messageDelivered';
12
+ export const MESSAGE_READ = 'messageRead';
13
+ export const USER_UNBLOCKED = 'User unblocked successfully.';
14
+ export const MAX_IMAGE_SIZE = 5 * 1024 * 1024; // 5MB
15
+ export const MAX_VIDEO_SIZE = 50 * 1024 * 1024; // 50MB;
16
+ export const MAX_DOCUMENT_SIZE = 50 * 1024 * 1024 ; // 50MB
17
+ export const MESSAGE_DELETE_LOCAL = "messagesDeleteLocal";
18
+ export const MESSAGE_DELETE_FOR_ALL = "messagesDeleteForAll";
19
+ export const CONVERSATION_NOT_FOUND = "Conversations not found.";
20
+ export const USER_UNBLOCK_CONVERSATION = 'userUnblockConversation';
21
+ export const MOBILE_MAX_WIDTH_LIMIT = 420;
@@ -0,0 +1,13 @@
1
+ const setFirstItem = (array, id, fun) => {
2
+ if (array?.length) {
3
+ const currIndex = array.findIndex(
4
+ (obj) => obj?.opponentDetails?.userId === id
5
+ );
6
+ fun(currIndex);
7
+ const filteredData = array.filter(
8
+ (obj) => obj?.opponentDetails?.userId === id
9
+ )[0];
10
+ array.splice(currIndex, 1);
11
+ array.unshift(filteredData);
12
+ }
13
+ };