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 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M11.752 2a2.752 2.752 0 0 1 2.752 2.752V19.25a2.752 2.752 0 1 1-5.504 0V4.752A2.752 2.752 0 0 1 11.752 2Zm7 5a2.752 2.752 0 0 1 2.752 2.752v9.498a2.752 2.752 0 1 1-5.504 0V9.752A2.752 2.752 0 0 1 18.752 7Zm-14 5a2.752 2.752 0 0 1 2.752 2.752v4.498a2.752 2.752 0 0 1-5.504 0v-4.498A2.752 2.752 0 0 1 4.752 12Z"/></svg>
Binary file
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="7.212" height="12.274" viewBox="0 0 7.212 12.274">
2
+ <path id="Path_43" data-name="Path 43" d="M-341.068,149.973a2.034,2.034,0,0,1-.668-.542.679.679,0,0,1,0-1.06q2.223-2.224,4.449-4.446c.077-.077.069-.11,0-.182q-2.227-2.221-4.449-4.446a.651.651,0,0,1-.147-.855,2.3,2.3,0,0,1,.638-.64.629.629,0,0,1,.767.06c.034.028.067.057.1.088l5.354,5.354a.686.686,0,0,1,.159.868.915.915,0,0,1-.159.194q-2.677,2.677-5.353,5.355a.991.991,0,0,1-.421.252Z" transform="translate(341.991 -137.699)" fill="#fff"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="18.346" height="13.63" viewBox="0 0 18.346 13.63">
2
+ <path id="Path_71205" data-name="Path 71205" d="M-511.323,193.394a2.01,2.01,0,0,1-.542.726q-5.479,5.475-10.955,10.953a.9.9,0,0,1-1.162.221,1.169,1.169,0,0,1-.23-.183q-2.325-2.321-4.645-4.645a.888.888,0,0,1,.2-1.482.848.848,0,0,1,.9.09,1.757,1.757,0,0,1,.207.186q1.929,1.927,3.854,3.86c.131.132.189.116.311-.007q5.219-5.23,10.447-10.452a.909.909,0,0,1,1.178-.214,1.036,1.036,0,0,1,.431.6Z" transform="translate(529.418 -192.052)" fill="#1d1c21" stroke="#9e9cab" stroke-width="0.5"/>
3
+ </svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="m12 17.27l4.15 2.51c.76.46 1.69-.22 1.49-1.08l-1.1-4.72l3.67-3.18c.67-.58.31-1.68-.57-1.75l-4.83-.41l-1.89-4.46c-.34-.81-1.5-.81-1.84 0L9.19 8.63l-4.83.41c-.88.07-1.24 1.17-.57 1.75l3.67 3.18l-1.1 4.72c-.2.86.73 1.54 1.49 1.08l4.15-2.5z"/></svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="20.711" height="20.722" viewBox="0 0 20.711 20.722">
2
+ <path id="Path_71203" data-name="Path 71203" d="M-490.895,244.9a9.336,9.336,0,0,1,7.4-9.1,9.308,9.308,0,0,1,11.017,7.295,9.085,9.085,0,0,1-1.709,7.4c-.12.161-.127.239.022.387q1.826,1.8,3.632,3.626a1.037,1.037,0,0,1-.059,1.607,1.034,1.034,0,0,1-1.4-.138q-1.407-1.4-2.809-2.806c-.291-.291-.587-.577-.871-.875-.1-.1-.157-.113-.276-.023a8.9,8.9,0,0,1-6.764,1.855,9.1,9.1,0,0,1-7.311-5.319A8.768,8.768,0,0,1-490.895,244.9Zm16.531.011a7.215,7.215,0,0,0-7.194-7.237,7.213,7.213,0,0,0-7.269,7.185,7.233,7.233,0,0,0,7.229,7.282A7.234,7.234,0,0,0-474.364,244.913Z" transform="translate(490.895 -235.605)" fill="#1d1c21"/>
3
+ </svg>
@@ -0,0 +1,10 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="22" height="23" viewBox="0 0 22 23">
2
+ <defs>
3
+ <clipPath id="clip-path">
4
+ <rect id="Rectangle_1765" data-name="Rectangle 1765" width="22" height="23" transform="translate(0.15 0)" fill="#f53872"/>
5
+ </clipPath>
6
+ </defs>
7
+ <g id="send-2" transform="translate(-0.15)" clip-path="url(#clip-path)">
8
+ <path id="Path_71218" data-name="Path 71218" d="M4.161,15.623l6.491-1.3c.58-.116.58-.3,0-.42l-6.491-1.3a1.158,1.158,0,0,1-.84-.84l-1.3-6.491c-.116-.58.226-.849.763-.6l19.808,9.142c.358.165.358.434,0,.6L2.785,23.556c-.537.248-.879-.022-.763-.6l1.3-6.491A1.158,1.158,0,0,1,4.161,15.623Z" transform="translate(-0.525 -2.164)" fill="#f53872"/>
9
+ </g>
10
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="19.691" height="18.771" viewBox="0 0 19.691 18.771">
2
+ <path id="Path_71222" data-name="Path 71222" d="M-691.564,1499.024c-.8-.071-1.6-.15-2.4-.225-1.253-.117-2.506-.234-3.76-.344a.215.215,0,0,1-.208-.155c-.106-.254-.215-.506-.327-.757-.3-.671-.561-1.358-.884-2.018l-.039.017.039-.017a.848.848,0,0,0-.033-.128q-.6-1.392-1.2-2.783a.516.516,0,0,0-.494-.359.522.522,0,0,0-.507.368l-.614,1.427-1.836,4.262c-.031.071-.054.131-.156.138-.4.03-.8.075-1.2.111-.757.068-1.515.13-2.272.2-.91.084-1.819.177-2.728.26a.542.542,0,0,0-.5.349.512.512,0,0,0,.173.586q1.109.979,2.223,1.952,1.22,1.071,2.439,2.143a.229.229,0,0,1,.088.25q-.549,2.407-1.091,4.815c-.1.448-.217.892-.289,1.347a.506.506,0,0,0,.754.494c.424-.236.833-.5,1.249-.749.04-.021.08-.04.118-.063q2-1.186,3.993-2.375a.256.256,0,0,1,.307-.007q1.992,1.194,3.992,2.376c.462.274.919.558,1.391.815a.49.49,0,0,0,.733-.475,2.062,2.062,0,0,0-.063-.357q-.654-2.9-1.31-5.793a.256.256,0,0,1,.087-.285q2.075-1.813,4.139-3.637a2.99,2.99,0,0,0,.723-.731v-.269A.642.642,0,0,0-691.564,1499.024Zm-7.866-3.271c.017-.021.034-.041.052-.061C-699.4,1495.712-699.414,1495.733-699.43,1495.754Zm.08-.09a.685.685,0,0,1,.092-.078A.685.685,0,0,0-699.35,1495.663Z" transform="translate(710.727 -1492.256)" fill="#9e9cab"/>
3
+ </svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M13 5.08A7 7 0 0 1 18.92 11h3.03c-.47-4.72-4.23-8.48-8.95-8.95v3.03zM18.92 13A7 7 0 0 1 13 18.92v3.03c4.72-.47 8.48-4.23 8.95-8.95h-3.03zM11 18.92c-3.39-.49-6-3.4-6-6.92s2.61-6.43 6-6.92V2.05c-5.05.5-9 4.76-9 9.95c0 5.19 3.95 9.45 9 9.95v-3.03z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M18.5 2h-13C3.6 2 2 3.6 2 5.5v13C2 20.4 3.6 22 5.5 22H16l6-6V5.5C22 3.6 20.4 2 18.5 2m1.6 13h-1.5c-1.9 0-3.5 1.6-3.5 3.5V20H5.8c-1 0-1.8-.8-1.8-1.8V5.8C4 4.8 4.8 4 5.8 4h12.5c1 0 1.8.8 1.8 1.8V15M7 7h10v2H7V7m0 4h10v2H7v-2m0 4h6v2H7v-2Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="#f15c6d" d="M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57l-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm4 0v12h4V3h-4z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M12 12q-1.65 0-2.825-1.175T8 8q0-1.65 1.175-2.825T12 4q1.65 0 2.825 1.175T16 8q0 1.65-1.175 2.825T12 12Zm-8 8v-2.8q0-.85.438-1.563T5.6 14.55q1.55-.775 3.15-1.163T12 13q1.65 0 3.25.388t3.15 1.162q.725.375 1.163 1.088T20 17.2V20H4Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M16.5 12A2.5 2.5 0 0 0 19 9.5A2.5 2.5 0 0 0 16.5 7A2.5 2.5 0 0 0 14 9.5a2.5 2.5 0 0 0 2.5 2.5M9 11a3 3 0 0 0 3-3a3 3 0 0 0-3-3a3 3 0 0 0-3 3a3 3 0 0 0 3 3m7.5 3c-1.83 0-5.5.92-5.5 2.75V19h11v-2.25c0-1.83-3.67-2.75-5.5-2.75M9 13c-2.33 0-7 1.17-7 3.5V19h7v-2.25c0-.85.33-2.34 2.37-3.47C10.5 13.1 9.66 13 9 13Z"/></svg>
Binary file
@@ -0,0 +1,38 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <link rel="icon" href="./icons/arrow_logo.svg" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
8
+ <meta name="theme-color" content="#000000" />
9
+ <meta name="description" content="Web site created using create-react-app" />
10
+ <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
11
+ <!-- CSS only -->
12
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet"
13
+ integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
14
+ <link
15
+ rel="stylesheet"
16
+ href="https://fonts.googleapis.com/icon?family=Material+Icons"
17
+ />
18
+ <!-- FONT STYLE -->
19
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
20
+
21
+ <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
22
+ <!-- JavaScript Bundle with Popper -->
23
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"
24
+ integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"
25
+ crossorigin="anonymous"></script>
26
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css"
27
+ integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous" />
28
+
29
+ <title>Isometrik Chat</title>
30
+ </head>
31
+
32
+ <body>
33
+ <noscript>You need to enable JavaScript to run this app.</noscript>
34
+ <div id="root"></div>
35
+
36
+ </body>
37
+
38
+ </html>
Binary file
Binary file
@@ -0,0 +1,25 @@
1
+ {
2
+ "short_name": "Isometric Chat",
3
+ "name": "Isometric Chat",
4
+ "icons": [
5
+ {
6
+ "src": "Logo-192x192.png",
7
+ "type": "image/png",
8
+ "sizes": "192x192"
9
+ },
10
+ {
11
+ "src": "Logo-512x512.png",
12
+ "type": "image/png",
13
+ "sizes": "512x512"
14
+ }
15
+ ],
16
+ "start_url": "/",
17
+ "scope": "/",
18
+ "serviceworker": {
19
+ "src": "./service-worker.js",
20
+ "scope": "/"
21
+ },
22
+ "display": "standalone",
23
+ "theme_color": "#000000",
24
+ "background_color": "#ffffff"
25
+ }
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Isometric Chat</title>
8
+ </head>
9
+ <body>
10
+ <h1>Sorry, You are offline</h1>
11
+ </body>
12
+ </html>
@@ -0,0 +1,3 @@
1
+ # https://www.robotstxt.org/robotstxt.html
2
+ User-agent: *
3
+ Disallow:
@@ -0,0 +1,81 @@
1
+ // service-worker.js
2
+
3
+ const OFFLINE_VERSION = 1;
4
+ const CACHE_NAME = 'offline';
5
+
6
+ const OFFLINE_URL = './offline.html';
7
+
8
+ self.addEventListener('install', (event) => {
9
+ event.waitUntil((async () => {
10
+ const cache = await caches.open(CACHE_NAME);
11
+ // Setting {cache: 'reload'} in the new request will ensure that the response
12
+ // isn't fulfilled from the HTTP cache; i.e., it will be from the network.
13
+ await cache.add(new Request(OFFLINE_URL, {cache: 'reload'}));
14
+ })());
15
+ });
16
+
17
+ self.addEventListener('activate', (event) => {
18
+ event.waitUntil((async () => {
19
+ // Enable navigation preload if it's supported.
20
+ // See https://developers.google.com/web/updates/2017/02/navigation-preload
21
+ if ('navigationPreload' in self.registration) {
22
+ await self.registration.navigationPreload.enable();
23
+ }
24
+ })());
25
+
26
+ // Tell the active service worker to take control of the page immediately.
27
+ self.clients.claim();
28
+ });
29
+
30
+
31
+ self.addEventListener('fetch', (event) => {
32
+ // We only want to call event.respondWith() if this is a navigation request
33
+ // for an HTML page.
34
+ if (event.request.mode === 'navigate') {
35
+ event.respondWith((async () => {
36
+ try {
37
+ // First, try to use the navigation preload response if it's supported.
38
+ const preloadResponse = await event.preloadResponse;
39
+ if (preloadResponse) {
40
+ return preloadResponse;
41
+ }
42
+
43
+ const networkResponse = await fetch(event.request);
44
+ return networkResponse;
45
+ } catch (error) {
46
+ // catch is only triggered if an exception is thrown, which is likely
47
+ // due to a network error.
48
+ // If fetch() returns a valid HTTP response with a response code in
49
+ // the 4xx or 5xx range, the catch() will NOT be called.
50
+ console.log('Fetch failed; returning offline page instead.', error);
51
+
52
+ const cache = await caches.open(CACHE_NAME);
53
+ const cachedResponse = await cache.match(OFFLINE_URL);
54
+ return cachedResponse;
55
+ }
56
+ })());
57
+ }
58
+
59
+ // If our if() condition is false, then this fetch handler won't intercept the
60
+ // request. If there are any other fetch handlers registered, they will get a
61
+ // chance to call event.respondWith(). If no fetch handlers call
62
+ // event.respondWith(), the request will be handled by the browser as if there
63
+ // were no service worker involvement.
64
+ });
65
+
66
+
67
+ // self.addEventListener('install', event => {
68
+ // event.waitUntil(
69
+ // caches.open('offline-cache').then((cache) => {
70
+ // return cache.add('./offline.html');
71
+ // })
72
+ // );
73
+ // });
74
+
75
+ // self.addEventListener('fetch', event => {
76
+ // event.respondWith(
77
+ // caches.match(event.request).then(response => {
78
+ // return response || fetch(event.request) || caches.match('./offline.html');
79
+ // })
80
+ // );
81
+ // });
package/src/App.js ADDED
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import WhatsappMainBox from "./pages/WhatsappMainBox";
3
+
4
+ function App() {
5
+
6
+ return (
7
+ <div>
8
+ <>
9
+ <WhatsappMainBox showSideChatHeader={true} />
10
+ </>
11
+ </div>
12
+ );
13
+ }
14
+
15
+ export default App;
@@ -0,0 +1,8 @@
1
+ import { render, screen } from '@testing-library/react';
2
+ import App from './App';
3
+
4
+ test('renders learn react link', () => {
5
+ render(<App />);
6
+ const linkElement = screen.getByText(/learn react/i);
7
+ expect(linkElement).toBeInTheDocument();
8
+ });
@@ -0,0 +1,16 @@
1
+ import React, { useState } from "react";
2
+ import Login from "./components/Registration/Login";
3
+ import SignUp from "./components/Registration/SignUp";
4
+
5
+ const Authpage = (props) => {
6
+ const { theme } = props
7
+ const [isLoginPage, setLoginPage] = useState(true);
8
+ return (
9
+ <div>
10
+ {isLoginPage && <Login setLoginPage={setLoginPage} theme={theme} />}
11
+ {!isLoginPage && <SignUp setLoginPage={setLoginPage} theme={theme} />}
12
+ </div>
13
+ );
14
+ };
15
+
16
+ export default Authpage;
@@ -0,0 +1,172 @@
1
+ import { createContext, useContext, useEffect, useState } from "react";
2
+ import { getCookie, setCookie } from "./lib/session";
3
+ import client from "./utils/chatSdk";
4
+ import { decodeChatBody, getDeviceId } from "./lib/helpers";
5
+ import { ARROW_LOGO } from "./utils/global";
6
+
7
+ const Chat = createContext();
8
+
9
+ const ChatContext = (props) => {
10
+ const { children, mqttCreds } = props;
11
+
12
+ const [theme, setTheme] = useState();
13
+ const [loading, setLoading] = useState(true);
14
+ const [userloggedIn, setUserloggedIn] = useState(false);
15
+ const [userDetails, setUserDetails] = useState();
16
+ const [showLoader, setShowLoader] = useState(true);
17
+ const [findUserId, setFindUserId] = useState({});
18
+ const [state, setState] = useState({
19
+ selectedConvId: "",
20
+ messages: {},
21
+ conversations: [],
22
+ users: [],
23
+ });
24
+
25
+ const userId = getCookie("userId");
26
+
27
+ useEffect(() => {
28
+ const isDarkTheme = getCookie("theme");
29
+ isDarkTheme === "true" ? setTheme(true) : setTheme(false);
30
+ if (isDarkTheme === "true") {
31
+ const element = document.body;
32
+ element.classList.add("dark-theme");
33
+ }
34
+ getData();
35
+ fetchUserToken();
36
+ registerServiceWorker();
37
+ }, []);
38
+
39
+ const registerServiceWorker = () => {
40
+ try {
41
+ if ('serviceWorker' in navigator) {
42
+ window.addEventListener('load', () => {
43
+ navigator.serviceWorker.register('/service-worker.js')
44
+ .then(registration => {
45
+ console.log('Service worker registered:', registration);
46
+ })
47
+ .catch(error => {
48
+ console.log('Service worker registration failed:', error);
49
+ });
50
+ });
51
+ } else {
52
+ console.log('service worker not available');
53
+ }
54
+ }
55
+ catch(error) {
56
+ console.log('!! --- Error while registering service worker -- !!!');
57
+ }
58
+ }
59
+
60
+ const fetchUserToken = async () => {
61
+ try {
62
+ const token = getCookie("userToken");
63
+ if (token) {
64
+ client?.user?.setUserToken(token);
65
+ setUserloggedIn(true);
66
+ } else {
67
+ setUserloggedIn(false);
68
+ }
69
+ setLoading(false);
70
+ client.user.getUserDetails().then((res) => {
71
+ setUserDetails(res);
72
+ });
73
+ }
74
+ catch(err) {
75
+ console.log('Errrroorrr -- ', err);
76
+ }
77
+ }
78
+
79
+ const getData = async () => {
80
+ const deviceId = await getDeviceId();
81
+
82
+ const mqttClient = client.initializeMqtt({
83
+ hostUri: "wss://connections.isometrik.io:2053/mqtt",
84
+ clientId: userId,
85
+ licenseKey: mqttCreds.licenseKey, // context
86
+ projectId: mqttCreds.projectId, // context
87
+ keysetId: mqttCreds.keysetId, // context
88
+ accountId: mqttCreds.accountId, // context
89
+ deviceId,
90
+ });
91
+ mqttClient.on("MESSAGE_RECEIVED", (msg) => {
92
+ const message = JSON.parse(msg?.payloadString);
93
+ console.log("APPmessage", message);
94
+ setFindUserId(message);
95
+ setState((prev) => {
96
+ if (
97
+ prev?.messages &&
98
+ Object.keys(prev?.messages).includes(message?.conversationId)
99
+ ) {
100
+ if (message?.body?.length > 0) {
101
+ return {
102
+ ...prev,
103
+ messages: {
104
+ ...prev?.messages,
105
+ [message?.conversationId]: [
106
+ message,
107
+ ...prev?.messages[message?.conversationId],
108
+ ],
109
+ },
110
+ };
111
+ }else {
112
+ return {
113
+ ...prev,
114
+ messages: {
115
+ ...prev?.messages,
116
+ [message?.conversationId]: [
117
+ ...prev?.messages[message?.conversationId],
118
+ ],
119
+ },
120
+ };
121
+ }
122
+ } else {
123
+ return {
124
+ ...prev,
125
+ messages: {
126
+ ...prev?.messages,
127
+ [message?.conversationId]: [message],
128
+ },
129
+ };
130
+ }
131
+ });
132
+ });
133
+ };
134
+
135
+ useEffect(() => {
136
+ if(!Object.keys(findUserId).length || !findUserId.body || findUserId?.senderId === userId) return;
137
+ const title = `You have received a new message from ${findUserId.senderName}`;
138
+ const body = `${decodeChatBody(findUserId.body)}`;
139
+ const icon = ARROW_LOGO;
140
+
141
+ // const pushNotification = new Notification(title, { body, icon });
142
+
143
+ showNotification(title, body, icon);
144
+
145
+ // return () => pushNotification.close();
146
+
147
+ }, [findUserId.body])
148
+
149
+ function showNotification(title, body, icon) {
150
+ // Notification.requestPermission((result) => {
151
+ // if (result === "granted") {
152
+ navigator?.serviceWorker?.ready?.then((registration) => {
153
+ registration.showNotification(title, { body, icon });
154
+ })?.catch(err => console.log('error while pushing notifications using sw - ', err));
155
+ // }
156
+ // });
157
+ }
158
+
159
+ useEffect(() => {
160
+ setCookie("theme", theme);
161
+ const element = document.body;
162
+ element.classList.toggle("dark-theme");
163
+ }, [theme])
164
+
165
+ return (<Chat.Provider value={{ theme, setTheme, mqttCreds, setLoading, loading, setUserloggedIn, userloggedIn, setUserDetails, userDetails , setShowLoader, showLoader, userId, findUserId, setFindUserId, setState, state }}>{children}</Chat.Provider>)
166
+ }
167
+
168
+ export default ChatContext;
169
+
170
+ export const ChatState = () => {
171
+ return useContext(Chat);
172
+ }
@@ -0,0 +1,110 @@
1
+
2
+ export var chatList = [
3
+ {
4
+ id: "1",
5
+ name: "Harsh khandelwal",
6
+ message: "Hello World",
7
+ img: "https://i.pravatar.cc/250?u=mail@ashallendesign.co.uk",
8
+ },
9
+
10
+ {
11
+ id: "2",
12
+ name: "Akash sharma",
13
+ message: "Hello there ",
14
+ img: "https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250",
15
+ },
16
+ {
17
+ id: "3",
18
+ name: "Amit gupta",
19
+ message: "How are you bro..",
20
+ img: "https://eu.ui-avatars.com/api/?name=John+Doe&size=250",
21
+ },
22
+
23
+ {
24
+ id: "4",
25
+ name: "Sujjet kumar",
26
+ message: "Yeah im good hpw are you",
27
+ img: "https://placebeard.it/250/250",
28
+ },
29
+ {
30
+ id: "5",
31
+ name: "Harshita mittal",
32
+ message: "im on my way to coming",
33
+ // img: "https://avatars.dicebear.com/api/adventurer-neutral/mail%40ashallendesign.co.uk.svg",
34
+ },
35
+
36
+ {
37
+ id: "6",
38
+ name: "Sonu jain",
39
+ message: "Off to ALwar",
40
+ img: "https://robohash.org/mail@ashallendesign.co.uk",
41
+ },
42
+ {
43
+ id: "7",
44
+ name: "Nisha kumari",
45
+ message: " Welcome to Appscrip harsh",
46
+ img: "https://via.placeholder.com/250",
47
+ },
48
+ {
49
+ id: "8",
50
+ name: "Sujjet kumar",
51
+ message: "Yeah im good hpw are you",
52
+ img: "https://placebeard.it/250/250",
53
+ },
54
+ {
55
+ id: "9",
56
+ name: "Harshita mehta",
57
+ message: "im on my way to coming",
58
+ img: "https://robohash.org/mail@ashallendesign.co.uk",
59
+ },
60
+
61
+ {
62
+ id: "10",
63
+ name: "Sonu goyal",
64
+ message: "Off to ALwar",
65
+ img: "https://placebeard.it/250/250",
66
+ },
67
+ {
68
+ id: "11",
69
+ name: "Nisha mittal",
70
+ message: " Welcome to Appscrip harsh",
71
+ img: "https://placebear.com/250/250",
72
+ },
73
+ ];
74
+ // ta = "mcdc"
75
+
76
+ // COLOR Code
77
+
78
+ export const PRIMARY_COLOUR = "rgba(0, 0, 0, 0.8)";
79
+ export const BG_COlOUR = "black";
80
+ export const WhITE = "white";
81
+
82
+ // FONT_SIZE_CODE
83
+ export const fontSize = {
84
+ name: "17px",
85
+ message: "14px",
86
+ };
87
+
88
+ // BACKGROUND_IMAGE
89
+ export var menuItem = [
90
+ "Archiv chat",
91
+ "Mute conversation",
92
+ "Delete Chat",
93
+ "Pinchat",
94
+ "mark as unread",
95
+ ];
96
+ export var headerMenuitem = [
97
+ "New Group",
98
+ "New Community",
99
+ "Started Message",
100
+ "Setting",
101
+ "Logout",
102
+ ];
103
+ export var searchmenuitem = [
104
+ "menuitem",
105
+ "New community",
106
+ "started message",
107
+ "logout",
108
+ ];
109
+
110
+ // LOG0
@@ -0,0 +1,49 @@
1
+ const icons = {
2
+ lock: (props) => (
3
+ <svg
4
+ width="10px"
5
+ height="12px"
6
+ viewBox="0 0 10 12"
7
+ version="1.1"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ {...props}
10
+ >
11
+ <path
12
+ d="M5.00847986,1.6 C6.38255462,1.6 7.50937014,2.67435859 7.5940156,4.02703389 L7.59911976,4.1906399 L7.599,5.462 L7.75719976,5.46214385 C8.34167974,5.46214385 8.81591972,5.94158383 8.81591972,6.53126381 L8.81591972,9.8834238 C8.81591972,10.4731038 8.34167974,10.9525438 7.75719976,10.9525438 L2.25767996,10.9525438 C1.67527998,10.9525438 1.2,10.4731038 1.2,9.8834238 L1.2,6.53126381 C1.2,5.94158383 1.67423998,5.46214385 2.25767996,5.46214385 L2.416,5.462 L2.41679995,4.1906399 C2.41679995,2.81636129 3.49135449,1.68973395 4.84478101,1.60510326 L5.00847986,1.6 Z M5.00847986,2.84799995 C4.31163824,2.84799995 3.73624912,3.38200845 3.6709675,4.06160439 L3.6647999,4.1906399 L3.663,5.462 L6.35,5.462 L6.35111981,4.1906399 C6.35111981,3.53817142 5.88169076,2.99180999 5.26310845,2.87228506 L5.13749818,2.85416626 L5.00847986,2.84799995 Z"
13
+ fill="currentColor"
14
+ ></path>
15
+ </svg>
16
+ ),
17
+ singleTick: (props) => (
18
+ <svg
19
+ xmlns="http://www.w3.org/2000/svg"
20
+ viewBox="0 0 16 15"
21
+ width="16"
22
+ height="15"
23
+ {...props}
24
+ >
25
+ <path
26
+ fill="currentColor"
27
+ d="M10.91 3.316l-.478-.372a.365.365 0 0 0-.51.063L4.566 9.879a.32.32 0 0 1-.484.033L1.891 7.769a.366.366 0 0 0-.515.006l-.423.433a.364.364 0 0 0 .006.514l3.258 3.185c.143.14.361.125.484-.033l6.272-8.048a.365.365 0 0 0-.063-.51z"
28
+ ></path>
29
+ </svg>
30
+ ),
31
+ doubleTick: (props) => (
32
+ <svg
33
+ xmlns="http://www.w3.org/2000/svg"
34
+ viewBox="0 0 16 15"
35
+ width="16"
36
+ height="15"
37
+ {...props}
38
+ >
39
+ <path
40
+ fill="currentColor"
41
+ d="M15.01 3.316l-.478-.372a.365.365 0 0 0-.51.063L8.666 9.879a.32.32 0 0 1-.484.033l-.358-.325a.319.319 0 0 0-.484.032l-.378.483a.418.418 0 0 0 .036.541l1.32 1.266c.143.14.361.125.484-.033l6.272-8.048a.366.366 0 0 0-.064-.512zm-4.1 0l-.478-.372a.365.365 0 0 0-.51.063L4.566 9.879a.32.32 0 0 1-.484.033L1.891 7.769a.366.366 0 0 0-.515.006l-.423.433a.364.364 0 0 0 .006.514l3.258 3.185c.143.14.361.125.484-.033l6.272-8.048a.365.365 0 0 0-.063-.51z"
42
+ ></path>
43
+ </svg>
44
+ ),
45
+ };
46
+
47
+ // name: (props) => (),
48
+
49
+ export default icons;