chat 1.0.8 → 3.0.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 (318) hide show
  1. package/package.json +2 -96
  2. package/readme.md +1 -201
  3. package/lib/module/ChatContext/index.js +0 -2
  4. package/lib/module/ChatContext/index.js.map +0 -1
  5. package/lib/module/ChatContext/types.js +0 -2
  6. package/lib/module/ChatContext/types.js.map +0 -1
  7. package/lib/module/classes/Chat/index.js +0 -2
  8. package/lib/module/classes/Chat/index.js.map +0 -1
  9. package/lib/module/classes/Chat/types.js +0 -2
  10. package/lib/module/classes/Chat/types.js.map +0 -1
  11. package/lib/module/classes/Inbox/index.js +0 -2
  12. package/lib/module/classes/Inbox/index.js.map +0 -1
  13. package/lib/module/classes/Inbox/types.js +0 -2
  14. package/lib/module/classes/Inbox/types.js.map +0 -1
  15. package/lib/module/classes/Message/index.js +0 -2
  16. package/lib/module/classes/Message/index.js.map +0 -1
  17. package/lib/module/classes/Message/types.js +0 -2
  18. package/lib/module/classes/Message/types.js.map +0 -1
  19. package/lib/module/classes/Reaction/index.js +0 -2
  20. package/lib/module/classes/Reaction/index.js.map +0 -1
  21. package/lib/module/classes/Reaction/types.js +0 -2
  22. package/lib/module/classes/Reaction/types.js.map +0 -1
  23. package/lib/module/classes/Room/index.js +0 -2
  24. package/lib/module/classes/Room/index.js.map +0 -1
  25. package/lib/module/classes/Room/types.js +0 -2
  26. package/lib/module/classes/Room/types.js.map +0 -1
  27. package/lib/module/classes/index.js +0 -2
  28. package/lib/module/classes/index.js.map +0 -1
  29. package/lib/module/components/Avatar/index.js +0 -2
  30. package/lib/module/components/Avatar/index.js.map +0 -1
  31. package/lib/module/components/Chat/Bubble/index.js +0 -2
  32. package/lib/module/components/Chat/Bubble/index.js.map +0 -1
  33. package/lib/module/components/Chat/Composer/Input/index.js +0 -2
  34. package/lib/module/components/Chat/Composer/Input/index.js.map +0 -1
  35. package/lib/module/components/Chat/Composer/Send/index.js +0 -2
  36. package/lib/module/components/Chat/Composer/Send/index.js.map +0 -1
  37. package/lib/module/components/Chat/Composer/index.js +0 -2
  38. package/lib/module/components/Chat/Composer/index.js.map +0 -1
  39. package/lib/module/components/Chat/Media/Image/index.js +0 -2
  40. package/lib/module/components/Chat/Media/Image/index.js.map +0 -1
  41. package/lib/module/components/Chat/Media/index.js +0 -2
  42. package/lib/module/components/Chat/Media/index.js.map +0 -1
  43. package/lib/module/components/Chat/Message/Swiper/Action/index.js +0 -2
  44. package/lib/module/components/Chat/Message/Swiper/Action/index.js.map +0 -1
  45. package/lib/module/components/Chat/Message/Swiper/index.js +0 -2
  46. package/lib/module/components/Chat/Message/Swiper/index.js.map +0 -1
  47. package/lib/module/components/Chat/Message/Touchable/index.js +0 -2
  48. package/lib/module/components/Chat/Message/Touchable/index.js.map +0 -1
  49. package/lib/module/components/Chat/Message/index.js +0 -2
  50. package/lib/module/components/Chat/Message/index.js.map +0 -1
  51. package/lib/module/components/Chat/SystemMessage/index.js +0 -2
  52. package/lib/module/components/Chat/SystemMessage/index.js.map +0 -1
  53. package/lib/module/components/Chat/TypingFooter/index.js +0 -2
  54. package/lib/module/components/Chat/TypingFooter/index.js.map +0 -1
  55. package/lib/module/components/Chat/index.js +0 -2
  56. package/lib/module/components/Chat/index.js.map +0 -1
  57. package/lib/module/components/Chat/types.js +0 -2
  58. package/lib/module/components/Chat/types.js.map +0 -1
  59. package/lib/module/components/Chat-Old/Bubble/index.js +0 -2
  60. package/lib/module/components/Chat-Old/Bubble/index.js.map +0 -1
  61. package/lib/module/components/Chat-Old/Composer/Input/index.js +0 -2
  62. package/lib/module/components/Chat-Old/Composer/Input/index.js.map +0 -1
  63. package/lib/module/components/Chat-Old/Composer/Send/index.js +0 -2
  64. package/lib/module/components/Chat-Old/Composer/Send/index.js.map +0 -1
  65. package/lib/module/components/Chat-Old/Composer/index.js +0 -2
  66. package/lib/module/components/Chat-Old/Composer/index.js.map +0 -1
  67. package/lib/module/components/Chat-Old/Message/index.js +0 -2
  68. package/lib/module/components/Chat-Old/Message/index.js.map +0 -1
  69. package/lib/module/components/Chat-Old/Swiper/Action/index.js +0 -2
  70. package/lib/module/components/Chat-Old/Swiper/Action/index.js.map +0 -1
  71. package/lib/module/components/Chat-Old/Swiper/index.js +0 -2
  72. package/lib/module/components/Chat-Old/Swiper/index.js.map +0 -1
  73. package/lib/module/components/Chat-Old/SystemMessage/index.js +0 -2
  74. package/lib/module/components/Chat-Old/SystemMessage/index.js.map +0 -1
  75. package/lib/module/components/Chat-Old/index.js +0 -2
  76. package/lib/module/components/Chat-Old/index.js.map +0 -1
  77. package/lib/module/components/Chat-Old/types.js +0 -2
  78. package/lib/module/components/Chat-Old/types.js.map +0 -1
  79. package/lib/module/components/ChatProvider/index.js +0 -2
  80. package/lib/module/components/ChatProvider/index.js.map +0 -1
  81. package/lib/module/components/ChatProvider/types.js +0 -2
  82. package/lib/module/components/ChatProvider/types.js.map +0 -1
  83. package/lib/module/components/Inbox/Item/Circle/index.js +0 -2
  84. package/lib/module/components/Inbox/Item/Circle/index.js.map +0 -1
  85. package/lib/module/components/Inbox/Item/Circle/types.js +0 -2
  86. package/lib/module/components/Inbox/Item/Circle/types.js.map +0 -1
  87. package/lib/module/components/Inbox/Item/Initials/index.js +0 -2
  88. package/lib/module/components/Inbox/Item/Initials/index.js.map +0 -1
  89. package/lib/module/components/Inbox/Item/ItemDate/index.js +0 -2
  90. package/lib/module/components/Inbox/Item/ItemDate/index.js.map +0 -1
  91. package/lib/module/components/Inbox/Item/Separator/index.js +0 -2
  92. package/lib/module/components/Inbox/Item/Separator/index.js.map +0 -1
  93. package/lib/module/components/Inbox/Item/Subtitle/index.js +0 -2
  94. package/lib/module/components/Inbox/Item/Subtitle/index.js.map +0 -1
  95. package/lib/module/components/Inbox/Item/Swipeable/index.js +0 -2
  96. package/lib/module/components/Inbox/Item/Swipeable/index.js.map +0 -1
  97. package/lib/module/components/Inbox/Item/Title/index.js +0 -2
  98. package/lib/module/components/Inbox/Item/Title/index.js.map +0 -1
  99. package/lib/module/components/Inbox/Item/UnreadIndicator/index.js +0 -2
  100. package/lib/module/components/Inbox/Item/UnreadIndicator/index.js.map +0 -1
  101. package/lib/module/components/Inbox/Item/index.js +0 -2
  102. package/lib/module/components/Inbox/Item/index.js.map +0 -1
  103. package/lib/module/components/Inbox/index.js +0 -2
  104. package/lib/module/components/Inbox/index.js.map +0 -1
  105. package/lib/module/components/Inbox/question.md +0 -21
  106. package/lib/module/components/Inbox/readme.md +0 -21
  107. package/lib/module/components/Inbox/types.js +0 -2
  108. package/lib/module/components/Inbox/types.js.map +0 -1
  109. package/lib/module/components/RoomCreator/Content/Footer/Button/index.js +0 -2
  110. package/lib/module/components/RoomCreator/Content/Footer/Button/index.js.map +0 -1
  111. package/lib/module/components/RoomCreator/Content/Footer/Input/index.js +0 -2
  112. package/lib/module/components/RoomCreator/Content/Footer/Input/index.js.map +0 -1
  113. package/lib/module/components/RoomCreator/Content/Footer/index.js +0 -2
  114. package/lib/module/components/RoomCreator/Content/Footer/index.js.map +0 -1
  115. package/lib/module/components/RoomCreator/Content/Item/Icon/index.js +0 -2
  116. package/lib/module/components/RoomCreator/Content/Item/Icon/index.js.map +0 -1
  117. package/lib/module/components/RoomCreator/Content/Item/index.js +0 -2
  118. package/lib/module/components/RoomCreator/Content/Item/index.js.map +0 -1
  119. package/lib/module/components/RoomCreator/Content/index.js +0 -2
  120. package/lib/module/components/RoomCreator/Content/index.js.map +0 -1
  121. package/lib/module/components/RoomCreator/Header/index.js +0 -2
  122. package/lib/module/components/RoomCreator/Header/index.js.map +0 -1
  123. package/lib/module/components/RoomCreator/index.js +0 -2
  124. package/lib/module/components/RoomCreator/index.js.map +0 -1
  125. package/lib/module/components/RoomCreator/types.js +0 -2
  126. package/lib/module/components/RoomCreator/types.js.map +0 -1
  127. package/lib/module/components/TypingIndicator/index.js +0 -2
  128. package/lib/module/components/TypingIndicator/index.js.map +0 -1
  129. package/lib/module/components/index.js +0 -2
  130. package/lib/module/components/index.js.map +0 -1
  131. package/lib/module/helpers/getInitials.js +0 -2
  132. package/lib/module/helpers/getInitials.js.map +0 -1
  133. package/lib/module/helpers/sortByAvatar.js +0 -2
  134. package/lib/module/helpers/sortByAvatar.js.map +0 -1
  135. package/lib/module/hooks/index.js +0 -2
  136. package/lib/module/hooks/index.js.map +0 -1
  137. package/lib/module/hooks/useCreateRoom/index.js +0 -2
  138. package/lib/module/hooks/useCreateRoom/index.js.map +0 -1
  139. package/lib/module/hooks/useCreator/index.js +0 -2
  140. package/lib/module/hooks/useCreator/index.js.map +0 -1
  141. package/lib/module/hooks/useInbox/index.js +0 -2
  142. package/lib/module/hooks/useInbox/index.js.map +0 -1
  143. package/lib/module/hooks/useInbox/types.js +0 -2
  144. package/lib/module/hooks/useInbox/types.js.map +0 -1
  145. package/lib/module/hooks/useMessages/index.js +0 -2
  146. package/lib/module/hooks/useMessages/index.js.map +0 -1
  147. package/lib/module/hooks/useMessages/types.js +0 -2
  148. package/lib/module/hooks/useMessages/types.js.map +0 -1
  149. package/lib/module/hooks/useRoom/index.js +0 -2
  150. package/lib/module/hooks/useRoom/index.js.map +0 -1
  151. package/lib/module/hooks/useRoom/types.js +0 -2
  152. package/lib/module/hooks/useRoom/types.js.map +0 -1
  153. package/lib/module/hooks/useSend/useSendToGroup/index.js +0 -2
  154. package/lib/module/hooks/useSend/useSendToGroup/index.js.map +0 -1
  155. package/lib/module/hooks/useSend/useSendToPeople/index.js +0 -2
  156. package/lib/module/hooks/useSend/useSendToPeople/index.js.map +0 -1
  157. package/lib/module/hooks/useTyping/index.js +0 -2
  158. package/lib/module/hooks/useTyping/index.js.map +0 -1
  159. package/lib/module/hooks/useTypingOLD/index.js +0 -2
  160. package/lib/module/hooks/useTypingOLD/index.js.map +0 -1
  161. package/lib/module/hooks/useTypingOLD/types.js +0 -2
  162. package/lib/module/hooks/useTypingOLD/types.js.map +0 -1
  163. package/lib/module/hooks/useViewMessages/index.js +0 -2
  164. package/lib/module/hooks/useViewMessages/index.js.map +0 -1
  165. package/lib/module/hooks/useViewMessages/types.js +0 -2
  166. package/lib/module/hooks/useViewMessages/types.js.map +0 -1
  167. package/lib/module/hooks/useViewMessagesOld/index.js +0 -2
  168. package/lib/module/hooks/useViewMessagesOld/index.js.map +0 -1
  169. package/lib/module/index.js +0 -2
  170. package/lib/module/index.js.map +0 -1
  171. package/lib/typescript/ChatContext/index.d.ts +0 -2
  172. package/lib/typescript/ChatContext/types.d.ts +0 -4
  173. package/lib/typescript/classes/Chat/index.d.ts +0 -14
  174. package/lib/typescript/classes/Chat/types.d.ts +0 -21
  175. package/lib/typescript/classes/Inbox/types.d.ts +0 -2
  176. package/lib/typescript/classes/Message/index.d.ts +0 -47
  177. package/lib/typescript/classes/Message/types.d.ts +0 -66
  178. package/lib/typescript/classes/Reaction/index.d.ts +0 -17
  179. package/lib/typescript/classes/Reaction/types.d.ts +0 -33
  180. package/lib/typescript/classes/Room/index.d.ts +0 -42
  181. package/lib/typescript/classes/Room/types.d.ts +0 -112
  182. package/lib/typescript/classes/index.d.ts +0 -4
  183. package/lib/typescript/components/Avatar/index.d.ts +0 -4
  184. package/lib/typescript/components/Chat/Bubble/index.d.ts +0 -4
  185. package/lib/typescript/components/Chat/Composer/Input/index.d.ts +0 -7
  186. package/lib/typescript/components/Chat/Composer/Send/index.d.ts +0 -4
  187. package/lib/typescript/components/Chat/Composer/index.d.ts +0 -8
  188. package/lib/typescript/components/Chat/Media/Image/index.d.ts +0 -7
  189. package/lib/typescript/components/Chat/Media/index.d.ts +0 -4
  190. package/lib/typescript/components/Chat/Message/Touchable/index.d.ts +0 -4
  191. package/lib/typescript/components/Chat/Message/index.d.ts +0 -8
  192. package/lib/typescript/components/Chat/SystemMessage/index.d.ts +0 -4
  193. package/lib/typescript/components/Chat/TypingFooter/index.d.ts +0 -4
  194. package/lib/typescript/components/Chat/index.d.ts +0 -8
  195. package/lib/typescript/components/Chat/types.d.ts +0 -843
  196. package/lib/typescript/components/ChatProvider/index.d.ts +0 -10
  197. package/lib/typescript/components/ChatProvider/types.d.ts +0 -7
  198. package/lib/typescript/components/Inbox/Item/Initials/index.d.ts +0 -4
  199. package/lib/typescript/components/Inbox/Item/ItemDate/index.d.ts +0 -4
  200. package/lib/typescript/components/Inbox/Item/Separator/index.d.ts +0 -6
  201. package/lib/typescript/components/Inbox/Item/Subtitle/index.d.ts +0 -3
  202. package/lib/typescript/components/Inbox/Item/Swipeable/index.d.ts +0 -4
  203. package/lib/typescript/components/Inbox/Item/Title/index.d.ts +0 -3
  204. package/lib/typescript/components/Inbox/Item/UnreadIndicator/index.d.ts +0 -4
  205. package/lib/typescript/components/Inbox/Item/index.d.ts +0 -6
  206. package/lib/typescript/components/Inbox/index.d.ts +0 -4
  207. package/lib/typescript/components/Inbox/types.d.ts +0 -304
  208. package/lib/typescript/components/RoomCreator/Content/Footer/Button/index.d.ts +0 -4
  209. package/lib/typescript/components/RoomCreator/Content/Footer/Input/index.d.ts +0 -4
  210. package/lib/typescript/components/RoomCreator/Content/Footer/index.d.ts +0 -3
  211. package/lib/typescript/components/RoomCreator/Content/Item/Icon/index.d.ts +0 -4
  212. package/lib/typescript/components/RoomCreator/Content/Item/index.d.ts +0 -4
  213. package/lib/typescript/components/RoomCreator/Content/index.d.ts +0 -4
  214. package/lib/typescript/components/RoomCreator/Header/index.d.ts +0 -4
  215. package/lib/typescript/components/RoomCreator/index.d.ts +0 -4
  216. package/lib/typescript/components/RoomCreator/types.d.ts +0 -208
  217. package/lib/typescript/components/TypingIndicator/index.d.ts +0 -9
  218. package/lib/typescript/components/index.d.ts +0 -12
  219. package/lib/typescript/helpers/getInitials.d.ts +0 -1
  220. package/lib/typescript/hooks/index.d.ts +0 -8
  221. package/lib/typescript/hooks/useCreator/index.d.ts +0 -27
  222. package/lib/typescript/hooks/useInbox/index.d.ts +0 -29
  223. package/lib/typescript/hooks/useInbox/types.d.ts +0 -5
  224. package/lib/typescript/hooks/useMessages/index.d.ts +0 -24
  225. package/lib/typescript/hooks/useMessages/types.d.ts +0 -5
  226. package/lib/typescript/hooks/useRoom/index.d.ts +0 -26
  227. package/lib/typescript/hooks/useRoom/types.d.ts +0 -5
  228. package/lib/typescript/hooks/useSend/useSendToGroup/index.d.ts +0 -6
  229. package/lib/typescript/hooks/useSend/useSendToPeople/index.d.ts +0 -6
  230. package/lib/typescript/hooks/useTyping/index.d.ts +0 -36
  231. package/lib/typescript/hooks/useViewMessages/index.d.ts +0 -18
  232. package/lib/typescript/hooks/useViewMessages/types.d.ts +0 -20
  233. package/lib/typescript/index.d.ts +0 -11
  234. package/src/ChatContext/index.tsx +0 -9
  235. package/src/ChatContext/types.ts +0 -4
  236. package/src/classes/Chat/index.ts +0 -46
  237. package/src/classes/Chat/types.ts +0 -23
  238. package/src/classes/Inbox/index.ts +0 -12
  239. package/src/classes/Inbox/types.ts +0 -3
  240. package/src/classes/Message/index.ts +0 -310
  241. package/src/classes/Message/types.ts +0 -118
  242. package/src/classes/Reaction/index.ts +0 -108
  243. package/src/classes/Reaction/types.ts +0 -37
  244. package/src/classes/Room/index.ts +0 -323
  245. package/src/classes/Room/types.ts +0 -161
  246. package/src/classes/index.ts +0 -4
  247. package/src/components/Avatar/index.tsx +0 -25
  248. package/src/components/Chat/Bubble/index.tsx +0 -139
  249. package/src/components/Chat/Composer/Input/index.tsx +0 -45
  250. package/src/components/Chat/Composer/Send/index.tsx +0 -51
  251. package/src/components/Chat/Composer/index.tsx +0 -187
  252. package/src/components/Chat/Media/Image/index.tsx +0 -26
  253. package/src/components/Chat/Media/index.tsx +0 -11
  254. package/src/components/Chat/Message/Swiper/Action/index.tsx +0 -7
  255. package/src/components/Chat/Message/Swiper/index.tsx +0 -32
  256. package/src/components/Chat/Message/Touchable/index.tsx +0 -60
  257. package/src/components/Chat/Message/index.tsx +0 -328
  258. package/src/components/Chat/SystemMessage/index.tsx +0 -44
  259. package/src/components/Chat/TypingFooter/index.tsx +0 -48
  260. package/src/components/Chat/index.tsx +0 -596
  261. package/src/components/Chat/types.ts +0 -913
  262. package/src/components/Chat-Old/Bubble/index.tsx +0 -58
  263. package/src/components/Chat-Old/Composer/Input/index.tsx +0 -34
  264. package/src/components/Chat-Old/Composer/Send/index.tsx +0 -37
  265. package/src/components/Chat-Old/Composer/index.tsx +0 -131
  266. package/src/components/Chat-Old/Message/index.tsx +0 -160
  267. package/src/components/Chat-Old/Swiper/Action/index.tsx +0 -7
  268. package/src/components/Chat-Old/Swiper/index.tsx +0 -30
  269. package/src/components/Chat-Old/SystemMessage/index.tsx +0 -44
  270. package/src/components/Chat-Old/index.tsx +0 -356
  271. package/src/components/Chat-Old/types.ts +0 -752
  272. package/src/components/ChatProvider/index.tsx +0 -31
  273. package/src/components/ChatProvider/types.ts +0 -8
  274. package/src/components/Inbox/Item/Circle/index.tsx +0 -47
  275. package/src/components/Inbox/Item/Circle/types.ts +0 -8
  276. package/src/components/Inbox/Item/Initials/index.tsx +0 -41
  277. package/src/components/Inbox/Item/ItemDate/index.tsx +0 -26
  278. package/src/components/Inbox/Item/Separator/index.tsx +0 -13
  279. package/src/components/Inbox/Item/Subtitle/index.tsx +0 -23
  280. package/src/components/Inbox/Item/Swipeable/index.tsx +0 -143
  281. package/src/components/Inbox/Item/Title/index.tsx +0 -23
  282. package/src/components/Inbox/Item/UnreadIndicator/index.tsx +0 -84
  283. package/src/components/Inbox/Item/index.tsx +0 -307
  284. package/src/components/Inbox/index.tsx +0 -315
  285. package/src/components/Inbox/question.md +0 -21
  286. package/src/components/Inbox/readme.md +0 -21
  287. package/src/components/Inbox/types.ts +0 -371
  288. package/src/components/RoomCreator/Content/Footer/Button/index.tsx +0 -55
  289. package/src/components/RoomCreator/Content/Footer/Input/index.tsx +0 -27
  290. package/src/components/RoomCreator/Content/Footer/index.tsx +0 -72
  291. package/src/components/RoomCreator/Content/Item/Icon/index.tsx +0 -16
  292. package/src/components/RoomCreator/Content/Item/index.tsx +0 -87
  293. package/src/components/RoomCreator/Content/index.tsx +0 -75
  294. package/src/components/RoomCreator/Header/index.tsx +0 -74
  295. package/src/components/RoomCreator/index.tsx +0 -177
  296. package/src/components/RoomCreator/types.ts +0 -233
  297. package/src/components/TypingIndicator/index.tsx +0 -169
  298. package/src/components/index.ts +0 -18
  299. package/src/helpers/getInitials.ts +0 -11
  300. package/src/helpers/sortByAvatar.ts +0 -1
  301. package/src/hooks/index.ts +0 -8
  302. package/src/hooks/useCreateRoom/index.ts +0 -34
  303. package/src/hooks/useCreator/index.ts +0 -33
  304. package/src/hooks/useInbox/index.ts +0 -76
  305. package/src/hooks/useInbox/types.ts +0 -6
  306. package/src/hooks/useMessages/index.ts +0 -109
  307. package/src/hooks/useMessages/types.ts +0 -6
  308. package/src/hooks/useRoom/index.ts +0 -82
  309. package/src/hooks/useRoom/types.ts +0 -6
  310. package/src/hooks/useSend/useSendToGroup/index.ts +0 -38
  311. package/src/hooks/useSend/useSendToPeople/index.ts +0 -38
  312. package/src/hooks/useTyping/index.ts +0 -154
  313. package/src/hooks/useTypingOLD/index.ts +0 -67
  314. package/src/hooks/useTypingOLD/types.ts +0 -7
  315. package/src/hooks/useViewMessages/index.ts +0 -61
  316. package/src/hooks/useViewMessages/types.ts +0 -22
  317. package/src/hooks/useViewMessagesOld/index.ts +0 -39
  318. package/src/index.ts +0 -13
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","useCallback","Swipeable","Action","props","renderSwipeAction","renderAction","actionProps","swipeActions","leftActions","left","rightActions","right","renderRightActions","forEach","action","renderActionList"],"mappings":"kKAAA,MAAOA,CAAAA,KAAP,EAAgBC,WAAhB,KAAmC,OAAnC,CACA,MAAOC,CAAAA,SAAP,KAAsB,wCAAtB,CAEA,MAAOC,CAAAA,MAAP,KAAmB,UAAnB,CAEA,eAAe,SAACC,KAAD,CAA2B,IACjCC,CAAAA,iBADiC,CACXD,KADW,CACjCC,iBADiC,CAEzC,GAAMC,CAAAA,YAAY,CAAGL,WAAW,CAC/B,SAACM,WAAD,CAAmC,CAClC,GAAIF,iBAAJ,CAAuB,MAAOA,CAAAA,iBAAiB,CAACE,WAAD,CAAxB,CAEvB,MAAO,qBAAC,MAAD,aAAYA,WAAZ,mDAAP,CACA,CAL8B,CAM/B,CAACF,iBAAD,CAN+B,CAAhC,CAFyC,GAWjCG,CAAAA,YAXiC,CAWhBJ,KAXgB,CAWjCI,YAXiC,CAYzC,GAAMC,CAAAA,WAAW,CAAGD,YAAY,EAAIA,YAAY,CAACE,IAAjD,CACA,GAAMC,CAAAA,YAAY,CAAGH,YAAY,EAAIA,YAAY,CAACI,KAAlD,CAEA,GAAMC,CAAAA,kBAAkB,CAAGZ,WAAW,CAAC,UAAM,CAC5C,GAAIU,YAAJ,CAAkB,CACjBA,YAAY,CAACG,OAAb,CAAqB,SAAAC,MAAM,CAAI,CAAE,CAAjC,EACA,CACD,CAJqC,CAInC,CAACJ,YAAD,CAJmC,CAAtC,CAMA,GAAMK,CAAAA,gBAAgB,CAAGf,WAAW,CAAC,UAAM,CAAE,CAAT,CAAW,EAAX,CAApC,CAEA,MAAO,qBAAC,SAAD,kDAAP,CACA,CAxBD","sourcesContent":["import React, { useCallback } from 'react'\nimport Swipeable from 'react-native-gesture-handler/Swipeable'\nimport { SwipeableProps, SwipeActionProps } from '../types'\nimport Action from './Action'\n\nexport default (props: SwipeableProps) => {\n\tconst { renderSwipeAction } = props\n\tconst renderAction = useCallback(\n\t\t(actionProps: SwipeActionProps) => {\n\t\t\tif (renderSwipeAction) return renderSwipeAction(actionProps)\n\n\t\t\treturn <Action {...actionProps} />\n\t\t},\n\t\t[renderSwipeAction]\n\t)\n\n\tconst { swipeActions } = props\n\tconst leftActions = swipeActions && swipeActions.left\n\tconst rightActions = swipeActions && swipeActions.right\n\n\tconst renderRightActions = useCallback(() => {\n\t\tif (rightActions) {\n\t\t\trightActions.forEach(action => {})\n\t\t}\n\t}, [rightActions])\n\n\tconst renderActionList = useCallback(() => {}, [])\n\n\treturn <Swipeable></Swipeable>\n}\n"]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Chat-Old/SystemMessage/index.tsx";import React from'react';import{View,Text,StyleSheet}from'react-native';import moment from'moment';var SystemMessage=React.memo(function(props){return React.createElement(View,{style:[styles.container,props.containerStyle],__source:{fileName:_jsxFileName,lineNumber:8}},React.createElement(Text,{style:styles.date,__source:{fileName:_jsxFileName,lineNumber:9}},props.dateToStringFunc?props.dateToStringFunc(props.createdAt):moment(props.createdAt).calendar(undefined,{lastDay:'[Yesterday]',sameDay:'LT',nextDay:'[Tomorrow at] LT',lastWeek:'dddd',nextWeek:'[Next] dddd',sameElse:'L'})),React.createElement(Text,{style:styles.text,__source:{fileName:_jsxFileName,lineNumber:21}},props.text));});export default SystemMessage;var styles=StyleSheet.create({container:{paddingHorizontal:10,paddingVertical:5},date:{color:'gray',textAlign:'center',fontSize:14},text:{color:'gray',fontWeight:'500',textAlign:'center',fontSize:14}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","View","Text","StyleSheet","moment","SystemMessage","memo","props","styles","container","containerStyle","date","dateToStringFunc","createdAt","calendar","undefined","lastDay","sameDay","nextDay","lastWeek","nextWeek","sameElse","text","create","paddingHorizontal","paddingVertical","color","textAlign","fontSize","fontWeight"],"mappings":"oHAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,IAAT,CAAeC,IAAf,CAAqBC,UAArB,KAAuC,cAAvC,CACA,MAAOC,CAAAA,MAAP,KAAmB,QAAnB,CAGA,GAAMC,CAAAA,aAAa,CAAGL,KAAK,CAACM,IAAN,CAAW,SAACC,KAAD,CAA+B,CAC/D,MACC,qBAAC,IAAD,EAAM,KAAK,CAAE,CAACC,MAAM,CAACC,SAAR,CAAmBF,KAAK,CAACG,cAAzB,CAAb,gDACC,oBAAC,IAAD,EAAM,KAAK,CAAEF,MAAM,CAACG,IAApB,gDACEJ,KAAK,CAACK,gBAAN,CACEL,KAAK,CAACK,gBAAN,CAAuBL,KAAK,CAACM,SAA7B,CADF,CAEET,MAAM,CAACG,KAAK,CAACM,SAAP,CAAN,CAAwBC,QAAxB,CAAiCC,SAAjC,CAA4C,CAC5CC,OAAO,CAAE,aADmC,CAE5CC,OAAO,CAAE,IAFmC,CAG5CC,OAAO,CAAE,kBAHmC,CAI5CC,QAAQ,CAAE,MAJkC,CAK5CC,QAAQ,CAAE,aALkC,CAM5CC,QAAQ,CAAE,GANkC,CAA5C,CAHJ,CADD,CAaC,oBAAC,IAAD,EAAM,KAAK,CAAEb,MAAM,CAACc,IAApB,iDAA2Bf,KAAK,CAACe,IAAjC,CAbD,CADD,CAiBA,CAlBqB,CAAtB,CAoBA,cAAejB,CAAAA,aAAf,CAEA,GAAMG,CAAAA,MAAM,CAAGL,UAAU,CAACoB,MAAX,CAAkB,CAChCd,SAAS,CAAE,CACVe,iBAAiB,CAAE,EADT,CAEVC,eAAe,CAAE,CAFP,CADqB,CAKhCd,IAAI,CAAE,CACLe,KAAK,CAAE,MADF,CAELC,SAAS,CAAE,QAFN,CAGLC,QAAQ,CAAE,EAHL,CAL0B,CAUhCN,IAAI,CAAE,CACLI,KAAK,CAAE,MADF,CAELG,UAAU,CAAE,KAFP,CAGLF,SAAS,CAAE,QAHN,CAILC,QAAQ,CAAE,EAJL,CAV0B,CAAlB,CAAf","sourcesContent":["import React from 'react'\nimport { View, Text, StyleSheet } from 'react-native'\nimport moment from 'moment'\nimport { SystemMessageProps } from '../types'\n\nconst SystemMessage = React.memo((props: SystemMessageProps) => {\n\treturn (\n\t\t<View style={[styles.container, props.containerStyle]}>\n\t\t\t<Text style={styles.date}>\n\t\t\t\t{props.dateToStringFunc\n\t\t\t\t\t? props.dateToStringFunc(props.createdAt)\n\t\t\t\t\t: moment(props.createdAt).calendar(undefined, {\n\t\t\t\t\t\t\tlastDay: '[Yesterday]',\n\t\t\t\t\t\t\tsameDay: 'LT',\n\t\t\t\t\t\t\tnextDay: '[Tomorrow at] LT',\n\t\t\t\t\t\t\tlastWeek: 'dddd',\n\t\t\t\t\t\t\tnextWeek: '[Next] dddd',\n\t\t\t\t\t\t\tsameElse: 'L'\n\t\t\t\t\t })}\n\t\t\t</Text>\n\t\t\t<Text style={styles.text}>{props.text}</Text>\n\t\t</View>\n\t)\n})\n\nexport default SystemMessage\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tpaddingHorizontal: 10,\n\t\tpaddingVertical: 5\n\t},\n\tdate: {\n\t\tcolor: 'gray',\n\t\ttextAlign: 'center',\n\t\tfontSize: 14\n\t},\n\ttext: {\n\t\tcolor: 'gray',\n\t\tfontWeight: '500',\n\t\ttextAlign: 'center',\n\t\tfontSize: 14\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Chat-Old/index.tsx";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){_defineProperty(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}import React,{useMemo,useRef,useEffect,useCallback}from'react';import{SafeAreaView,View,StyleSheet,Animated}from'react-native';import{Transitioning,Transition}from'react-native-reanimated';import Message from'./Message';import Composer from'./Composer';import SystemMessage from'./SystemMessage';function Chat(props,ref){var inputRef=useRef();var flatListRef=useRef();var componentRef=useRef();if(!componentRef.current){componentRef.current={focusInput:function focusInput(){return inputRef.current&&inputRef.current.focus();},blurInput:function blurInput(){return inputRef.current&&inputRef.current.blur();},scrollToEnd:function scrollToEnd(){return flatListRef.current&&flatListRef.current.scrollToEnd();},scrollToIndex:function scrollToIndex(params){return flatListRef.current&&flatListRef.current.scrollToIndex(params);},scrollToItem:function scrollToItem(params){return flatListRef.current&&flatListRef.current.scrollToItem(params);},scrollToOffset:function scrollToOffset(params){return flatListRef.current&&flatListRef.current.scrollToOffset(params);}};if(ref)ref.current=componentRef.current;}var transitionRef=useRef(null);var mounted=useRef(false);var scrollY=useMemo(function(){return props.animatedScrollNode||new Animated.Value(0);},[props.animatedScrollNode]);var onScroll=Animated.event([{nativeEvent:{contentOffset:{y:scrollY}}}],{useNativeDriver:true});useEffect(function(){if(flatListRef.current){var iSentLastMessage=props.messages[0]&&props.messages[0].user&&props.messages[0].user.id===props.user.id;if(iSentLastMessage&&!props.disableScrollToBottomOnSend)flatListRef.current.scrollToOffset({offset:0});else if(props.scrollToBottomOnAllNewMessages)flatListRef.current.scrollToOffset({offset:0});}},[props.disableScrollToBottomOnSend,props.scrollToBottomOnAllNewMessages,props.messages,props.user.id]);var onViewableItemsChangedRef=useRef(props.onViewableItemsChanged);var onViewMessagesRef=useRef(props.onViewMessages);var messagesRef=useRef(props.messages);useEffect(function(){onViewableItemsChangedRef.current=props.onViewableItemsChanged;onViewMessagesRef.current=props.onViewMessages;messagesRef.current=props.messages;},[props.onViewableItemsChanged,props.onViewMessages,props.messages]);var onViewableItemsChanged=useCallback(function(info){if(onViewableItemsChangedRef.current)onViewableItemsChangedRef.current(info);if(onViewMessagesRef.current){var visibleMessages=info.viewableItems.filter(function(i){return i.isViewable;}).map(function(i){return i.item;});var latestMessageId=messagesRef.current&&messagesRef.current[0]&&messagesRef.current[0].id;onViewMessagesRef.current({visibleMessages:visibleMessages,latestMessageId:latestMessageId});}},[]);useEffect(function(){if(!props.disableTransitions&&(mounted.current||!props.disableTransitionOnMount)&&transitionRef.current)transitionRef.current.animateNextTransition();else mounted.current=true;},[props.disableTransitionOnMount,props.namesOfUsersTyping,props.messages,props.disableTransitions]);var renderItem=function renderItem(info){if(props.renderItem)return props.renderItem(info);if(props.renderMessage===null)return null;var message=info.item,index=info.index;if(message.system){var systemProps={text:message.text,createdAt:message.createdAt,textStyle:props.systemMessageTextStyle,containerStyle:props.systemMessageContainerStyle,dateToStringFunc:props.systemMessageDateToStringFunc,dateStyle:props.systemMessageDateStyle};if(props.renderSystemMessage===null)return null;if(props.renderSystemMessage)return props.renderSystemMessage(systemProps);return React.createElement(SystemMessage,_extends({},systemProps,{__source:{fileName:_jsxFileName,lineNumber:174}}));}var isMe=message.user.id===props.user.id;var messageCreatesNewBunch=!(props.messages[index+1]&&props.messages[index+1].user&&props.messages[index+1].user.id===(props.user&&props.user.id));var showName=!isMe&&messageCreatesNewBunch;var showAvatar=props.showAvatarForEveryMessage||messageCreatesNewBunch;if(isMe&&props.hideMyAvatar)showAvatar=false;var bubbleStyle=props.bubbleStyle&&props.bubbleStyle[isMe?'me':'others'];var messageContainerStyle=props.messageContainerStyle&&props.messageContainerStyle[isMe?'me':'others'];var bubbleTextStyle=props.bubbleTextStyle&&props.bubbleTextStyle[isMe?'me':'others'];var messageWrapperStyle=props.messageWrapperStyle&&props.messageWrapperStyle[isMe?'me':'others'];var messageProps={messageContainerStyle:messageContainerStyle,bubbleStyle:bubbleStyle,bubbleTextStyle:bubbleTextStyle,messageWrapperStyle:messageWrapperStyle,delivered:true,isMe:message.user.id===props.user.id,renderFooter:props.renderMessageFooter,imageProps:props.imageProps,media:message.media,name:message.user.name,system:message.system,text:message.text,read:true,renderMedia:props.renderMessageMedia,onLongPress:props.onLongPressMessage,onPress:props.onPressMessage,pressType:props.messagePressType||'double',doubleTapDelay:props.messageDoubleTapDelay,disableSwipeActions:props.disableSwipeActions,swipeActions:props.swipeActions,longPressDelay:props.messageLongPressDelay,id:message.id,showName:showName,avatar:message.user.avatar,avatarImageProps:props.avatarImageProps,avatarSize:props.avatarSize,renderAvatar:props.renderAvatar,showAvatar:showAvatar,initialsBackgroundColor:props.initialsBackgroundColor,initialsTextColor:props.initialsTextColor,renderInitials:props.renderInitials};if(props.renderMessage)return props.renderMessage(messageProps);return React.createElement(Message,_extends({},messageProps,{__source:{fileName:_jsxFileName,lineNumber:240}}));};var keyExtractor=useMemo(function(){return props.keyExtractor||function(_ref){var id=_ref.id;return id;};},[props.keyExtractor]);var renderList=function renderList(){return React.createElement(Animated.FlatList,_extends({},props.flatListProps,{ref:flatListRef,data:props.messages,keyExtractor:keyExtractor,renderItem:renderItem,extraData:props.extraData,ListHeaderComponent:props.ListFooterComponent,inverted:true,onScroll:onScroll,onViewableItemsChanged:onViewableItemsChanged,keyboardShouldPeristTaps:props.keyboardShouldPersistTaps||'handled',keyboardDismissMode:props.keyboardDismissMode||'interactive',contentContainerStyle:_objectSpread({},styles.contentContainer,{},props.contentContainerStyle||{}),__source:{fileName:_jsxFileName,lineNumber:250}}));};var renderHeader=function renderHeader(){if(props.renderHeader)return props.renderHeader();return null;};var renderFooter=function renderFooter(){if(props.renderFooter)return props.renderFooter();return null;};var renderComposer=function renderComposer(){if(props.renderComposer===null)return null;var composerProps={onInputTextChanged:props.onInputTextChanged,text:props.text,initialText:props.initialText,placeholderColor:props.placeholderColor,placeholderText:props.placeholderText,renderSendButton:props.renderSendButton,renderTextInput:props.renderTextInput,textInputProps:props.textInputProps,media:props.media,onChangeMedia:props.onChangeMedia,user:props.user,onSend:props.onSend,sendButtonMode:props.sendButtonMode,containerStyle:props.composerContainerStyle,inputContainerStyle:props.inputContainerStyle,inputStyle:props.inputStyle,tintColor:props.tintColor,inputRef:inputRef};if(props.renderComposer)return props.renderComposer(composerProps);return React.createElement(Composer,_extends({},composerProps,{__source:{fileName:_jsxFileName,lineNumber:303}}));};var Container=props.ContainerComponent||(props.safeArea?SafeAreaView:View);var transition=useMemo(function(){return props.transitionConfig||React.createElement(Transition.Sequence,{__source:{fileName:_jsxFileName,lineNumber:314}},React.createElement(Transition.Together,{__source:{fileName:_jsxFileName,lineNumber:315}},React.createElement(Transition.Out,{type:"fade",__source:{fileName:_jsxFileName,lineNumber:316}}),React.createElement(Transition.Change,{interpolation:"easeOut",__source:{fileName:_jsxFileName,lineNumber:317}})),React.createElement(Transition.In,{type:"fade",__source:{fileName:_jsxFileName,lineNumber:319}}));},[props.transitionConfig]);var containerStyle=useMemo(function(){return _objectSpread({},styles.container,{},props.containerStyle);},[props.containerStyle]);return React.createElement(Transitioning.View,{ref:transitionRef,transition:transition,style:containerStyle,__source:{fileName:_jsxFileName,lineNumber:332}},React.createElement(Container,{style:containerStyle,__source:{fileName:_jsxFileName,lineNumber:337}},renderHeader(),renderList(),renderFooter(),renderComposer()));}export default Chat;var styles=StyleSheet.create({container:{flex:1},contentContainer:{flexGrow:1}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","useMemo","useRef","useEffect","useCallback","SafeAreaView","View","StyleSheet","Animated","Transitioning","Transition","Message","Composer","SystemMessage","Chat","props","ref","inputRef","flatListRef","componentRef","current","focusInput","focus","blurInput","blur","scrollToEnd","scrollToIndex","params","scrollToItem","scrollToOffset","transitionRef","mounted","scrollY","animatedScrollNode","Value","onScroll","event","nativeEvent","contentOffset","y","useNativeDriver","iSentLastMessage","messages","user","id","disableScrollToBottomOnSend","offset","scrollToBottomOnAllNewMessages","onViewableItemsChangedRef","onViewableItemsChanged","onViewMessagesRef","onViewMessages","messagesRef","info","visibleMessages","viewableItems","filter","i","isViewable","map","item","latestMessageId","disableTransitions","disableTransitionOnMount","animateNextTransition","namesOfUsersTyping","renderItem","renderMessage","message","index","system","systemProps","text","createdAt","textStyle","systemMessageTextStyle","containerStyle","systemMessageContainerStyle","dateToStringFunc","systemMessageDateToStringFunc","dateStyle","systemMessageDateStyle","renderSystemMessage","isMe","messageCreatesNewBunch","showName","showAvatar","showAvatarForEveryMessage","hideMyAvatar","bubbleStyle","messageContainerStyle","bubbleTextStyle","messageWrapperStyle","messageProps","delivered","renderFooter","renderMessageFooter","imageProps","media","name","read","renderMedia","renderMessageMedia","onLongPress","onLongPressMessage","onPress","onPressMessage","pressType","messagePressType","doubleTapDelay","messageDoubleTapDelay","disableSwipeActions","swipeActions","longPressDelay","messageLongPressDelay","avatar","avatarImageProps","avatarSize","renderAvatar","initialsBackgroundColor","initialsTextColor","renderInitials","keyExtractor","renderList","flatListProps","extraData","ListFooterComponent","keyboardShouldPersistTaps","keyboardDismissMode","styles","contentContainer","contentContainerStyle","renderHeader","renderComposer","composerProps","onInputTextChanged","initialText","placeholderColor","placeholderText","renderSendButton","renderTextInput","textInputProps","onChangeMedia","onSend","sendButtonMode","composerContainerStyle","inputContainerStyle","inputStyle","tintColor","Container","ContainerComponent","safeArea","transition","transitionConfig","container","create","flex","flexGrow"],"mappings":"0/BAAA,MAAOA,CAAAA,KAAP,EACCC,OADD,CAECC,MAFD,CAGCC,SAHD,CAICC,WAJD,KAMO,OANP,CAOA,OAGCC,YAHD,CAICC,IAJD,CAKCC,UALD,CAMCC,QAND,KASO,cATP,CAUA,OACCC,aADD,CAECC,UAFD,KAIO,yBAJP,CAKA,MAAOC,CAAAA,OAAP,KAAoB,WAApB,CASA,MAAOC,CAAAA,QAAP,KAAqB,YAArB,CACA,MAAOC,CAAAA,aAAP,KAA0B,iBAA1B,CAEA,QAASC,CAAAA,IAAT,CACCC,KADD,CAECC,GAFD,CAGE,CAGD,GAAMC,CAAAA,QAAQ,CAAGf,MAAM,EAAvB,CACA,GAAMgB,CAAAA,WAAW,CAAGhB,MAAM,EAA1B,CACA,GAAMiB,CAAAA,YAAY,CAAGjB,MAAM,EAA3B,CAEA,GAAI,CAACiB,YAAY,CAACC,OAAlB,CAA2B,CAC1BD,YAAY,CAACC,OAAb,CAAuB,CACtBC,UAAU,CAAE,4BAAMJ,CAAAA,QAAQ,CAACG,OAAT,EAAoBH,QAAQ,CAACG,OAAT,CAAiBE,KAAjB,EAA1B,EADU,CA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,oBAAC,UAAD,CAAY,GAAZ,EAAgB,IAAI,CAAC,MAArB,kDADD,CAEC,oBAAC,UAAD,CAAY,MAAZ,EAAmB,aAAa,CAAC,SAAjC,kDAFD,CADD,CAKC,oBAAC,UAAD,CAAY,EAAZ,EAAe,IAAI,CAAC,MAApB,kDALD,CAFF,EADyB,CAWzB,CAAC1I,KAAK,CAAC0I,gBAAP,CAXyB,CAA1B,CAaA,GAAM7E,CAAAA,cAAc,CAAG3E,OAAO,CAC7B,mCACIgI,MAAM,CAACyB,SADX,IAEI3I,KAAK,CAAC6D,cAFV,GAD6B,CAK7B,CAAC7D,KAAK,CAAC6D,cAAP,CAL6B,CAA9B,CAOA,MACC,qBAAC,aAAD,CAAe,IAAf,EACC,GAAG,CAAE9C,aADN,CAEC,UAAU,CAAE0H,UAFb,CAGC,KAAK,CAAE5E,cAHR,kDAKC,oBAAC,SAAD,EAAW,KAAK,CAAEA,cAAlB,kDACEwD,YAAY,EADd,CAEET,UAAU,EAFZ,CAGE5B,YAAY,EAHd,CAIEsC,cAAc,EAJhB,CALD,CADD,CAcA,CAED,cAAevH,CAAAA,IAAf,CAEA,GAAMmH,CAAAA,MAAM,CAAG1H,UAAU,CAACoJ,MAAX,CAAkB,CAChCD,SAAS,CAAE,CACVE,IAAI,CAAE,CADI,CADqB,CAIhC1B,gBAAgB,CAAE,CACjB2B,QAAQ,CAAE,CADO,CAJc,CAAlB,CAAf","sourcesContent":["import React, {\n\tuseMemo,\n\tuseRef,\n\tuseEffect,\n\tuseCallback,\n\tMutableRefObject\n} from 'react'\nimport {\n\tFlatList,\n\tListRenderItemInfo,\n\tSafeAreaView,\n\tView,\n\tStyleSheet,\n\tAnimated,\n\tViewToken,\n\tTextInput\n} from 'react-native'\nimport {\n\tTransitioning,\n\tTransition,\n\tTransitioningView\n} from 'react-native-reanimated'\nimport Message from './Message'\nimport {\n\tChatProps,\n\tMessageProps,\n\tComposerProps,\n\tSystemMessageProps,\n\tChatRef\n} from './types'\nimport { NewMessageModel } from '../../classes/Message/types'\nimport Composer from './Composer'\nimport SystemMessage from './SystemMessage'\n\nfunction Chat<MessageModel extends NewMessageModel = NewMessageModel>(\n\tprops: ChatProps<MessageModel>,\n\tref: MutableRefObject<ChatRef<MessageModel>>\n) {\n\t// \"constructor\" variables\n\n\tconst inputRef = useRef<TextInput>()\n\tconst flatListRef = useRef<FlatList<MessageModel>>()\n\tconst componentRef = useRef<ChatRef<MessageModel>>()\n\n\tif (!componentRef.current) {\n\t\tcomponentRef.current = {\n\t\t\tfocusInput: () => inputRef.current && inputRef.current.focus(),\n\t\t\tblurInput: () => inputRef.current && inputRef.current.blur(),\n\t\t\tscrollToEnd: () =>\n\t\t\t\tflatListRef.current && flatListRef.current.scrollToEnd(),\n\t\t\tscrollToIndex: params =>\n\t\t\t\tflatListRef.current && flatListRef.current.scrollToIndex(params),\n\t\t\tscrollToItem: params =>\n\t\t\t\tflatListRef.current && flatListRef.current.scrollToItem(params),\n\t\t\tscrollToOffset: params =>\n\t\t\t\tflatListRef.current && flatListRef.current.scrollToOffset(params)\n\t\t}\n\t\tif (ref) ref.current = componentRef.current\n\t}\n\n\t// used to shuffle/transition the inbox when it changes\n\tconst transitionRef = useRef<TransitioningView>(null)\n\tconst mounted = useRef(false)\n\n\t// track animated position of scroll\n\tconst scrollY: Animated.Value = useMemo(\n\t\t() => props.animatedScrollNode || new Animated.Value(0),\n\t\t[props.animatedScrollNode]\n\t)\n\n\t// upate position of scroll variable\n\tconst onScroll = Animated.event(\n\t\t[{ nativeEvent: { contentOffset: { y: scrollY } } }],\n\t\t{ useNativeDriver: true }\n\t)\n\n\t// effect to handle new messages coming in / scrolling to bottom\n\t// TODO we may have to use getNode() for the animated flatlist, right?\n\tuseEffect(() => {\n\t\tif (flatListRef.current) {\n\t\t\tconst iSentLastMessage =\n\t\t\t\tprops.messages[0] &&\n\t\t\t\tprops.messages[0].user &&\n\t\t\t\tprops.messages[0].user.id === props.user.id\n\t\t\tif (iSentLastMessage && !props.disableScrollToBottomOnSend)\n\t\t\t\tflatListRef.current.scrollToOffset({ offset: 0 })\n\t\t\telse if (props.scrollToBottomOnAllNewMessages)\n\t\t\t\tflatListRef.current.scrollToOffset({ offset: 0 })\n\t\t}\n\t}, [\n\t\tprops.disableScrollToBottomOnSend,\n\t\tprops.scrollToBottomOnAllNewMessages,\n\t\tprops.messages,\n\t\tprops.user.id\n\t])\n\n\t// 💩 a super way of handling viewable items not on the fly. (easy way to track viewed messages)\n\t// TODO abstract this to a different custom hook.\n\tconst onViewableItemsChangedRef = useRef(props.onViewableItemsChanged)\n\tconst onViewMessagesRef = useRef(props.onViewMessages)\n\tconst messagesRef = useRef(props.messages)\n\t// ...onto the effect 😅\n\tuseEffect(() => {\n\t\t// make updated methods available to onviewable items changed\n\t\tonViewableItemsChangedRef.current = props.onViewableItemsChanged\n\t\tonViewMessagesRef.current = props.onViewMessages\n\t\tmessagesRef.current = props.messages\n\t}, [props.onViewableItemsChanged, props.onViewMessages, props.messages])\n\n\tconst onViewableItemsChanged: FlatList<\n\t\tMessageModel\n\t>['props']['onViewableItemsChanged'] = useCallback(\n\t\t(info: { viewableItems: ViewToken[]; changed: ViewToken[] }) => {\n\t\t\tif (onViewableItemsChangedRef.current)\n\t\t\t\tonViewableItemsChangedRef.current(info)\n\n\t\t\tif (onViewMessagesRef.current) {\n\t\t\t\tconst visibleMessages = info.viewableItems\n\t\t\t\t\t.filter(i => i.isViewable)\n\t\t\t\t\t.map(i => i.item)\n\t\t\t\tconst latestMessageId =\n\t\t\t\t\tmessagesRef.current &&\n\t\t\t\t\tmessagesRef.current[0] &&\n\t\t\t\t\tmessagesRef.current[0].id\n\t\t\t\tonViewMessagesRef.current({\n\t\t\t\t\tvisibleMessages,\n\t\t\t\t\tlatestMessageId\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\t[]\n\t)\n\t// END OF THAT 💩\n\n\t// effect to handle animating the screen if the messages changed or people typing just changed\n\tuseEffect(() => {\n\t\tif (\n\t\t\t!props.disableTransitions &&\n\t\t\t// if we've already mounted, or we want to transition even if we haven't...\n\t\t\t(mounted.current || !props.disableTransitionOnMount) &&\n\t\t\t// and assuming the transition component is initialized...\n\t\t\ttransitionRef.current\n\t\t)\n\t\t\t// animate\n\t\t\ttransitionRef.current.animateNextTransition()\n\t\telse mounted.current = true\n\t}, [\n\t\tprops.disableTransitionOnMount,\n\t\tprops.namesOfUsersTyping,\n\t\tprops.messages,\n\t\tprops.disableTransitions\n\t])\n\n\tconst renderItem = (info: ListRenderItemInfo<MessageModel>) => {\n\t\tif (props.renderItem) return props.renderItem(info)\n\t\tif (props.renderMessage === null) return null\n\n\t\tconst { item: message, index } = info\n\n\t\tif (message.system) {\n\t\t\tconst systemProps: SystemMessageProps = {\n\t\t\t\ttext: message.text,\n\t\t\t\tcreatedAt: message.createdAt,\n\t\t\t\ttextStyle: props.systemMessageTextStyle,\n\t\t\t\tcontainerStyle: props.systemMessageContainerStyle,\n\t\t\t\tdateToStringFunc: props.systemMessageDateToStringFunc,\n\t\t\t\tdateStyle: props.systemMessageDateStyle\n\t\t\t}\n\n\t\t\tif (props.renderSystemMessage === null) return null\n\t\t\tif (props.renderSystemMessage)\n\t\t\t\treturn props.renderSystemMessage(systemProps)\n\n\t\t\treturn <SystemMessage {...systemProps} />\n\t\t}\n\n\t\tconst isMe = message.user.id === props.user.id\n\n\t\t// indicates that the previous message was sent by someone else, so this starts a new bunch\n\t\tconst messageCreatesNewBunch = !(\n\t\t\tprops.messages[index + 1] &&\n\t\t\tprops.messages[index + 1].user &&\n\t\t\tprops.messages[index + 1].user.id === (props.user && props.user.id)\n\t\t)\n\n\t\t// show name if the previous message was sent by someone else\n\t\tconst showName = !isMe && messageCreatesNewBunch\n\n\t\t// by default, only show avatar for a the bottom of a bunch\n\t\tlet showAvatar = props.showAvatarForEveryMessage || messageCreatesNewBunch\n\t\t// and we hide the avatar if we say to\n\t\tif (isMe && props.hideMyAvatar) showAvatar = false\n\n\t\tconst bubbleStyle =\n\t\t\tprops.bubbleStyle && props.bubbleStyle[isMe ? 'me' : 'others']\n\t\tconst messageContainerStyle =\n\t\t\tprops.messageContainerStyle &&\n\t\t\tprops.messageContainerStyle[isMe ? 'me' : 'others']\n\t\tconst bubbleTextStyle =\n\t\t\tprops.bubbleTextStyle && props.bubbleTextStyle[isMe ? 'me' : 'others']\n\t\tconst messageWrapperStyle =\n\t\t\tprops.messageWrapperStyle &&\n\t\t\tprops.messageWrapperStyle[isMe ? 'me' : 'others']\n\n\t\tconst messageProps: MessageProps = {\n\t\t\tmessageContainerStyle,\n\t\t\tbubbleStyle,\n\t\t\tbubbleTextStyle,\n\t\t\tmessageWrapperStyle,\n\t\t\tdelivered: true,\n\t\t\tisMe: message.user.id === props.user.id,\n\t\t\trenderFooter: props.renderMessageFooter,\n\t\t\timageProps: props.imageProps,\n\t\t\tmedia: message.media,\n\t\t\tname: message.user.name,\n\t\t\tsystem: message.system,\n\t\t\ttext: message.text,\n\t\t\tread: true,\n\t\t\trenderMedia: props.renderMessageMedia,\n\t\t\tonLongPress: props.onLongPressMessage,\n\t\t\tonPress: props.onPressMessage,\n\t\t\tpressType: props.messagePressType || 'double',\n\t\t\tdoubleTapDelay: props.messageDoubleTapDelay,\n\t\t\tdisableSwipeActions: props.disableSwipeActions,\n\t\t\tswipeActions: props.swipeActions,\n\t\t\tlongPressDelay: props.messageLongPressDelay,\n\t\t\tid: message.id,\n\t\t\tshowName,\n\t\t\tavatar: message.user.avatar,\n\t\t\tavatarImageProps: props.avatarImageProps,\n\t\t\tavatarSize: props.avatarSize,\n\t\t\trenderAvatar: props.renderAvatar,\n\t\t\tshowAvatar,\n\t\t\tinitialsBackgroundColor: props.initialsBackgroundColor,\n\t\t\tinitialsTextColor: props.initialsTextColor,\n\t\t\trenderInitials: props.renderInitials\n\t\t}\n\n\t\tif (props.renderMessage) return props.renderMessage(messageProps)\n\t\treturn <Message {...messageProps} />\n\t}\n\n\tconst keyExtractor = useMemo(\n\t\t() => props.keyExtractor || (({ id }: MessageModel) => id),\n\t\t[props.keyExtractor]\n\t)\n\n\tconst renderList = () => {\n\t\treturn (\n\t\t\t<Animated.FlatList\n\t\t\t\t{...props.flatListProps}\n\t\t\t\tref={flatListRef as MutableRefObject<FlatList<MessageModel>>}\n\t\t\t\tdata={props.messages}\n\t\t\t\tkeyExtractor={keyExtractor}\n\t\t\t\trenderItem={renderItem}\n\t\t\t\textraData={props.extraData}\n\t\t\t\tListHeaderComponent={props.ListFooterComponent}\n\t\t\t\tinverted\n\t\t\t\tonScroll={onScroll}\n\t\t\t\tonViewableItemsChanged={onViewableItemsChanged}\n\t\t\t\tkeyboardShouldPeristTaps={props.keyboardShouldPersistTaps || 'handled'}\n\t\t\t\tkeyboardDismissMode={props.keyboardDismissMode || 'interactive'}\n\t\t\t\tcontentContainerStyle={{\n\t\t\t\t\t...styles.contentContainer,\n\t\t\t\t\t...(props.contentContainerStyle || {})\n\t\t\t\t}}\n\t\t\t/>\n\t\t)\n\t}\n\tconst renderHeader = () => {\n\t\tif (props.renderHeader) return props.renderHeader()\n\t\treturn null\n\t}\n\tconst renderFooter = () => {\n\t\tif (props.renderFooter) return props.renderFooter()\n\t\treturn null\n\t}\n\tconst renderComposer = () => {\n\t\tif (props.renderComposer === null) return null\n\n\t\tconst composerProps: ComposerProps = {\n\t\t\tonInputTextChanged: props.onInputTextChanged,\n\t\t\ttext: props.text,\n\t\t\tinitialText: props.initialText,\n\t\t\tplaceholderColor: props.placeholderColor,\n\t\t\tplaceholderText: props.placeholderText,\n\t\t\trenderSendButton: props.renderSendButton,\n\t\t\trenderTextInput: props.renderTextInput,\n\t\t\ttextInputProps: props.textInputProps,\n\t\t\tmedia: props.media,\n\t\t\tonChangeMedia: props.onChangeMedia,\n\t\t\tuser: props.user,\n\t\t\tonSend: props.onSend,\n\t\t\tsendButtonMode: props.sendButtonMode,\n\t\t\tcontainerStyle: props.composerContainerStyle,\n\t\t\tinputContainerStyle: props.inputContainerStyle,\n\t\t\tinputStyle: props.inputStyle,\n\t\t\ttintColor: props.tintColor,\n\t\t\tinputRef: inputRef as MutableRefObject<TextInput>\n\t\t}\n\t\tif (props.renderComposer) return props.renderComposer(composerProps)\n\n\t\treturn <Composer {...composerProps} />\n\t}\n\n\t// now, onto the actual render code\n\tconst Container =\n\t\tprops.ContainerComponent || (props.safeArea ? SafeAreaView : View)\n\n\t// reanimated transition\n\tconst transition = useMemo(\n\t\t() =>\n\t\t\tprops.transitionConfig || (\n\t\t\t\t<Transition.Sequence>\n\t\t\t\t\t<Transition.Together>\n\t\t\t\t\t\t<Transition.Out type=\"fade\" />\n\t\t\t\t\t\t<Transition.Change interpolation=\"easeOut\" />\n\t\t\t\t\t</Transition.Together>\n\t\t\t\t\t<Transition.In type=\"fade\" />\n\t\t\t\t</Transition.Sequence>\n\t\t\t),\n\t\t[props.transitionConfig]\n\t)\n\tconst containerStyle = useMemo(\n\t\t() => ({\n\t\t\t...styles.container,\n\t\t\t...props.containerStyle\n\t\t}),\n\t\t[props.containerStyle]\n\t)\n\treturn (\n\t\t<Transitioning.View\n\t\t\tref={transitionRef}\n\t\t\ttransition={transition}\n\t\t\tstyle={containerStyle}\n\t\t>\n\t\t\t<Container style={containerStyle}>\n\t\t\t\t{renderHeader()}\n\t\t\t\t{renderList()}\n\t\t\t\t{renderFooter()}\n\t\t\t\t{renderComposer()}\n\t\t\t</Container>\n\t\t</Transitioning.View>\n\t)\n}\n\nexport default Chat\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tflex: 1\n\t},\n\tcontentContainer: {\n\t\tflexGrow: 1\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/ChatProvider/index.tsx";import React from'react';import{FuegoProvider}from'@nandorojo/fuego';import ChatContext from'../../ChatContext';import Chat from'../../classes/Chat/index';export var fuego;export var chat;export var setFuego=function setFuego(f){return fuego=f;};export var setChat=function setChat(c){return chat=c;};var Provider=function Provider(_ref){var children=_ref.children,FuegoInstance=_ref.fuego,_ref$chat=_ref.chat,ChatInstance=_ref$chat===void 0?new Chat({}):_ref$chat;setFuego(FuegoInstance);setChat(ChatInstance);return React.createElement(FuegoProvider,{fuego:fuego,__source:{fileName:_jsxFileName,lineNumber:25}},React.createElement(ChatContext.Provider,{__source:{fileName:_jsxFileName,lineNumber:26}},children));};export default Provider;
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","FuegoProvider","ChatContext","Chat","fuego","chat","setFuego","f","setChat","c","Provider","children","FuegoInstance","ChatInstance"],"mappings":"0GAAA,MAAOA,CAAAA,KAAP,KAAyC,OAAzC,CACA,OAASC,aAAT,KAAqC,kBAArC,CACA,MAAOC,CAAAA,WAAP,KAAwB,mBAAxB,CAEA,MAAOC,CAAAA,IAAP,KAAiB,0BAAjB,CAEA,MAAO,IAAIC,CAAAA,KAAJ,CACP,MAAO,IAAIC,CAAAA,IAAJ,CAGP,MAAO,IAAMC,CAAAA,QAAQ,CAAG,QAAXA,CAAAA,QAAW,CAACC,CAAD,QAAeH,CAAAA,KAAK,CAAGG,CAAvB,EAAjB,CACP,MAAO,IAAMC,CAAAA,OAAO,CAAG,QAAVA,CAAAA,OAAU,CAACC,CAAD,QAAcJ,CAAAA,IAAI,CAAGI,CAArB,EAAhB,CAEP,GAAMC,CAAAA,QAA8C,CAAG,QAAjDA,CAAAA,QAAiD,MAIjD,IAHLC,CAAAA,QAGK,MAHLA,QAGK,CAFEC,aAEF,MAFLR,KAEK,gBADLC,IACK,CADCQ,YACD,oBADgB,GAAIV,CAAAA,IAAJ,CAAS,EAAT,CAChB,WACLG,QAAQ,CAACM,aAAD,CAAR,CACAJ,OAAO,CAACK,YAAD,CAAP,CAIA,MACC,qBAAC,aAAD,EAAe,KAAK,CAAET,KAAtB,iDACC,oBAAC,WAAD,CAAa,QAAb,kDAAuBO,QAAvB,CADD,CADD,CAKA,CAfD,CAiBA,cAAeD,CAAAA,QAAf","sourcesContent":["import React, { FunctionComponent } from 'react'\nimport { FuegoProvider, Fuego } from '@nandorojo/fuego'\nimport ChatContext from '../../ChatContext'\nimport { ChatProviderProps } from './types'\nimport Chat from '../../classes/Chat/index'\n\nexport let fuego: Fuego\nexport let chat: Chat\n\n// useful for non-react projects that need to use this var too.\nexport const setFuego = (f: Fuego) => (fuego = f)\nexport const setChat = (c: Chat) => (chat = c)\n\nconst Provider: FunctionComponent<ChatProviderProps> = ({\n\tchildren,\n\tfuego: FuegoInstance,\n\tchat: ChatInstance = new Chat({})\n}) => {\n\tsetFuego(FuegoInstance)\n\tsetChat(ChatInstance)\n\t// fuego = FuegoInstance\n\t// chat = ChatInstance\n\n\treturn (\n\t\t<FuegoProvider fuego={fuego}>\n\t\t\t<ChatContext.Provider>{children}</ChatContext.Provider>\n\t\t</FuegoProvider>\n\t)\n}\n\nexport default Provider\n"]}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/Circle/index.tsx";import React from'react';import{View,StyleSheet}from'react-native';var Circle=function Circle(props){var size=props.size;var height=props.height||size;var width=props.width||size;var borderWidth=props.borderWidth||0;var borderRadius=props.borderRadius||size/2;var innerSize=size-borderWidth*2;var innerBorderRadius=innerSize/2;return React.createElement(View,{style:[styles.container,{height:height,width:width,borderRadius:borderRadius,backgroundColor:props.borderColor}],__source:{fileName:_jsxFileName,lineNumber:15}},React.createElement(View,{style:[styles.wrapper,{height:innerSize,width:innerSize,borderRadius:innerBorderRadius}],__source:{fileName:_jsxFileName,lineNumber:21}},props.children));};export default Circle;var styles=StyleSheet.create({container:{justifyContent:'center',alignItems:'center'},wrapper:{overflow:'hidden'}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","View","StyleSheet","Circle","props","size","height","width","borderWidth","borderRadius","innerSize","innerBorderRadius","styles","container","backgroundColor","borderColor","wrapper","children","create","justifyContent","alignItems","overflow"],"mappings":"+GAAA,MAAOA,CAAAA,KAAP,KAAyC,OAAzC,CAEA,OAASC,IAAT,CAAeC,UAAf,KAAiC,cAAjC,CAEA,GAAMC,CAAAA,MAAsC,CAAG,QAAzCA,CAAAA,MAAyC,CAAAC,KAAK,CAAI,CACvD,GAAMC,CAAAA,IAAI,CAAGD,KAAK,CAACC,IAAnB,CACA,GAAMC,CAAAA,MAAM,CAAGF,KAAK,CAACE,MAAN,EAAgBD,IAA/B,CACA,GAAME,CAAAA,KAAK,CAAGH,KAAK,CAACG,KAAN,EAAeF,IAA7B,CACA,GAAMG,CAAAA,WAAW,CAAGJ,KAAK,CAACI,WAAN,EAAqB,CAAzC,CACA,GAAMC,CAAAA,YAAY,CAAGL,KAAK,CAACK,YAAN,EAAsBJ,IAAI,CAAG,CAAlD,CAEA,GAAMK,CAAAA,SAAS,CAAGL,IAAI,CAAGG,WAAW,CAAG,CAAvC,CACA,GAAMG,CAAAA,iBAAiB,CAAGD,SAAS,CAAG,CAAtC,CACA,MACC,qBAAC,IAAD,EACC,KAAK,CAAE,CACNE,MAAM,CAACC,SADD,CAEN,CAAEP,MAAM,CAANA,MAAF,CAAUC,KAAK,CAALA,KAAV,CAAiBE,YAAY,CAAZA,YAAjB,CAA+BK,eAAe,CAAEV,KAAK,CAACW,WAAtD,CAFM,CADR,iDAMC,oBAAC,IAAD,EACC,KAAK,CAAE,CACNH,MAAM,CAACI,OADD,CAEN,CACCV,MAAM,CAAEI,SADT,CAECH,KAAK,CAAEG,SAFR,CAGCD,YAAY,CAAEE,iBAHf,CAFM,CADR,iDAUEP,KAAK,CAACa,QAVR,CAND,CADD,CAqBA,CA9BD,CAgCA,cAAed,CAAAA,MAAf,CAEA,GAAMS,CAAAA,MAAM,CAAGV,UAAU,CAACgB,MAAX,CAAkB,CAChCL,SAAS,CAAE,CACVM,cAAc,CAAE,QADN,CAEVC,UAAU,CAAE,QAFF,CADqB,CAKhCJ,OAAO,CAAE,CACRK,QAAQ,CAAE,QADF,CALuB,CAAlB,CAAf","sourcesContent":["import React, { FunctionComponent } from 'react'\nimport { CircleProps } from './types'\nimport { View, StyleSheet } from 'react-native'\n\nconst Circle: FunctionComponent<CircleProps> = props => {\n\tconst size = props.size\n\tconst height = props.height || size\n\tconst width = props.width || size\n\tconst borderWidth = props.borderWidth || 0\n\tconst borderRadius = props.borderRadius || size / 2\n\n\tconst innerSize = size - borderWidth * 2\n\tconst innerBorderRadius = innerSize / 2\n\treturn (\n\t\t<View\n\t\t\tstyle={[\n\t\t\t\tstyles.container,\n\t\t\t\t{ height, width, borderRadius, backgroundColor: props.borderColor }\n\t\t\t]}\n\t\t>\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.wrapper,\n\t\t\t\t\t{\n\t\t\t\t\t\theight: innerSize,\n\t\t\t\t\t\twidth: innerSize,\n\t\t\t\t\t\tborderRadius: innerBorderRadius\n\t\t\t\t\t}\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{props.children}\n\t\t\t</View>\n\t\t</View>\n\t)\n}\n\nexport default Circle\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center'\n\t},\n\twrapper: {\n\t\toverflow: 'hidden'\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/Initials/index.tsx";import React from'react';import{Text,StyleSheet,View}from'react-native';export default React.memo(function(props){var borderRadius=props.size/2;var fontSize=props.size/2.5;return React.createElement(View,{style:[styles.container,props.containerStyle?props.containerStyle:{},props.backgroundColor?{backgroundColor:props.backgroundColor}:{},{borderRadius:borderRadius,height:props.size,width:props.size}],__source:{fileName:_jsxFileName,lineNumber:9}},React.createElement(Text,{style:[styles.text,{fontSize:fontSize},props.textStyle?props.textStyle:{},props.textColor?{color:props.textColor}:{}],__source:{fileName:_jsxFileName,lineNumber:17}},props.initials.toUpperCase()));});var styles=StyleSheet.create({container:{backgroundColor:'lightblue',alignItems:'center',justifyContent:'center'},text:{color:'white',fontWeight:'bold'}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","Text","StyleSheet","View","memo","props","borderRadius","size","fontSize","styles","container","containerStyle","backgroundColor","height","width","text","textStyle","textColor","color","initials","toUpperCase","create","alignItems","justifyContent","fontWeight"],"mappings":"iHAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,IAAT,CAAeC,UAAf,CAA2BC,IAA3B,KAAuC,cAAvC,CAGA,cAAeH,CAAAA,KAAK,CAACI,IAAN,CAAW,SAACC,KAAD,CAA0B,CACnD,GAAMC,CAAAA,YAAY,CAAGD,KAAK,CAACE,IAAN,CAAa,CAAlC,CACA,GAAMC,CAAAA,QAAQ,CAAGH,KAAK,CAACE,IAAN,CAAa,GAA9B,CACA,MACC,qBAAC,IAAD,EACC,KAAK,CAAE,CACNE,MAAM,CAACC,SADD,CAENL,KAAK,CAACM,cAAN,CAAuBN,KAAK,CAACM,cAA7B,CAA8C,EAFxC,CAGNN,KAAK,CAACO,eAAN,CAAwB,CAAEA,eAAe,CAAEP,KAAK,CAACO,eAAzB,CAAxB,CAAqE,EAH/D,CAIN,CAAEN,YAAY,CAAZA,YAAF,CAAgBO,MAAM,CAAER,KAAK,CAACE,IAA9B,CAAoCO,KAAK,CAAET,KAAK,CAACE,IAAjD,CAJM,CADR,gDAQC,oBAAC,IAAD,EACC,KAAK,CAAE,CACNE,MAAM,CAACM,IADD,CAEN,CAAEP,QAAQ,CAARA,QAAF,CAFM,CAGNH,KAAK,CAACW,SAAN,CAAkBX,KAAK,CAACW,SAAxB,CAAoC,EAH9B,CAINX,KAAK,CAACY,SAAN,CAAkB,CAAEC,KAAK,CAAEb,KAAK,CAACY,SAAf,CAAlB,CAA+C,EAJzC,CADR,iDAQEZ,KAAK,CAACc,QAAN,CAAeC,WAAf,EARF,CARD,CADD,CAqBA,CAxBc,CAAf,CA0BA,GAAMX,CAAAA,MAAM,CAAGP,UAAU,CAACmB,MAAX,CAAkB,CAChCX,SAAS,CAAE,CACVE,eAAe,CAAE,WADP,CAEVU,UAAU,CAAE,QAFF,CAGVC,cAAc,CAAE,QAHN,CADqB,CAMhCR,IAAI,CAAE,CACLG,KAAK,CAAE,OADF,CAELM,UAAU,CAAE,MAFP,CAN0B,CAAlB,CAAf","sourcesContent":["import React from 'react'\nimport { Text, StyleSheet, View } from 'react-native'\nimport { InitialsProps } from '../../types'\n\nexport default React.memo((props: InitialsProps) => {\n\tconst borderRadius = props.size / 2\n\tconst fontSize = props.size / 2.5\n\treturn (\n\t\t<View\n\t\t\tstyle={[\n\t\t\t\tstyles.container,\n\t\t\t\tprops.containerStyle ? props.containerStyle : {},\n\t\t\t\tprops.backgroundColor ? { backgroundColor: props.backgroundColor } : {},\n\t\t\t\t{ borderRadius, height: props.size, width: props.size }\n\t\t\t]}\n\t\t>\n\t\t\t<Text\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.text,\n\t\t\t\t\t{ fontSize },\n\t\t\t\t\tprops.textStyle ? props.textStyle : {},\n\t\t\t\t\tprops.textColor ? { color: props.textColor } : {}\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{props.initials.toUpperCase()}\n\t\t\t</Text>\n\t\t</View>\n\t)\n})\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tbackgroundColor: 'lightblue',\n\t\talignItems: 'center',\n\t\tjustifyContent: 'center'\n\t},\n\ttext: {\n\t\tcolor: 'white',\n\t\tfontWeight: 'bold'\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/ItemDate/index.tsx";import React from'react';import{Text,StyleSheet}from'react-native';import moment from'moment';export default(function(props){var text=props.dateToStringFunc?props.dateToStringFunc(props.date):moment(props.date).calendar(undefined,{lastDay:'[Yesterday]',sameDay:'LT',nextDay:'[Tomorrow at] LT',lastWeek:'dddd',nextWeek:'[Next] dddd',sameElse:'L'});return React.createElement(Text,{style:[styles.text,props.style],__source:{fileName:_jsxFileName,lineNumber:18}},text);});var styles=StyleSheet.create({text:{color:'gray',paddingLeft:5}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","Text","StyleSheet","moment","props","text","dateToStringFunc","date","calendar","undefined","lastDay","sameDay","nextDay","lastWeek","nextWeek","sameElse","styles","style","create","color","paddingLeft"],"mappings":"iHAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,IAAT,CAAeC,UAAf,KAAiC,cAAjC,CACA,MAAOC,CAAAA,MAAP,KAAmB,QAAnB,CAGA,eAAe,SAACC,KAAD,CAAsB,CACpC,GAAMC,CAAAA,IAAI,CAAGD,KAAK,CAACE,gBAAN,CACVF,KAAK,CAACE,gBAAN,CAAuBF,KAAK,CAACG,IAA7B,CADU,CAEVJ,MAAM,CAACC,KAAK,CAACG,IAAP,CAAN,CAAmBC,QAAnB,CAA4BC,SAA5B,CAAuC,CACvCC,OAAO,CAAE,aAD8B,CAEvCC,OAAO,CAAE,IAF8B,CAGvCC,OAAO,CAAE,kBAH8B,CAIvCC,QAAQ,CAAE,MAJ6B,CAKvCC,QAAQ,CAAE,aAL6B,CAMvCC,QAAQ,CAAE,GAN6B,CAAvC,CAFH,CAWA,MAAO,qBAAC,IAAD,EAAM,KAAK,CAAE,CAACC,MAAM,CAACX,IAAR,CAAcD,KAAK,CAACa,KAApB,CAAb,iDAA0CZ,IAA1C,CAAP,CACA,CAbD,EAeA,GAAMW,CAAAA,MAAM,CAAGd,UAAU,CAACgB,MAAX,CAAkB,CAChCb,IAAI,CAAE,CACLc,KAAK,CAAE,MADF,CAELC,WAAW,CAAE,CAFR,CAD0B,CAAlB,CAAf","sourcesContent":["import React from 'react'\nimport { Text, StyleSheet } from 'react-native'\nimport moment from 'moment'\nimport { DateProps } from '../../types'\n\nexport default (props: DateProps) => {\n\tconst text = props.dateToStringFunc\n\t\t? props.dateToStringFunc(props.date)\n\t\t: moment(props.date).calendar(undefined, {\n\t\t\t\tlastDay: '[Yesterday]',\n\t\t\t\tsameDay: 'LT',\n\t\t\t\tnextDay: '[Tomorrow at] LT',\n\t\t\t\tlastWeek: 'dddd',\n\t\t\t\tnextWeek: '[Next] dddd',\n\t\t\t\tsameElse: 'L'\n\t\t })\n\n\treturn <Text style={[styles.text, props.style]}>{text}</Text>\n}\n\nconst styles = StyleSheet.create({\n\ttext: {\n\t\tcolor: 'gray',\n\t\tpaddingLeft: 5\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/Separator/index.tsx";import React from'react';import{View}from'react-native';export default(function(props){return React.createElement(View,{style:{backgroundColor:props.color||'lightgray',height:props.size||0.75},__source:{fileName:_jsxFileName,lineNumber:6}});});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","View","props","backgroundColor","color","height","size"],"mappings":"kHAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,IAAT,KAAqB,cAArB,CAEA,eAAe,SAACC,KAAD,CAA8C,CAC5D,MACC,qBAAC,IAAD,EACC,KAAK,CAAE,CACNC,eAAe,CAAED,KAAK,CAACE,KAAN,EAAe,WAD1B,CAENC,MAAM,CAAEH,KAAK,CAACI,IAAN,EAAc,IAFhB,CADR,gDADD,CAQA,CATD","sourcesContent":["import React from 'react'\nimport { View } from 'react-native'\n\nexport default (props: { color?: string; size?: number }) => {\n\treturn (\n\t\t<View\n\t\t\tstyle={{\n\t\t\t\tbackgroundColor: props.color || 'lightgray',\n\t\t\t\theight: props.size || 0.75\n\t\t\t}}\n\t\t/>\n\t)\n}\n"]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/Subtitle/index.tsx";import React from'react';import{Text,StyleSheet}from'react-native';export default function(props){var lastMessageText=props.lastMessageText,_props$textStyle=props.textStyle,textStyle=_props$textStyle===void 0?{}:_props$textStyle;return React.createElement(Text,{style:[styles.text,textStyle],numberOfLines:2,ellipsizeMode:'tail',__source:{fileName:_jsxFileName,lineNumber:8}},lastMessageText);}var styles=StyleSheet.create({text:{color:'gray',marginTop:5}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","Text","StyleSheet","props","lastMessageText","textStyle","styles","text","create","color","marginTop"],"mappings":"iHAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,IAAT,CAAeC,UAAf,KAAiC,cAAjC,CAGA,cAAe,UAASC,KAAT,CAAwC,IAC9CC,CAAAA,eAD8C,CACVD,KADU,CAC9CC,eAD8C,kBACVD,KADU,CAC7BE,SAD6B,CAC7BA,SAD6B,2BACjB,EADiB,kBAEtD,MACC,qBAAC,IAAD,EACC,KAAK,CAAE,CAACC,MAAM,CAACC,IAAR,CAAcF,SAAd,CADR,CAEC,aAAa,CAAE,CAFhB,CAGC,aAAa,CAAE,MAHhB,gDAKED,eALF,CADD,CASA,CAED,GAAME,CAAAA,MAAM,CAAGJ,UAAU,CAACM,MAAX,CAAkB,CAChCD,IAAI,CAAE,CACLE,KAAK,CAAE,MADF,CAELC,SAAS,CAAE,CAFN,CAD0B,CAAlB,CAAf","sourcesContent":["import React from 'react'\nimport { Text, StyleSheet } from 'react-native'\nimport { InboxItemSubtitleProps } from '../../types'\n\nexport default function(props: InboxItemSubtitleProps) {\n\tconst { lastMessageText, textStyle = {} } = props\n\treturn (\n\t\t<Text\n\t\t\tstyle={[styles.text, textStyle]}\n\t\t\tnumberOfLines={2}\n\t\t\tellipsizeMode={'tail'}\n\t\t>\n\t\t\t{lastMessageText}\n\t\t</Text>\n\t)\n}\n\nconst styles = StyleSheet.create({\n\ttext: {\n\t\tcolor: 'gray',\n\t\tmarginTop: 5\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/Swipeable/index.tsx";import React,{useRef}from'react';import Swipes from'react-native-gesture-handler/Swipeable';import{Animated,Text,View,StyleSheet}from'react-native';import{RectButton}from'react-native-gesture-handler';var Swipeable=function Swipeable(props){var actionItemWidth=props.actionWidth||64;var swipeableRowRef=useRef(null);function renderAction(action,index,progress,drag,side,numberOfActions){if(props.renderAction)return props.renderAction(action,index,progress,drag,side);if(props.renderAction===null)return null;var outputRange=side==='right'?[(numberOfActions-index)*actionItemWidth,0]:[-index*actionItemWidth,0];var translateX=progress.interpolate({inputRange:[0,1],outputRange:outputRange});function onPress(){if(swipeableRowRef.current)swipeableRowRef.current.close();if(action.onPress)action.onPress(props.id);}return React.createElement(Animated.View,{key:JSON.stringify(action+(""+Math.random())),style:{flex:1,transform:[{translateX:translateX}]},__source:{fileName:_jsxFileName,lineNumber:39}},React.createElement(RectButton,{style:[styles.action,{backgroundColor:action.backgroundColor}],onPress:onPress,__source:{fileName:_jsxFileName,lineNumber:43}},action.renderIcon&&action.renderIcon(progress,drag),React.createElement(Text,{style:[styles.actionText,{color:action.color},props.textStyle],__source:{fileName:_jsxFileName,lineNumber:48}},action.text)));}function renderRightActions(progress,drag){var actions=props.rightActions||[];if(props.renderRightActions)return props.renderRightActions(actions,progress,drag);if(props.renderRightActions===null)return null;return renderActionList(actions,progress,drag,'right');}function renderLeftActions(progress,drag){var actions=props.leftActions||[];if(props.renderLeftActions)return props.renderLeftActions(actions,progress,drag);if(props.renderLeftActions===null)return null;return renderActionList(actions,progress,drag,'left');}function renderActionList(actions,progress,drag,side){return React.createElement(View,{style:[styles.actionList,{width:actionItemWidth*actions.length}],__source:{fileName:_jsxFileName,lineNumber:102}},actions.map(function(action,index){return renderAction(action,index,progress,drag,side,actions.length);}));}return React.createElement(Swipes,_extends({friction:2,leftThreshold:30,rightThreshold:40,renderLeftActions:renderLeftActions,renderRightActions:renderRightActions,ref:swipeableRowRef},props.gestureHandlerProps||{},{__source:{fileName:_jsxFileName,lineNumber:112}}),props.children);};export default React.memo(Swipeable);var styles=StyleSheet.create({actionList:{flexDirection:'row'},action:{alignItems:'center',justifyContent:'center',flex:1},actionText:{padding:10}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","useRef","Swipes","Animated","Text","View","StyleSheet","RectButton","Swipeable","props","actionItemWidth","actionWidth","swipeableRowRef","renderAction","action","index","progress","drag","side","numberOfActions","outputRange","translateX","interpolate","inputRange","onPress","current","close","id","JSON","stringify","Math","random","flex","transform","styles","backgroundColor","renderIcon","actionText","color","textStyle","text","renderRightActions","actions","rightActions","renderActionList","renderLeftActions","leftActions","actionList","width","length","map","gestureHandlerProps","children","memo","create","flexDirection","alignItems","justifyContent","padding"],"mappings":"uKAAA,MAAOA,CAAAA,KAAP,EAAmCC,MAAnC,KAAiD,OAAjD,CACA,MAAOC,CAAAA,MAAP,KAAmB,wCAAnB,CACA,OAASC,QAAT,CAAmBC,IAAnB,CAAyBC,IAAzB,CAA+BC,UAA/B,KAAiD,cAAjD,CAEA,OAASC,UAAT,KAA2B,8BAA3B,CAEA,GAAMC,CAAAA,SAA4C,CAAG,QAA/CA,CAAAA,SAA+C,CAAAC,KAAK,CAAI,CAC7D,GAAMC,CAA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CAAoBC,IAApB,CAA0B,MAA1B,CAAvB,CACA,CACD,QAAS2B,CAAAA,gBAAT,CACCF,OADD,CAEC1B,QAFD,CAGCC,IAHD,CAICC,IAJD,CAKE,CACD,MACC,qBAAC,IAAD,EACC,KAAK,CAAE,CAACgB,MAAM,CAACa,UAAR,CAAoB,CAAEC,KAAK,CAAEtC,eAAe,CAAGgC,OAAO,CAACO,MAAnC,CAApB,CADR,kDAGEP,OAAO,CAACQ,GAAR,CAAY,SAACpC,MAAD,CAASC,KAAT,QACZF,CAAAA,YAAY,CAACC,MAAD,CAASC,KAAT,CAAgBC,QAAhB,CAA0BC,IAA1B,CAAgCC,IAAhC,CAAsCwB,OAAO,CAACO,MAA9C,CADA,EAAZ,CAHF,CADD,CASA,CACD,MACC,qBAAC,MAAD,WACC,QAAQ,CAAE,CADX,CAEC,aAAa,CAAE,EAFhB,CAGC,cAAc,CAAE,EAHjB,CAIC,iBAAiB,CAAEJ,iBAJpB,CAKC,kBAAkB,CAAEJ,kBALrB,CAMC,GAAG,CAAE7B,eANN,EAOMH,KAAK,CAAC0C,mBAAN,EAA6B,EAPnC,oDASE1C,KAAK,CAAC2C,QATR,CADD,CAaA,CArHD,CAuHA,cAAepD,CAAAA,KAAK,CAACqD,IAAN,CAAW7C,SAAX,CAAf,CAKA,GAAM0B,CAAAA,MAAM,CAAG5B,UAAU,CAACgD,MAAX,CAAkB,CAChCP,UAAU,CAAE,CACXQ,aAAa,CAAE,KADJ,CADoB,CAIhCzC,MAAM,CAAE,CACP0C,UAAU,CAAE,QADL,CAEPC,cAAc,CAAE,QAFT,CAGPzB,IAAI,CAAE,CAHC,CAJwB,CAShCK,UAAU,CAAE,CACXqB,OAAO,CAAE,EADE,CAToB,CAAlB,CAAf","sourcesContent":["import React, { FunctionComponent, useRef } from 'react'\nimport Swipes from 'react-native-gesture-handler/Swipeable'\nimport { Animated, Text, View, StyleSheet } from 'react-native'\nimport { SwipeableProps, SwipeableAction } from '../../types'\nimport { RectButton } from 'react-native-gesture-handler'\n\nconst Swipeable: FunctionComponent<SwipeableProps> = props => {\n\tconst actionItemWidth = props.actionWidth || 64\n\tconst swipeableRowRef = useRef<Swipes>(null)\n\n\tfunction renderAction(\n\t\taction: SwipeableAction,\n\t\tindex: number,\n\t\tprogress: Progress,\n\t\tdrag: Drag,\n\t\tside: 'left' | 'right',\n\t\tnumberOfActions: number\n\t) {\n\t\tif (props.renderAction)\n\t\t\treturn props.renderAction(action, index, progress, drag, side)\n\t\tif (props.renderAction === null) return null\n\n\t\tconst outputRange =\n\t\t\tside === 'right'\n\t\t\t\t? [(numberOfActions - index) * actionItemWidth, 0]\n\t\t\t\t: [-index * actionItemWidth, 0]\n\n\t\tconst translateX = progress.interpolate({\n\t\t\tinputRange: [0, 1],\n\t\t\toutputRange\n\t\t})\n\n\t\tfunction onPress() {\n\t\t\tif (swipeableRowRef.current) swipeableRowRef.current.close()\n\t\t\tif (action.onPress) action.onPress(props.id)\n\t\t}\n\n\t\treturn (\n\t\t\t<Animated.View\n\t\t\t\tkey={JSON.stringify(action + `${Math.random()}`)}\n\t\t\t\tstyle={{ flex: 1, transform: [{ translateX }] }}\n\t\t\t>\n\t\t\t\t<RectButton\n\t\t\t\t\tstyle={[styles.action, { backgroundColor: action.backgroundColor }]}\n\t\t\t\t\tonPress={onPress}\n\t\t\t\t>\n\t\t\t\t\t{action.renderIcon && action.renderIcon(progress, drag)}\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\tstyles.actionText,\n\t\t\t\t\t\t\t{ color: action.color },\n\t\t\t\t\t\t\tprops.textStyle\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{action.text}\n\t\t\t\t\t</Text>\n\t\t\t\t</RectButton>\n\t\t\t</Animated.View>\n\t\t)\n\t}\n\tfunction renderRightActions(progress: Progress, drag: Drag) {\n\t\tconst actions =\n\t\t\tprops.rightActions ||\n\t\t\t[\n\t\t\t\t// {\n\t\t\t\t// \tcolor: 'white',\n\t\t\t\t// \tbackgroundColor: 'purple',\n\t\t\t\t// \tIconNode: null,\n\t\t\t\t// \ttext: 'Test'\n\t\t\t\t// }\n\t\t\t]\n\t\tif (props.renderRightActions)\n\t\t\treturn props.renderRightActions(actions, progress, drag)\n\t\tif (props.renderRightActions === null) return null\n\n\t\treturn renderActionList(actions, progress, drag, 'right')\n\t}\n\tfunction renderLeftActions(progress: Progress, drag: Drag) {\n\t\tconst actions =\n\t\t\tprops.leftActions ||\n\t\t\t[\n\t\t\t\t// {\n\t\t\t\t// \tcolor: 'white',\n\t\t\t\t// \tbackgroundColor: 'blue',\n\t\t\t\t// \tIconNode: null,\n\t\t\t\t// \ttext: 'Scripture monkey'\n\t\t\t\t// }\n\t\t\t]\n\t\tif (props.renderLeftActions)\n\t\t\treturn props.renderLeftActions(actions, progress, drag)\n\t\tif (props.renderLeftActions === null) return null\n\n\t\treturn renderActionList(actions, progress, drag, 'left')\n\t}\n\tfunction renderActionList(\n\t\tactions: SwipeableAction[],\n\t\tprogress: Progress,\n\t\tdrag: Drag,\n\t\tside: 'left' | 'right'\n\t) {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[styles.actionList, { width: actionItemWidth * actions.length }]}\n\t\t\t>\n\t\t\t\t{actions.map((action, index) =>\n\t\t\t\t\trenderAction(action, index, progress, drag, side, actions.length)\n\t\t\t\t)}\n\t\t\t</View>\n\t\t)\n\t}\n\treturn (\n\t\t<Swipes\n\t\t\tfriction={2}\n\t\t\tleftThreshold={30}\n\t\t\trightThreshold={40}\n\t\t\trenderLeftActions={renderLeftActions}\n\t\t\trenderRightActions={renderRightActions}\n\t\t\tref={swipeableRowRef}\n\t\t\t{...(props.gestureHandlerProps || {})}\n\t\t>\n\t\t\t{props.children}\n\t\t</Swipes>\n\t)\n}\n\nexport default React.memo(Swipeable)\n\ntype Progress = Animated.Value | Animated.AnimatedInterpolation\ntype Drag = Animated.AnimatedInterpolation\n\nconst styles = StyleSheet.create({\n\tactionList: {\n\t\tflexDirection: 'row'\n\t},\n\taction: {\n\t\talignItems: 'center',\n\t\tjustifyContent: 'center',\n\t\tflex: 1\n\t},\n\tactionText: {\n\t\tpadding: 10\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/Title/index.tsx";import React from'react';import{Text,StyleSheet,View}from'react-native';export default function(_ref){var title=_ref.title,style=_ref.style,containerStyle=_ref.containerStyle;return React.createElement(View,{style:[styles.container,containerStyle],__source:{fileName:_jsxFileName,lineNumber:7}},React.createElement(Text,{numberOfLines:1,ellipsizeMode:"tail",style:[styles.text,style],__source:{fileName:_jsxFileName,lineNumber:8}},title));}var styles=StyleSheet.create({container:{flex:1},text:{fontWeight:'600',fontSize:17}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","Text","StyleSheet","View","title","style","containerStyle","styles","container","text","create","flex","fontWeight","fontSize"],"mappings":"8GAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,IAAT,CAAeC,UAAf,CAA2BC,IAA3B,KAAuC,cAAvC,CAGA,cAAe,eAAgE,IAArDC,CAAAA,KAAqD,MAArDA,KAAqD,CAA9CC,KAA8C,MAA9CA,KAA8C,CAAvCC,cAAuC,MAAvCA,cAAuC,CAC9E,MACC,qBAAC,IAAD,EAAM,KAAK,CAAE,CAACC,MAAM,CAACC,SAAR,CAAmBF,cAAnB,CAAb,gDACC,oBAAC,IAAD,EAAM,aAAa,CAAE,CAArB,CAAwB,aAAa,CAAC,MAAtC,CAA6C,KAAK,CAAE,CAACC,MAAM,CAACE,IAAR,CAAcJ,KAAd,CAApD,gDACED,KADF,CADD,CADD,CAOA,CAED,GAAMG,CAAAA,MAAM,CAAGL,UAAU,CAACQ,MAAX,CAAkB,CAChCF,SAAS,CAAE,CACVG,IAAI,CAAE,CADI,CADqB,CAIhCF,IAAI,CAAE,CACLG,UAAU,CAAE,KADP,CAELC,QAAQ,CAAE,EAFL,CAJ0B,CAAlB,CAAf","sourcesContent":["import React from 'react'\nimport { Text, StyleSheet, View } from 'react-native'\nimport { InboxItemTitleProps } from '../../types'\n\nexport default function({ title, style, containerStyle }: InboxItemTitleProps) {\n\treturn (\n\t\t<View style={[styles.container, containerStyle]}>\n\t\t\t<Text numberOfLines={1} ellipsizeMode=\"tail\" style={[styles.text, style]}>\n\t\t\t\t{title}\n\t\t\t</Text>\n\t\t</View>\n\t)\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tflex: 1\n\t},\n\ttext: {\n\t\tfontWeight: '600',\n\t\tfontSize: 17\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/UnreadIndicator/index.tsx";import React from'react';import{View,Text,StyleSheet}from'react-native';import{LinearGradient}from'expo-linear-gradient';var Indicator=function Indicator(props){if(!props.show)return null;var size=props.size||(props.showCount?20:15);var justifyContent='center';if(props.position==='bottom')justifyContent='flex-end';if(props.position==='top')justifyContent='flex-start';var characterCount=props.unreadCount&&props.unreadCount.toString().length||1;var width=size;if(props.showCount&&characterCount===2)width=size*1.1;else if(props.showCount&&characterCount===3)width=size*1.5;var opacity=props.unreadCount?1:0;var BackgroundComponent=props.type==='gradient'?LinearGradient:View;return React.createElement(View,{style:[styles.container,{justifyContent:justifyContent,width:props.showCount?size*1.5:size,opacity:opacity}],__source:{fileName:_jsxFileName,lineNumber:31}},React.createElement(BackgroundComponent,_extends({style:[styles.background,{backgroundColor:props.backgroundColor,width:width,height:size,borderRadius:size/2},props.backgroundStyle||{}]},props.gradientProps||{colors:['red','blue']},{__source:{fileName:_jsxFileName,lineNumber:41}}),React.createElement(Text,{style:[styles.text,props.textStyle||{},props.textColor?{color:props.textColor}:{}],__source:{fileName:_jsxFileName,lineNumber:56}},!!props.showCount&&(props.unreadCount||''))));};var styles=StyleSheet.create({container:{alignItems:'center'},background:{overflow:'hidden',alignItems:'center',justifyContent:'center',backgroundColor:'blue'},text:{color:'white'}});export default React.memo(Indicator);
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","View","Text","StyleSheet","LinearGradient","Indicator","props","show","size","showCount","justifyContent","position","characterCount","unreadCount","toString","length","width","opacity","BackgroundComponent","type","styles","container","background","backgroundColor","height","borderRadius","backgroundStyle","gradientProps","colors","text","textStyle","textColor","color","create","alignItems","overflow","memo"],"mappings":"6KAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,IAAT,CAAeC,IAAf,CAAqBC,UAArB,KAAkD,cAAlD,CAEA,OAASC,cAAT,KAA+B,sBAA/B,CAEA,GAAMC,CAAAA,SAAS,CAAG,QAAZA,CAAAA,SAAY,CAACC,KAAD,CAAiC,CAClD,GAAI,CAACA,KAAK,CAACC,IAAX,CAAiB,MAAO,KAAP,CAEjB,GAAIC,CAAAA,IAAI,CAAGF,KAAK,CAACE,IAAN,GAAeF,KAAK,CAACG,SAAN,CAAkB,EAAlB,CAAuB,EAAtC,CAAX,CAGA,GAAIC,CAAAA,cAAc,CAAG,QAArB,CACA,GAAIJ,KAAK,CAACK,QAAN,GAAmB,QAAvB,CAAiCD,cAAc,CAAG,UAAjB,CACjC,GAAIJ,KAAK,CAACK,QAAN,GAAmB,KAAvB,CAA8BD,cAAc,CAAG,YAAjB,CAG9B,GAAME,CAAAA,cAAc,CAClBN,KAAK,CAACO,WAAN,EAAqBP,KAAK,CAACO,WAAN,CAAkBC,QAAlB,GAA6BC,MAAnD,EAA8D,CAD/D,CAGA,GAAIC,CAAAA,KAAK,CAAGR,IAAZ,CACA,GAAIF,KAAK,CAACG,SAAN,EAAmBG,cAAc,GAAK,CAA1C,CAA6CI,KAAK,CAAGR,IAAI,CAAG,GAAf,CAA7C,IACK,IAAIF,KAAK,CAACG,SAAN,EA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qB,CAIhCZ,UAAU,CAAE,CACXa,QAAQ,CAAE,QADC,CAEXD,UAAU,CAAE,QAFD,CAGXxB,cAAc,CAAE,QAHL,CAIXa,eAAe,CAAE,MAJN,CAJoB,CAUhCM,IAAI,CAAE,CACLG,KAAK,CAAE,OADF,CAV0B,CAAlB,CAAf,CAeA,cAAehC,CAAAA,KAAK,CAACoC,IAAN,CAAW/B,SAAX,CAAf","sourcesContent":["import React from 'react'\nimport { View, Text, StyleSheet, ViewStyle } from 'react-native'\nimport { UnreadIndicatorProps } from '../../types'\nimport { LinearGradient } from 'expo-linear-gradient'\n\nconst Indicator = (props: UnreadIndicatorProps) => {\n\tif (!props.show) return null\n\n\tlet size = props.size || (props.showCount ? 20 : 15)\n\n\t// set vertical position\n\tlet justifyContent = 'center'\n\tif (props.position === 'bottom') justifyContent = 'flex-end'\n\tif (props.position === 'top') justifyContent = 'flex-start'\n\n\t// determine width\n\tconst characterCount =\n\t\t(props.unreadCount && props.unreadCount.toString().length) || 1\n\n\tlet width = size\n\tif (props.showCount && characterCount === 2) width = size * 1.1\n\telse if (props.showCount && characterCount === 3) width = size * 1.5\n\n\t// indicator should be invisible if the count is 0, no?\n\tconst opacity = props.unreadCount ? 1 : 0\n\n\t// if it's a gradient, set the gradient as the component\n\tconst BackgroundComponent = props.type === 'gradient' ? LinearGradient : View\n\n\treturn (\n\t\t<View\n\t\t\tstyle={[\n\t\t\t\tstyles.container,\n\t\t\t\t{\n\t\t\t\t\tjustifyContent,\n\t\t\t\t\twidth: props.showCount ? size * 1.5 : size,\n\t\t\t\t\topacity\n\t\t\t\t} as ViewStyle\n\t\t\t]}\n\t\t>\n\t\t\t<BackgroundComponent\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.background,\n\t\t\t\t\t{\n\t\t\t\t\t\tbackgroundColor: props.backgroundColor,\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\theight: size,\n\t\t\t\t\t\tborderRadius: size / 2\n\t\t\t\t\t},\n\t\t\t\t\tprops.backgroundStyle || {}\n\t\t\t\t]}\n\t\t\t\t{...(props.gradientProps || {\n\t\t\t\t\tcolors: ['red', 'blue']\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<Text\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.text,\n\t\t\t\t\t\tprops.textStyle || {},\n\t\t\t\t\t\tprops.textColor ? { color: props.textColor } : {}\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{!!props.showCount && (props.unreadCount || '')}\n\t\t\t\t</Text>\n\t\t\t</BackgroundComponent>\n\t\t</View>\n\t)\n}\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\talignItems: 'center'\n\t},\n\tbackground: {\n\t\toverflow: 'hidden',\n\t\talignItems: 'center',\n\t\tjustifyContent: 'center',\n\t\tbackgroundColor: 'blue'\n\t},\n\ttext: {\n\t\tcolor: 'white'\n\t}\n})\n\nexport default React.memo(Indicator)\n"]}
@@ -1,2 +0,0 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/index.tsx";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){_defineProperty(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}import React,{useCallback,useRef}from'react';import{RectButton}from'react-native-gesture-handler';import{View,StyleSheet}from'react-native';import Title from'./Title';import ItemDate from'./ItemDate';import UnreadIndicator from'./UnreadIndicator';import Subtitle from'./Subtitle';import Avatar from'../../Avatar';import Initials from'./Initials';import Swipeable from'./Swipeable/index';import TypingIndicator from'../../TypingIndicator';function Item(props){var renderCount=useRef(1);renderCount.current++;function renderTitle(){if(props.renderTitle)return props.renderTitle(props.name);if(props.renderTitle===null)return null;var TitleComponent=props.TitleComponent||Title;return React.createElement(TitleComponent,{title:props.name,style:props.titleStyle,containerStyle:props.titleContainerStyle,__source:{fileName:_jsxFileName,lineNumber:32}});}function renderDate(){if(props.renderDate)return props.renderDate(props.lastMessageCreatedAt);if(props.renderDate===null)return null;var DateComponent=props.DateComponent||ItemDate;return React.createElement(DateComponent,{dateToStringFunc:props.dateToStringFunc,date:props.lastMessageCreatedAt,style:props.dateStyle,__source:{fileName:_jsxFileName,lineNumber:46}});}function renderUnreadIndicator(){if(!props.showUnreadIndicator)return null;var position='center';if(props.unreadIndicatorPosition&&props.unreadIndicatorPosition.includes('-')){position=props.unreadIndicatorPosition.split('-')[0];}var backgroundColor=props.unreadIndicatorColor||'blue';var indicatorProps={unreadCount:props.unreadCount,textColor:props.unreadTextColor,showCount:props.showUnreadIndicatorCount,backgroundStyle:props.unreadIndicatorStyle,textStyle:props.unreadIndicatorTextStyle,position:position,backgroundColor:backgroundColor,type:props.unreadIndicatorType||'gradient',gradientProps:props.unreadIndicatorGradientProps||{colors:['red','blue']},show:props.showUnreadIndicator,size:props.unreadIndicatorSize};if(props.renderUnreadIndicator)return props.renderUnreadIndicator(indicatorProps);if(props.renderUnreadIndicator===null)return null;var UnreadIndicatorComponent=props.UnreadIndicatorComponent||UnreadIndicator;return React.createElement(UnreadIndicatorComponent,_extends({},indicatorProps,{__source:{fileName:_jsxFileName,lineNumber:93}}));}function renderSubtitle(){if(props.renderSubtitle===null)return null;if(props.showTypingIndicator&&props.numberOfPeopleTyping)return renderTypingIndicator();if(props.renderSubtitle)return props.renderSubtitle(props.lastMessageText);var SubtitleComponent=props.SubtitleComponent||Subtitle;return React.createElement(SubtitleComponent,{textStyle:props.subtitleTextStyle,lastMessageText:props.lastMessageText,__source:{fileName:_jsxFileName,lineNumber:105}});}function renderAvatarOrInitials(){if(props.disableAvatar)return null;var avatar=props.avatar;var initials=props.initials;var prioritizeAvatar=props.prioritizeAvatarOverInitials!==false;var size=props.avatarSize||55;var imageProps=props.avatarImageProps;var textStyle=props.initialsTextStyle;var initialsContainerStyle=props.initialsContainerStyle;var InitialsComponent=props.InitialsComponent||Initials;var AvatarComponent=props.AvatarComponent||Avatar;if(Array.isArray(avatar)){size/=2;return React.createElement(React.Fragment,null,avatar.map(function(member,i){if(member.avatar&&prioritizeAvatar){var avatarProps={imageProps:imageProps,size:size,avatar:member.avatar};if(props.renderAvatar)return props.renderAvatar(avatarProps);if(props.renderAvatar===null)return null;return React.createElement(AvatarComponent,_extends({},avatarProps,{__source:{fileName:_jsxFileName,lineNumber:159}}));}var initialsProps={textStyle:textStyle,containerStyle:initialsContainerStyle,initials:initials,size:size,textColor:props.initialsTextColor,backgroundColor:props.initialsBackgroundColor};if(props.renderInitials)return props.renderInitials(initialProps);if(props.renderInitials===null)return null;return React.createElement(InitialsComponent,_extends({key:initials+i.toString()},initialsProps,{__source:{fileName:_jsxFileName,lineNumber:175}}));}));}if(avatar&&prioritizeAvatar){var avatarProps={imageProps:imageProps,size:size,avatar:avatar};if(props.renderAvatar)return props.renderAvatar(avatarProps);if(props.renderAvatar===null)return null;return React.createElement(AvatarComponent,_extends({},avatarProps,{__source:{fileName:_jsxFileName,lineNumber:194}}));}var initialProps={initials:initials,size:size,textStyle:textStyle,containerStyle:initialsContainerStyle,textColor:props.initialsTextColor,backgroundColor:props.initialsBackgroundColor};if(props.renderInitials)return props.renderInitials(initialProps);if(props.renderInitials===null)return null;return React.createElement(InitialsComponent,_extends({},initialProps,{__source:{fileName:_jsxFileName,lineNumber:209}}));}function typingIndicator(){if(props.renderTypingIndicator)return props.renderTypingIndicator();if(props.renderTypingIndicator===null)return null;return React.createElement(View,{style:{marginTop:5},__source:{fileName:_jsxFileName,lineNumber:217}},React.createElement(TypingIndicator,{__source:{fileName:_jsxFileName,lineNumber:218}}));}var renderTypingIndicator=useCallback(typingIndicator,[props.renderTypingIndicator]);var unreadIndicatorIsOnRight=!!(props.showTypingIndicator&&props.unreadIndicatorPosition&&props.unreadIndicatorPosition.includes('right'));var flexDirection=unreadIndicatorIsOnRight?'row-reverse':'row';var paddingLeft=props.showUnreadIndicator?5:10;var swipeableProps={id:props.id,rightActions:props.swipeRightActions,leftActions:props.swipeLeftActions,renderAction:props.renderSwipeAction,actionWidth:props.swipeActionWidth,gestureHandlerProps:props.swipeableRowProps,renderLeftActions:props.renderLeftActions,renderRightActions:props.renderRightActions,textStyle:props.actionTextStyle};var ContainerComponent=props.swipeable?Swipeable:View;return React.createElement(ContainerComponent,_extends({},swipeableProps,{__source:{fileName:_jsxFileName,lineNumber:253}}),React.createElement(RectButton,{onPress:props.onPress,style:{backgroundColor:props.backgroundColor},__source:{fileName:_jsxFileName,lineNumber:254}},React.createElement(View,{style:[_objectSpread({paddingLeft:paddingLeft},styles.container,{},props.containerStyle||{}),{flexDirection:flexDirection}],__source:{fileName:_jsxFileName,lineNumber:258}},renderUnreadIndicator(),React.createElement(View,{style:[styles.wrapper],__source:{fileName:_jsxFileName,lineNumber:269}},renderAvatarOrInitials(),React.createElement(View,{style:styles.inner,__source:{fileName:_jsxFileName,lineNumber:271}},React.createElement(View,{style:styles.content,__source:{fileName:_jsxFileName,lineNumber:272}},renderTitle(),renderDate()),renderSubtitle())))));}export default React.memo(Item);var styles=StyleSheet.create({container:{flexDirection:'row',paddingVertical:10,justifyContent:'center',marginBottom:5,paddingRight:10},wrapper:{flex:1,flexDirection:'row'},content:{flexDirection:'row',justifyContent:'space-between'},inner:{flex:1,paddingLeft:10}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","useCallback","useRef","RectButton","View","StyleSheet","Title","ItemDate","UnreadIndicator","Subtitle","Avatar","Initials","Swipeable","TypingIndicator","Item","props","renderCount","current","renderTitle","name","TitleComponent","titleStyle","titleContainerStyle","renderDate","lastMessageCreatedAt","DateComponent","dateToStringFunc","dateStyle","renderUnreadIndicator","showUnreadIndicator","position","unreadIndicatorPosition","includes","split","backgroundColor","unreadIndicatorColor","indicatorProps","unreadCount","textColor","unreadTextColor","showCount","showUnreadIndicatorCount","backgroundStyle","unreadIndicatorStyle","textStyle","unreadIndicatorTextStyle","type","unreadIndicatorType","gradientProps","unreadIndicatorGradientProps","colors","show","size","unreadIndicatorSize","UnreadIndicatorComponent","renderSubtitle","showTypingIndicator","numberOfPeopleTyping","renderTypingIndicator","lastMessageText","SubtitleComponent","subtitleTextStyle","renderAvatarOrInitials","disableAvatar","avatar","initials","prioritizeAvatar","prioritizeAvatarOverInitials","avatarSize","imageProps","avatarImageProps","initialsTextStyle","initialsContainerStyle","InitialsComponent","AvatarComponent","Array","isArray","map","member","i","avatarProps","renderAvatar","initialsProps","containerStyle","initialsTextColor","initialsBackgroundColor","renderInitials","initialProps","toString","typingIndicator","marginTop","unreadIndicatorIsOnRight","flexDirection","paddingLeft","swipeableProps","id","rightActions","swipeRightActions","leftActions","swipeLeftActions","renderAction","renderSwipeAction","actionWidth","swipeActionWidth","gestureHandlerProps","swipeableRowProps","renderLeftActions","renderRightActions","actionTextStyle","ContainerComponent","swipeable","onPress","styles","container","wrapper","inner","content","memo","create","paddingVertical","justifyContent","marginBottom","paddingRight","flex"],"mappings":"4/BAAA,MAAOA,CAAAA,KAAP,EAAgBC,WAAhB,CAA6BC,MAA7B,KAA2C,OAA3C,CACA,OAASC,UAAT,KAA2B,8BAA3B,CACA,OAASC,IAAT,CAAeC,UAAf,KAAiC,cAAjC,CACA,MAAOC,CAAAA,KAAP,KAAkB,SAAlB,CACA,MAAOC,CAAAA,QAAP,KAAqB,YAArB,CAQA,MAAOC,CAAAA,eAAP,KAA4B,mBAA5B,CACA,MAAOC,CAA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,cAAc,EALhB,CAFD,CAXD,CAJD,CADD,CADD,CA+BA,CAED,cAAevD,CAAAA,KAAK,CAACqH,IAAN,CAAWvG,IAAX,CAAf,CAEA,GAAMkG,CAAAA,MAAM,CAAG3G,UAAU,CAACiH,MAAX,CAAkB,CAChCL,SAAS,CAAE,CACVrB,aAAa,CAAE,KADL,CAEV2B,eAAe,CAAE,EAFP,CAGVC,cAAc,CAAE,QAHN,CAIVC,YAAY,CAAE,CAJJ,CAKVC,YAAY,CAAE,EALJ,CADqB,CAQhCR,OAAO,CAAE,CACRS,IAAI,CAAE,CADE,CAER/B,aAAa,CAAE,KAFP,CARuB,CAYhCwB,OAAO,CAAE,CACRxB,aAAa,CAAE,KADP,CAER4B,cAAc,CAAE,eAFR,CAZuB,CAgBhCL,KAAK,CAAE,CACNQ,IAAI,CAAE,CADA,CAEN9B,WAAW,CAAE,EAFP,CAhByB,CAAlB,CAAf","sourcesContent":["import React, { useCallback, useRef } from 'react'\nimport { RectButton } from 'react-native-gesture-handler'\nimport { View, StyleSheet } from 'react-native'\nimport Title from './Title'\nimport ItemDate from './ItemDate'\nimport {\n\tInboxItemProps,\n\tInitialsProps,\n\tSwipeableProps,\n\tUnreadIndicatorProps\n} from '../types'\nimport { ExistingRoomModel } from '../../../classes/Room/types'\nimport UnreadIndicator from './UnreadIndicator'\nimport Subtitle from './Subtitle'\nimport Avatar from '../../Avatar'\nimport Initials from './Initials'\nimport Swipeable from './Swipeable/index'\nimport TypingIndicator from '../../TypingIndicator'\n\nfunction Item<InboxItem extends ExistingRoomModel = ExistingRoomModel>(\n\tprops: InboxItemProps<InboxItem>\n) {\n\tconst renderCount = useRef(1)\n\trenderCount.current++\n\tfunction renderTitle() {\n\t\tif (props.renderTitle) return props.renderTitle(props.name)\n\t\tif (props.renderTitle === null) return null\n\n\t\tconst TitleComponent = props.TitleComponent || Title\n\n\t\treturn (\n\t\t\t<TitleComponent\n\t\t\t\ttitle={props.name}\n\t\t\t\tstyle={props.titleStyle}\n\t\t\t\tcontainerStyle={props.titleContainerStyle}\n\t\t\t/>\n\t\t)\n\t}\n\tfunction renderDate() {\n\t\tif (props.renderDate) return props.renderDate(props.lastMessageCreatedAt)\n\t\tif (props.renderDate === null) return null\n\n\t\tconst DateComponent = props.DateComponent || ItemDate\n\n\t\treturn (\n\t\t\t<DateComponent\n\t\t\t\tdateToStringFunc={props.dateToStringFunc}\n\t\t\t\tdate={props.lastMessageCreatedAt}\n\t\t\t\tstyle={props.dateStyle}\n\t\t\t/>\n\t\t)\n\t}\n\tfunction renderUnreadIndicator() {\n\t\tif (!props.showUnreadIndicator) return null\n\n\t\tlet position = 'center' as UnreadIndicatorProps['position']\n\t\tif (\n\t\t\tprops.unreadIndicatorPosition &&\n\t\t\tprops.unreadIndicatorPosition.includes('-')\n\t\t) {\n\t\t\t// ex: turn bottom-left into bottom\n\t\t\t// why? this component is only concerned w vertical position\n\t\t\tposition = props.unreadIndicatorPosition.split(\n\t\t\t\t'-'\n\t\t\t)[0] as UnreadIndicatorProps['position']\n\t\t}\n\n\t\tconst backgroundColor = props.unreadIndicatorColor || 'blue'\n\n\t\tconst indicatorProps: UnreadIndicatorProps = {\n\t\t\tunreadCount: props.unreadCount,\n\t\t\ttextColor: props.unreadTextColor,\n\t\t\tshowCount: props.showUnreadIndicatorCount,\n\t\t\tbackgroundStyle: props.unreadIndicatorStyle,\n\t\t\ttextStyle: props.unreadIndicatorTextStyle,\n\t\t\tposition,\n\t\t\tbackgroundColor,\n\t\t\ttype: props.unreadIndicatorType || 'gradient',\n\t\t\tgradientProps: props.unreadIndicatorGradientProps || {\n\t\t\t\tcolors: ['red', 'blue']\n\t\t\t},\n\t\t\tshow: props.showUnreadIndicator,\n\t\t\tsize: props.unreadIndicatorSize\n\t\t}\n\n\t\tif (props.renderUnreadIndicator)\n\t\t\treturn props.renderUnreadIndicator(indicatorProps)\n\t\tif (props.renderUnreadIndicator === null) return null\n\n\t\tconst UnreadIndicatorComponent =\n\t\t\tprops.UnreadIndicatorComponent || UnreadIndicator\n\n\t\treturn <UnreadIndicatorComponent {...indicatorProps} />\n\t}\n\tfunction renderSubtitle() {\n\t\tif (props.renderSubtitle === null) return null\n\t\tif (props.showTypingIndicator && props.numberOfPeopleTyping)\n\t\t\treturn renderTypingIndicator()\n\n\t\tif (props.renderSubtitle) return props.renderSubtitle(props.lastMessageText)\n\n\t\tconst SubtitleComponent = props.SubtitleComponent || Subtitle\n\n\t\treturn (\n\t\t\t<SubtitleComponent\n\t\t\t\ttextStyle={props.subtitleTextStyle}\n\t\t\t\tlastMessageText={props.lastMessageText}\n\t\t\t/>\n\t\t)\n\t}\n\n\t// function renderAvatarOrInitials() {\n\t// \t// not destructuring for clarity of where the variables come from\n\t// \tconst avatar = props.avatar\n\t// \tconst prioritizeAvatar = props.prioritizeAvatarOverInitials\n\t// \tconst size = props.avatarSize\n\t// \tconst members = props.members\n\n\t// \tif (avatar && prioritizeAvatar) {\n\t// \t\tconst imageProps = props.avatarImageProps\n\t// \t\tif (props.renderAvatar)\n\t// \t\t\tprops.renderAvatar({ imageProps, size, avatar, members })\n\t// \t\tif (props.renderAvatar === null) return null\n\n\t// \t\tconst AvatarComponent = props.AvatarComponent || Avatar\n\n\t// \t\treturn <AvatarComponent {...imageProps} size={size} avatar={avatar} />\n\t// \t}\n\t// }\n\n\tfunction renderAvatarOrInitials() {\n\t\tif (props.disableAvatar) return null\n\n\t\tconst avatar = props.avatar\n\t\tconst initials = props.initials\n\t\tconst prioritizeAvatar = props.prioritizeAvatarOverInitials !== false\n\t\tlet size = props.avatarSize || 55\n\t\tconst imageProps = props.avatarImageProps\n\t\tconst textStyle = props.initialsTextStyle\n\t\tconst initialsContainerStyle = props.initialsContainerStyle\n\n\t\tconst InitialsComponent = props.InitialsComponent || Initials\n\t\tconst AvatarComponent = props.AvatarComponent || Avatar\n\n\t\tif (Array.isArray(avatar)) {\n\t\t\tsize /= 2\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t{avatar.map((member, i) => {\n\t\t\t\t\t\tif (member.avatar && prioritizeAvatar) {\n\t\t\t\t\t\t\tconst avatarProps = {\n\t\t\t\t\t\t\t\timageProps,\n\t\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\t\tavatar: member.avatar\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (props.renderAvatar) return props.renderAvatar(avatarProps)\n\t\t\t\t\t\t\tif (props.renderAvatar === null) return null\n\n\t\t\t\t\t\t\treturn <AvatarComponent {...avatarProps} />\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst initialsProps: InitialsProps = {\n\t\t\t\t\t\t\ttextStyle,\n\t\t\t\t\t\t\tcontainerStyle: initialsContainerStyle,\n\t\t\t\t\t\t\tinitials,\n\t\t\t\t\t\t\tsize,\n\t\t\t\t\t\t\ttextColor: props.initialsTextColor,\n\t\t\t\t\t\t\tbackgroundColor: props.initialsBackgroundColor\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (props.renderInitials) return props.renderInitials(initialProps)\n\t\t\t\t\t\tif (props.renderInitials === null) return null\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<InitialsComponent\n\t\t\t\t\t\t\t\tkey={initials + i.toString()}\n\t\t\t\t\t\t\t\t{...initialsProps}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\n\t\t\t\t</>\n\t\t\t)\n\t\t}\n\n\t\tif (avatar && prioritizeAvatar) {\n\t\t\tconst avatarProps = {\n\t\t\t\timageProps,\n\t\t\t\tsize,\n\t\t\t\tavatar\n\t\t\t}\n\t\t\tif (props.renderAvatar) return props.renderAvatar(avatarProps)\n\t\t\tif (props.renderAvatar === null) return null\n\n\t\t\treturn <AvatarComponent {...avatarProps} />\n\t\t}\n\n\t\tconst initialProps: InitialsProps = {\n\t\t\tinitials,\n\t\t\tsize,\n\t\t\ttextStyle,\n\t\t\tcontainerStyle: initialsContainerStyle,\n\t\t\ttextColor: props.initialsTextColor,\n\t\t\tbackgroundColor: props.initialsBackgroundColor\n\t\t}\n\n\t\tif (props.renderInitials) return props.renderInitials(initialProps)\n\t\tif (props.renderInitials === null) return null\n\n\t\treturn <InitialsComponent {...initialProps} />\n\t}\n\n\tfunction typingIndicator() {\n\t\tif (props.renderTypingIndicator) return props.renderTypingIndicator()\n\t\tif (props.renderTypingIndicator === null) return null\n\n\t\treturn (\n\t\t\t<View style={{ marginTop: 5 }}>\n\t\t\t\t<TypingIndicator />\n\t\t\t</View>\n\t\t)\n\t}\n\n\tconst renderTypingIndicator = useCallback(typingIndicator, [\n\t\tprops.renderTypingIndicator\n\t])\n\n\tconst unreadIndicatorIsOnRight = !!(\n\t\tprops.showTypingIndicator &&\n\t\tprops.unreadIndicatorPosition &&\n\t\tprops.unreadIndicatorPosition.includes('right')\n\t)\n\n\tconst flexDirection = unreadIndicatorIsOnRight ? 'row-reverse' : 'row'\n\n\t// if row-reverse, this flips to the other side\n\tconst paddingLeft = props.showUnreadIndicator ? 5 : 10\n\n\tconst swipeableProps: SwipeableProps = {\n\t\tid: props.id,\n\t\trightActions: props.swipeRightActions,\n\t\tleftActions: props.swipeLeftActions,\n\t\trenderAction: props.renderSwipeAction,\n\t\tactionWidth: props.swipeActionWidth,\n\t\tgestureHandlerProps: props.swipeableRowProps,\n\t\trenderLeftActions: props.renderLeftActions,\n\t\trenderRightActions: props.renderRightActions,\n\t\ttextStyle: props.actionTextStyle\n\t}\n\n\tconst ContainerComponent = props.swipeable ? Swipeable : View\n\n\treturn (\n\t\t<ContainerComponent {...swipeableProps}>\n\t\t\t<RectButton\n\t\t\t\tonPress={props.onPress}\n\t\t\t\tstyle={{ backgroundColor: props.backgroundColor }}\n\t\t\t>\n\t\t\t\t<View\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpaddingLeft,\n\t\t\t\t\t\t\t...styles.container,\n\t\t\t\t\t\t\t...(props.containerStyle || {})\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ flexDirection }\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{renderUnreadIndicator()}\n\t\t\t\t\t<View style={[styles.wrapper]}>\n\t\t\t\t\t\t{renderAvatarOrInitials()}\n\t\t\t\t\t\t<View style={styles.inner}>\n\t\t\t\t\t\t\t<View style={styles.content}>\n\t\t\t\t\t\t\t\t{renderTitle()}\n\t\t\t\t\t\t\t\t{renderDate()}\n\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t{renderSubtitle()}\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\t\t\t</RectButton>\n\t\t</ContainerComponent>\n\t)\n}\n\nexport default React.memo(Item)\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tflexDirection: 'row',\n\t\tpaddingVertical: 10,\n\t\tjustifyContent: 'center',\n\t\tmarginBottom: 5,\n\t\tpaddingRight: 10\n\t},\n\twrapper: {\n\t\tflex: 1,\n\t\tflexDirection: 'row'\n\t},\n\tcontent: {\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'space-between'\n\t},\n\tinner: {\n\t\tflex: 1,\n\t\tpaddingLeft: 10\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/index.tsx";import React,{useRef,useEffect}from'react';import{Animated,StyleSheet,SafeAreaView}from'react-native';import Item from'./Item';import Room from'../../classes/Room';import{getInitials}from'../../helpers/getInitials';import Separator from'./Item/Separator';import Reanimated,{Transitioning,Transition}from'react-native-reanimated';export default function(props){var transitionRef=useRef(null);var numberOfRoomsWithUsersTyping=(props.rooms||[]).filter(function(room){return new Room(room).getUsersTyping().length;}).length;useEffect(function(){if(props.enableRoomTransitions!==false&&transitionRef.current)transitionRef.current.animateNextTransition();},[props.rooms,props.enableRoomTransitions,numberOfRoomsWithUsersTyping]);var scrollY=props.animatedScrollNode||new Animated.Value(0);var onScroll=Animated.event([{nativeEvent:{contentOffset:{y:scrollY}}}],{useNativeDriver:true});function renderList(){function keyExtractor(item,index){return props.keyExtractor?props.keyExtractor(item,index):item&&item.id||index.toString();}return React.createElement(Animated.FlatList,_extends({onScroll:onScroll,extraData:props.extraData,contentContainerStyle:styles.contentContainer,ItemSeparatorComponent:function ItemSeparatorComponent(){return React.createElement(Separator,{size:props.separatorSize,color:props.separatorColor,__source:{fileName:_jsxFileName,lineNumber:61}});}},props.flatListProps,{keyExtractor:keyExtractor,renderItem:renderItem,data:props.rooms,__source:{fileName:_jsxFileName,lineNumber:56}}));}function renderHeader(){var headerProps={scrollY:scrollY,big:props.bigHeader!==false,onPressNewRoom:props.onPressNewRoom};if(props.renderHeader)return props.renderHeader(headerProps);if(props.renderHeader===null)return null;var HeaderComponent=props.HeaderComponent||Animated.View;return React.createElement(HeaderComponent,_extends({},headerProps,{__source:{fileName:_jsxFileName,lineNumber:83}}));}function renderFooter(){var footerProps={scrollY:scrollY};if(props.renderFooter)return props.renderFooter(footerProps);if(props.renderFooter===null)return null;var FooterComponent=props.FooterComponent||Animated.View;return React.createElement(FooterComponent,_extends({},footerProps,{__source:{fileName:_jsxFileName,lineNumber:97}}));}function renderItem(itemInfo){if(props.renderItem===null)return null;if(props.renderItem)return props.renderItem(itemInfo);var maxNumberOfInitials=props.maxNumberOfInitials||2;var _itemInfo$item=itemInfo.item,lastMessage=_itemInfo$item.lastMessage,members=_itemInfo$item.members,id=_itemInfo$item.id,_itemInfo$item$unread=_itemInfo$item.unreadCount,unreadCount=_itemInfo$item$unread===void 0?0:_itemInfo$item$unread,_itemInfo$item$name=_itemInfo$item.name,roomName=_itemInfo$item$name===void 0?'':_itemInfo$item$name;var room=new Room({members:members,id:id,name:roomName});var name=props.roomNameFunc?props.roomNameFunc({members:members,name:roomName}):room.getName();var roomAvatar=itemInfo.item.avatar;var avatar=roomAvatar||'';var initials=props.roomInitialsFunc?props.roomInitialsFunc({members:members,name:name,maxNumberOfInitials:maxNumberOfInitials}):room.getInitials(maxNumberOfInitials);var otherMembers=room.getArrayOfMembersOtherThanMe();if(props.prioritizeAvatarOverInitials&&!roomName){if(!avatar&&otherMembers.length===1&&otherMembers[0]){avatar=otherMembers[0]&&otherMembers[0].avatar||'';}if(otherMembers.length>1&&!roomAvatar&&props.fallbackToMultipleAvatarsIfNoGroupAvatar!==false){avatar=otherMembers.map(function(member){return{initials:getInitials(member.name,props.maxNumberOfInitials),avatar:member.avatar||''};}).sort(function(a,b){return a.avatar>b.avatar?1:-1;});}}var onPress=function onPress(pointerInside){return props.onPressItem?props.onPressItem(id,pointerInside):console.log(id,'pressed. change onPressItem prop on the <Inbox /> component to handle this function.');};var onLongPress=function onLongPress(pointerInside){return props.onLongPressItem?props.onLongPressItem(id,pointerInside):console.log('long pressed ',id,'edit onLongPressItem prop to handle this function');};var itemProps={lastMessageCreatedAt:lastMessage.createdAt,lastMessageText:lastMessage.text,avatar:avatar,name:name,initials:initials,onPress:onPress,unreadCount:unreadCount,renderTitle:props.renderItemTitle,renderDate:props.renderItemDate,TitleComponent:props.ItemTitleComponent,titleStyle:props.titleStyle,titleContainerStyle:props.titleContainerStyle,DateComponent:props.ItemDateComponent,unreadIndicatorColor:props.unreadIndicatorColor,unreadTextColor:props.unreadTextColor,showUnreadIndicator:props.showUnreadIndicator!==false,showUnreadIndicatorCount:props.showUnreadIndicatorCount!==false,UnreadIndicatorComponent:props.UnreadIndicatorComponent,renderUnreadIndicator:props.renderUnreadIndicator,unreadIndicatorStyle:props.unreadIndicatorStyle,unreadIndicatorTextStyle:props.unreadIndicatorTextStyle,unreadIndicatorPosition:props.unreadIndicatorPostion,dateToStringFunc:props.dateToStringFunc,onLongPress:onLongPress,prioritizeAvatarOverInitials:props.prioritizeAvatarOverInitials!==false,renderAvatar:props.renderAvatar,renderInitials:props.renderInitials,renderSubtitle:props.renderItemSubtitle,SubtitleComponent:props.ItemSubtitleComponent,subtitleTextStyle:props.itemSubtitleTextStyle,AvatarComponent:props.ItemAvatarComponent,InitialsComponent:props.ItemInitialsComponent,roomInitialsFunc:props.roomInitialsFunc,avatarImageProps:props.avatarImageProps,avatarSize:props.avatarSize,initialsContainerStyle:props.initialsContainerStyle,initialsTextStyle:props.initialsTextStyle,disableAvatar:props.disableAvatar,initialsBackgroundColor:props.initialsBackgroundColor,initialsTextColor:props.initialsTextColor,swipeable:props.swipeableRow!==false,id:id,renderSwipeAction:props.renderSwipeAction,swipeLeftActions:props.swipeLeftActions,swipeRightActions:props.swipeRightActions,swipeActionWidth:props.swipeActionWidth,backgroundColor:props.itemBackgroundColor||'white',swipeableRowProps:props.swipeableRowProps,unreadIndicatorType:props.unreadIndicatorType,unreadIndicatorGradientProps:props.unreadIndicatorGradientProps,unreadIndicatorSize:props.unreadIndicatorSize,containerStyle:props.itemContainerStyle,dateStyle:props.dateStyle,renderLeftActions:props.renderLeftActions,renderRightActions:props.renderRightActions,actionTextStyle:props.actionTextStyle,showTypingIndicator:props.showTypingIndicator!==false,renderTypingIndicator:props.renderTypingIndicator,numberOfPeopleTyping:room.getUsersTyping().length};if(props.renderItemWithProps)return props.renderItemWithProps(itemProps);var InboxItemComponent=props.InboxItemComponent||Item;return React.createElement(InboxItemComponent,_extends({},itemProps,{__source:{fileName:_jsxFileName,lineNumber:269}}));}var Container=props.ContainerComponent||(props.safeArea?Reanimated.createAnimatedComponent(SafeAreaView):Reanimated.View);var containerStyles=[styles.container,props.containerStyle];var transition=props.roomTransitionConfig||React.createElement(Transition.Together,{__source:{fileName:_jsxFileName,lineNumber:284}},React.createElement(Transition.Change,{interpolation:"easeInOut",durationMs:400,propagation:"top",__source:{fileName:_jsxFileName,lineNumber:285}}));return React.createElement(Transitioning.View,{transition:transition,ref:transitionRef,style:containerStyles,__source:{fileName:_jsxFileName,lineNumber:294}},React.createElement(Container,{style:containerStyles,__source:{fileName:_jsxFileName,lineNumber:299}},renderHeader(),renderList(),renderFooter()));}var styles=StyleSheet.create({container:{flex:1},contentContainer:{flexGrow:1}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","useRef","useEffect","Animated","StyleSheet","SafeAreaView","Item","Room","getInitials","Separator","Reanimated","Transitioning","Transition","props","transitionRef","numberOfRoomsWithUsersTyping","rooms","filter","room","getUsersTyping","length","enableRoomTransitions","current","animateNextTransition","scrollY","animatedScrollNode","Value","onScroll","event","nativeEvent","contentOffset","y","useNativeDriver","renderList","keyExtractor","item","index","id","toString","extraData","styles","contentContainer","separatorSize","separatorColor","flatListProps","renderItem","renderHeader","headerProps","big","bigHeader","onPressNewRoom","HeaderComponent","View","renderFooter","footerProps","FooterComponent","itemInfo","maxNumberOfInitials","lastMessage","members","unreadCount","name","roomName","roomNameFunc","getName","roomAvatar","avatar","initials","roomInitialsFunc","otherMembers","getArrayOfMembersOtherThanMe","prioritizeAvatarOverInitials","fallbackToMultipleAvatarsIfNoGroupAvatar","map","member","sort","a","b","onPress","pointerInside","onPressItem","console","log","onLongPress","onLongPressItem","itemProps","lastMessageCreatedAt","createdAt","lastMessageText","text","renderTitle","renderItemTitle","renderDate","renderItemDate","TitleComponent","ItemTitleComponent","titleStyle","titleContainerStyle","DateComponent","ItemDateComponent","unreadIndicatorColor","unreadTextColor","showUnreadIndicator","showUnreadIndicatorCount","UnreadIndicatorComponent","renderUnreadIndicator","unreadIndicatorStyle","unreadIndicatorTextStyle","unreadIndicatorPosition","unreadIndicatorPostion","dateToStringFunc","renderAvatar","renderInitials","renderSubtitle","renderItemSubtitle","SubtitleComponent","ItemSubtitleComponent","subtitleTextStyle","itemSubtitleTextStyle","AvatarComponent","ItemAvatarComponent","InitialsComponent","ItemInitialsComponent","avatarImageProps","avatarSize","initialsContainerStyle","initialsTextStyle","disableAvatar","initialsBackgroundColor","initialsTextColor","swipeable","swipeableRow","renderSwipeAction","swipeLeftActions","swipeRightActions","swipeActionWidth","backgroundColor","itemBackgroundColor","swipeableRowProps","unreadIndicatorType","unreadIndicatorGradientProps","unreadIndicatorSize","containerStyle","itemContainerStyle","dateStyle","renderLeftActions","renderRightActions","actionTextStyle","showTypingIndicator","renderTypingIndicator","numberOfPeopleTyping","renderItemWithProps","InboxItemComponent","Container","ContainerComponent","safeArea","createAnimatedComponent","containerStyles","container","transition","roomTransitionConfig","create","flex","flexGrow"],"mappings":"wJAAA,MAAOA,CAAAA,KAAP,EAAgBC,MAAhB,CAAwBC,SAAxB,KAAyC,OAAzC,CACA,OACCC,QADD,CAGCC,UAHD,CAICC,YAJD,KAKO,cALP,CAQA,MAAOC,CAAAA,IAAP,KAAiB,QAAjB,CACA,MAAOC,CAAAA,IAAP,KAAiB,oBAAjB,CACA,OAASC,WAAT,KAA4B,2BAA5B,CACA,MAAOC,CAAAA,SAAP,KAAsB,kBAAtB,CACA,MAAOC,CAAAA,UAAP,EACCC,aADD,CAECC,UAFD,KAIO,yBAJP,CAMA,cAAe,UACdC,KADc,CAEb,CAID,GAAMC,CAAAA,aAAa,CAAGb,MAAM,CAAoB,IAApB,CAA5B,CAEA,GAAMc,CAAAA,4BAA4B,CAAG,CAACF,KAAK,CAACG,KAAN,EAAe,EAAhB,EAAoBC,MAApB,CACpC,SAAAC,IAAI,QAAI,IAAIX,CAAAA,IAAJ,CAASW,IAAT,EAAeC,cAAf,GAAgCC,MAApC,EADgC,EAEnCA,MAFF,CAIAlB,SAAS,CAAC,UAAM,CACf,GAAIW,KAAK,CAACQ,qBAAN,GAAgC,KAAhC,EAAyCP,aAAa,CAACQ,OAA3D,CACCR,aAAa,CAACQ,OAAd,CAAsBC,qBAAtB,GACD,CAHQ,CAGN,CAACV,KAAK,CAACG,KAAP,CAAcH,KAAK,CAACQ,qBAApB,CAA2CN,4BAA3C,CAHM,CAAT,CAMA,GAAMS,CAAAA,OAAuB,CAC5BX,KAAK,CAACY,kBAAN,EAA4B,GAAItB,CAAAA,QAAQ,CAACuB,KAAb,CAAmB,CAAnB,CAD7B,CAIA,GAAMC,CAAAA,QAAQ,CAAGxB,QAAQ,CAACyB,KAAT,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C6I,kBAAN,GACC7I,KAAK,CAAC8I,QAAN,CACEjJ,UAAU,CAACkJ,uBAAX,CAAmCvJ,YAAnC,CADF,CAEEK,UAAU,CAAC0C,IAHd,CADD,CAKA,GAAMyG,CAAAA,eAAe,CAAG,CAACrH,MAAM,CAACsH,SAAR,CAAmBjJ,KAAK,CAACiI,cAAzB,CAAxB,CAGA,GAAMiB,CAAAA,UAEmB,CAAGlJ,KAAK,CAACmJ,oBAAN,EAC3B,oBAAC,UAAD,CAAY,QAAZ,mDACC,oBAAC,UAAD,CAAY,MAAZ,EACC,aAAa,CAAC,WADf,CAEC,UAAU,CAAE,GAFb,CAGC,WAAW,CAAC,KAHb,kDADD,CAHD,CAYA,MACC,qBAAC,aAAD,CAAe,IAAf,EACC,UAAU,CAAED,UADb,CAEC,GAAG,CAAEjJ,aAFN,CAGC,KAAK,CAAE+I,eAHR,kDAKC,oBAAC,SAAD,EAAW,KAAK,CAAEA,eAAlB,kDACE/G,YAAY,EADd,CAEEb,UAAU,EAFZ,CAGEoB,YAAY,EAHd,CALD,CADD,CAaA,CAED,GAAMb,CAAAA,MAAM,CAAGpC,UAAU,CAAC6J,MAAX,CAAkB,CAChCH,SAAS,CAAE,CACVI,IAAI,CAAE,CADI,CADqB,CAIhCzH,gBAAgB,CAAE,CACjB0H,QAAQ,CAAE,CADO,CAJc,CAAlB,CAAf","sourcesContent":["import React, { useRef, useEffect } from 'react'\nimport {\n\tAnimated,\n\tListRenderItemInfo,\n\tStyleSheet,\n\tSafeAreaView\n} from 'react-native'\nimport InboxProps, { InboxMethodProps, InboxItemProps } from './types'\nimport { ExistingRoomModel } from '../../classes/Room/types'\nimport Item from './Item'\nimport Room from '../../classes/Room'\nimport { getInitials } from '../../helpers/getInitials'\nimport Separator from './Item/Separator'\nimport Reanimated, {\n\tTransitioning,\n\tTransition,\n\tTransitioningView\n} from 'react-native-reanimated'\n\nexport default function<InboxItem extends ExistingRoomModel>(\n\tprops: InboxProps<InboxItem>\n) {\n\t// \"constructor\" variables\n\n\t// used to shuffle/transition the inbox when it changes\n\tconst transitionRef = useRef<TransitioningView>(null)\n\n\tconst numberOfRoomsWithUsersTyping = (props.rooms || []).filter(\n\t\troom => new Room(room).getUsersTyping().length\n\t).length\n\n\tuseEffect(() => {\n\t\tif (props.enableRoomTransitions !== false && transitionRef.current)\n\t\t\ttransitionRef.current.animateNextTransition()\n\t}, [props.rooms, props.enableRoomTransitions, numberOfRoomsWithUsersTyping])\n\n\t// track animated position of scroll\n\tconst scrollY: Animated.Value =\n\t\tprops.animatedScrollNode || new Animated.Value(0)\n\n\t// upate position of scroll variable\n\tconst onScroll = Animated.event(\n\t\t[{ nativeEvent: { contentOffset: { y: scrollY } } }],\n\t\t{ useNativeDriver: true }\n\t)\n\n\t// render room list\n\tfunction renderList() {\n\t\t// give a unique key to each item (flatlist prop)\n\t\tfunction keyExtractor(item: InboxItem, index: number) {\n\t\t\treturn props.keyExtractor\n\t\t\t\t? props.keyExtractor(item, index)\n\t\t\t\t: (item && item.id) || index.toString()\n\t\t}\n\t\treturn (\n\t\t\t<Animated.FlatList\n\t\t\t\tonScroll={onScroll}\n\t\t\t\textraData={props.extraData}\n\t\t\t\tcontentContainerStyle={styles.contentContainer}\n\t\t\t\tItemSeparatorComponent={() => (\n\t\t\t\t\t<Separator size={props.separatorSize} color={props.separatorColor} />\n\t\t\t\t)}\n\t\t\t\t{...props.flatListProps}\n\t\t\t\tkeyExtractor={keyExtractor}\n\t\t\t\trenderItem={renderItem}\n\t\t\t\tdata={props.rooms}\n\t\t\t/>\n\t\t)\n\t}\n\n\t// optionally render header\n\tfunction renderHeader() {\n\t\tconst headerProps: InboxMethodProps<InboxItem>['renderHeader'] = {\n\t\t\tscrollY,\n\t\t\tbig: props.bigHeader !== false,\n\t\t\tonPressNewRoom: props.onPressNewRoom\n\t\t}\n\t\tif (props.renderHeader) return props.renderHeader(headerProps)\n\t\tif (props.renderHeader === null) return null\n\n\t\tconst HeaderComponent = props.HeaderComponent || Animated.View\n\n\t\treturn <HeaderComponent {...headerProps} />\n\t}\n\n\t// optionally render footer\n\tfunction renderFooter() {\n\t\tconst footerProps: InboxMethodProps<InboxItem>['renderFooter'] = {\n\t\t\tscrollY\n\t\t}\n\n\t\tif (props.renderFooter) return props.renderFooter(footerProps)\n\t\tif (props.renderFooter === null) return null\n\n\t\tconst FooterComponent = props.FooterComponent || Animated.View\n\n\t\treturn <FooterComponent {...footerProps} />\n\t}\n\n\t// flatlist methods\n\n\t// render each room item\n\tfunction renderItem(itemInfo: ListRenderItemInfo<InboxItem>) {\n\t\t// not sure why you'd wanna return null, but just in case...\n\t\tif (props.renderItem === null) return null\n\t\t// render item raw – without our constructed props\n\t\tif (props.renderItem) return props.renderItem(itemInfo)\n\n\t\tconst maxNumberOfInitials = props.maxNumberOfInitials || 2\n\n\t\tconst {\n\t\t\tlastMessage,\n\t\t\tmembers,\n\t\t\tid,\n\t\t\tunreadCount = 0,\n\t\t\tname: roomName = ''\n\t\t} = itemInfo.item\n\n\t\tconst room = new Room({ members, id, name: roomName })\n\n\t\tconst name = props.roomNameFunc\n\t\t\t? props.roomNameFunc({ members, name: roomName })\n\t\t\t: room.getName()\n\n\t\t// first check for a room avatar\n\t\tconst roomAvatar = itemInfo.item.avatar\n\n\t\t// either one image or an array\n\t\tlet avatar: InboxItemProps<InboxItem>['avatar'] = roomAvatar || ''\n\t\tconst initials: string = props.roomInitialsFunc\n\t\t\t? props.roomInitialsFunc({\n\t\t\t\t\tmembers,\n\t\t\t\t\tname,\n\t\t\t\t\tmaxNumberOfInitials\n\t\t\t })\n\t\t\t: room.getInitials(maxNumberOfInitials)\n\n\t\tconst otherMembers = room.getArrayOfMembersOtherThanMe()\n\n\t\t/*\n\t\t\n\t\t\tThis next block of verbose code concerns itself with \n\t\t\tthe avatar / initials icon \n\t\t\n\t\t*/\n\n\t\t// if the room has no name, and we prefer to show avatars\n\t\t// then we want to get as close as we can to showing the avatar\n\t\tif (props.prioritizeAvatarOverInitials && !roomName) {\n\t\t\t// if there's currently no avatar\n\t\t\t// and only one member\n\t\t\t// then make the avatar that person's picture\n\t\t\tif (!avatar && otherMembers.length === 1 && otherMembers[0]) {\n\t\t\t\tavatar = (otherMembers[0] && otherMembers[0].avatar) || ''\n\t\t\t}\n\t\t\t// alternatively, if there are multiple people,\n\t\t\t// no room avatar,\n\t\t\t// and we want to show multiple avatars as a fallback\n\t\t\tif (\n\t\t\t\totherMembers.length > 1 &&\n\t\t\t\t!roomAvatar &&\n\t\t\t\tprops.fallbackToMultipleAvatarsIfNoGroupAvatar !== false\n\t\t\t) {\n\t\t\t\t// TODO something here is weird, this doesn't make sense\n\n\t\t\t\t// avatar then becomes an array which also includes the initials\n\t\t\t\t// for each member user, an array with this => { avatar, initials }\n\t\t\t\t// then, in the item component, if avatar is prioritized and existent, we render that\n\t\t\t\tavatar = otherMembers\n\t\t\t\t\t.map(member => ({\n\t\t\t\t\t\tinitials: getInitials(member.name, props.maxNumberOfInitials),\n\t\t\t\t\t\tavatar: member.avatar || ''\n\t\t\t\t\t}))\n\t\t\t\t\t.sort((a, b) => (a.avatar > b.avatar ? 1 : -1))\n\t\t\t}\n\t\t\t// 😅 glad that's done\n\t\t}\n\n\t\tconst onPress = (pointerInside?: boolean) =>\n\t\t\tprops.onPressItem\n\t\t\t\t? props.onPressItem(id, pointerInside)\n\t\t\t\t: console.log(\n\t\t\t\t\t\tid,\n\t\t\t\t\t\t'pressed. change onPressItem prop on the <Inbox /> component to handle this function.'\n\t\t\t\t )\n\n\t\tconst onLongPress = (pointerInside?: boolean) =>\n\t\t\tprops.onLongPressItem\n\t\t\t\t? props.onLongPressItem(id, pointerInside)\n\t\t\t\t: console.log(\n\t\t\t\t\t\t'long pressed ',\n\t\t\t\t\t\tid,\n\t\t\t\t\t\t'edit onLongPressItem prop to handle this function'\n\t\t\t\t )\n\n\t\t// well those are some props.\n\t\t// each room receives these\n\t\t// most of them are passed directly from the parent component props\n\t\t// the ones marked <someprop>: props.<someprop> !== false are default true\n\t\tconst itemProps: InboxItemProps<InboxItem> = {\n\t\t\tlastMessageCreatedAt: lastMessage.createdAt,\n\t\t\tlastMessageText: lastMessage.text,\n\t\t\tavatar,\n\t\t\tname,\n\t\t\tinitials,\n\t\t\tonPress,\n\t\t\tunreadCount,\n\t\t\trenderTitle: props.renderItemTitle,\n\t\t\trenderDate: props.renderItemDate,\n\t\t\tTitleComponent: props.ItemTitleComponent,\n\t\t\ttitleStyle: props.titleStyle,\n\t\t\ttitleContainerStyle: props.titleContainerStyle,\n\t\t\tDateComponent: props.ItemDateComponent,\n\t\t\tunreadIndicatorColor: props.unreadIndicatorColor,\n\t\t\tunreadTextColor: props.unreadTextColor,\n\t\t\tshowUnreadIndicator: props.showUnreadIndicator !== false,\n\t\t\tshowUnreadIndicatorCount: props.showUnreadIndicatorCount !== false,\n\t\t\tUnreadIndicatorComponent: props.UnreadIndicatorComponent,\n\t\t\trenderUnreadIndicator: props.renderUnreadIndicator,\n\t\t\tunreadIndicatorStyle: props.unreadIndicatorStyle,\n\t\t\tunreadIndicatorTextStyle: props.unreadIndicatorTextStyle,\n\t\t\tunreadIndicatorPosition: props.unreadIndicatorPostion,\n\t\t\tdateToStringFunc: props.dateToStringFunc,\n\t\t\tonLongPress,\n\t\t\tprioritizeAvatarOverInitials:\n\t\t\t\tprops.prioritizeAvatarOverInitials !== false, // default true\n\t\t\trenderAvatar: props.renderAvatar,\n\t\t\trenderInitials: props.renderInitials,\n\t\t\trenderSubtitle: props.renderItemSubtitle,\n\t\t\tSubtitleComponent: props.ItemSubtitleComponent,\n\t\t\tsubtitleTextStyle: props.itemSubtitleTextStyle,\n\t\t\tAvatarComponent: props.ItemAvatarComponent,\n\t\t\tInitialsComponent: props.ItemInitialsComponent,\n\t\t\troomInitialsFunc: props.roomInitialsFunc,\n\t\t\tavatarImageProps: props.avatarImageProps,\n\t\t\tavatarSize: props.avatarSize,\n\t\t\tinitialsContainerStyle: props.initialsContainerStyle,\n\t\t\tinitialsTextStyle: props.initialsTextStyle,\n\t\t\tdisableAvatar: props.disableAvatar,\n\t\t\tinitialsBackgroundColor: props.initialsBackgroundColor,\n\t\t\tinitialsTextColor: props.initialsTextColor,\n\t\t\tswipeable: props.swipeableRow !== false,\n\t\t\tid,\n\t\t\trenderSwipeAction: props.renderSwipeAction,\n\t\t\tswipeLeftActions: props.swipeLeftActions,\n\t\t\tswipeRightActions: props.swipeRightActions,\n\t\t\tswipeActionWidth: props.swipeActionWidth,\n\t\t\tbackgroundColor: props.itemBackgroundColor || 'white',\n\t\t\tswipeableRowProps: props.swipeableRowProps,\n\t\t\tunreadIndicatorType: props.unreadIndicatorType,\n\t\t\tunreadIndicatorGradientProps: props.unreadIndicatorGradientProps,\n\t\t\tunreadIndicatorSize: props.unreadIndicatorSize,\n\t\t\tcontainerStyle: props.itemContainerStyle,\n\t\t\tdateStyle: props.dateStyle,\n\t\t\trenderLeftActions: props.renderLeftActions,\n\t\t\trenderRightActions: props.renderRightActions,\n\t\t\tactionTextStyle: props.actionTextStyle,\n\t\t\tshowTypingIndicator: props.showTypingIndicator !== false,\n\t\t\trenderTypingIndicator: props.renderTypingIndicator,\n\t\t\tnumberOfPeopleTyping: room.getUsersTyping().length\n\t\t}\n\n\t\t// if you want to use your own renderItem function, but include the props we made\n\t\t// the alternative is a normal props.renderItem() which gets the raw flatlist data\n\t\tif (props.renderItemWithProps) return props.renderItemWithProps(itemProps)\n\n\t\t// custom InboxItem component, or the one we used\n\t\tconst InboxItemComponent = props.InboxItemComponent || Item\n\t\treturn <InboxItemComponent {...itemProps} />\n\t}\n\n\t// component props\n\tconst Container =\n\t\tprops.ContainerComponent ||\n\t\t(props.safeArea\n\t\t\t? Reanimated.createAnimatedComponent(SafeAreaView)\n\t\t\t: Reanimated.View)\n\tconst containerStyles = [styles.container, props.containerStyle]\n\n\t// inbox shuffle transition config\n\tconst transition: InboxProps<\n\t\tInboxItem\n\t>['roomTransitionConfig'] = props.roomTransitionConfig || (\n\t\t<Transition.Together>\n\t\t\t<Transition.Change\n\t\t\t\tinterpolation=\"easeInOut\"\n\t\t\t\tdurationMs={400}\n\t\t\t\tpropagation=\"top\"\n\t\t\t/>\n\t\t</Transition.Together>\n\t)\n\n\treturn (\n\t\t<Transitioning.View\n\t\t\ttransition={transition}\n\t\t\tref={transitionRef}\n\t\t\tstyle={containerStyles}\n\t\t>\n\t\t\t<Container style={containerStyles}>\n\t\t\t\t{renderHeader()}\n\t\t\t\t{renderList()}\n\t\t\t\t{renderFooter()}\n\t\t\t</Container>\n\t\t</Transitioning.View>\n\t)\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tflex: 1\n\t},\n\tcontentContainer: {\n\t\tflexGrow: 1\n\t}\n})\n"]}
@@ -1,21 +0,0 @@
1
- Any idea on how to achieve this fix with react hooks in a function component? Not sure what to do since you can't use `this`.
2
-
3
- I have an `onViewableItemsChanged` function that relies on two outside variables: `messages` and `roomId`. I tried using `useCallback`, but I still get this error, since an updated `messages` array refreshes onViewableItemsChanged.
4
-
5
- **Example:**
6
-
7
- ```javascript
8
- const onViewableItemsChanged = useCallback(
9
- info => {
10
- info.viewableItems.forEach(({ item }) => {
11
- const mostRecentMessage = messages[messages.length - 1]
12
- if (item.id === mostRecentMessage) viewMessage(roomId, item.id)
13
- })
14
- },
15
- [messages, roomId]
16
- )
17
-
18
- ...
19
-
20
- return <FlatList onViewableItemsChanged={onViewableItemsChanged} />
21
- ```
@@ -1,21 +0,0 @@
1
- # Juice Inbox Component
2
-
3
- This react native component is a drop-in for an entire inbox UI.
4
-
5
- It directly integrates with Juice's `useInbox` hook.
6
-
7
- ## Quick example
8
-
9
- This example shows a **fully backend-connected**, **real-time** inbox. 🤯
10
-
11
- ```javascript
12
- import * as React from 'react'
13
- import Juice, { useInbox } from 'usechat'
14
-
15
- export default function() {
16
- const [{ data, loading }] = useInbox()
17
- return <Juice.Inbox rooms={data} onPressItem={id => console.log(id)} />
18
- }
19
- ```
20
-
21
- You can use it with your own backend if you'd like, since it's fully customizable. This component has a ton of props, so everything is extensible. But it was definitely made with `useInbox` in mind.
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,2 +0,0 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/RoomCreator/Content/Footer/Button/index.tsx";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){_defineProperty(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}import React from'react';import{Text,TouchableOpacity,StyleSheet,ActivityIndicator,View}from'react-native';export default(function(props){var background={backgroundColor:props.backgroundColor};return React.createElement(TouchableOpacity,{onPress:props.onPress,style:[styles.button,!props.ready?styles.disabled:props.index>0?styles.second:{},background],__source:{fileName:_jsxFileName,lineNumber:14}},React.createElement(Text,{style:[styles.text,{color:props.textColor}],__source:{fileName:_jsxFileName,lineNumber:22}},props.text),props.loading&&React.createElement(View,{style:[styles.loader,background],__source:{fileName:_jsxFileName,lineNumber:26}},React.createElement(ActivityIndicator,{color:props.textColor,__source:{fileName:_jsxFileName,lineNumber:27}})));});var styles=StyleSheet.create({button:{padding:10,backgroundColor:'blue',alignItems:'center',flex:1},second:{backgroundColor:'hotpink'},disabled:{backgroundColor:'lightgray'},text:{fontWeight:'bold',fontSize:18,color:'white'},loader:_objectSpread({},StyleSheet.absoluteFillObject,{justifyContent:'center',alignItems:'center'})});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","Text","TouchableOpacity","StyleSheet","ActivityIndicator","View","props","background","backgroundColor","onPress","styles","button","ready","disabled","index","second","text","color","textColor","loading","loader","create","padding","alignItems","flex","fontWeight","fontSize","absoluteFillObject","justifyContent"],"mappings":"89BAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OACCC,IADD,CAECC,gBAFD,CAGCC,UAHD,CAICC,iBAJD,CAKCC,IALD,KAMO,cANP,CASA,eAAe,SAACC,KAAD,CAA8B,CAC5C,GAAMC,CAAAA,UAAU,CAAG,CAAEC,eAAe,CAAEF,KAAK,CAACE,eAAzB,CAAnB,CACA,MACC,qBAAC,gBAAD,EACC,OAAO,CAAEF,KAAK,CAACG,OADhB,CAEC,KAAK,CAAE,CACNC,MAAM,CAACC,MADD,CAEN,CAACL,KAAK,CAACM,KAAP,CAAeF,MAAM,CAACG,QAAtB,CAAiCP,KAAK,CAACQ,KAAN,CAAc,CAAd,CAAkBJ,MAAM,CAACK,MAAzB,CAAkC,EAF7D,CAGNR,UAHM,CAFR,iDAQC,oBAAC,IAAD,EAAM,KAAK,CAAE,CAACG,MAAM,CAACM,IAAR,CAAc,CAAEC,KAAK,CAAEX,KAAK,CAACY,SAAf,CAAd,CAAb,iDACEZ,KAAK,CAACU,IADR,CARD,CAWEV,KAAK,CAACa,OAAN,EACA,oBAAC,IAAD,EAAM,KAAK,CAAE,CAACT,MAAM,CAACU,MAAR,CAAgBb,UAAhB,CAAb,iDACC,oBAAC,iBAAD,EAAmB,KAAK,CAAED,KAAK,CAACY,SAAhC,iDADD,CAZF,CADD,CAmBA,CArBD,EAuBA,GAAMR,CAAAA,MAAM,CAAGP,UAAU,CAACkB,MAAX,CAAkB,CAChCV,MAAM,CAAE,CACPW,OAAO,CAAE,EADF,CAEPd,eAAe,CAAE,MAFV,CAGPe,UAAU,CAAE,QAHL,CAIPC,IAAI,CAAE,CAJC,CADwB,CAOhCT,MAAM,CAAE,CAAEP,eAAe,CAAE,SAAnB,CAPwB,CAQhCK,QAAQ,CAAE,CACTL,eAAe,CAAE,WADR,CARsB,CAWhCQ,IAAI,CAAE,CACLS,UAAU,CAAE,MADP,CAELC,QAAQ,CAAE,EAFL,CAGLT,KAAK,CAAE,OAHF,CAX0B,CAgBhCG,MAAM,kBACFjB,UAAU,CAACwB,kBADT,EAELC,cAAc,CAAE,QAFX,CAGLL,UAAU,CAAE,QAHP,EAhB0B,CAAlB,CAAf","sourcesContent":["import React from 'react'\nimport {\n\tText,\n\tTouchableOpacity,\n\tStyleSheet,\n\tActivityIndicator,\n\tView\n} from 'react-native'\nimport { RenderButtonProps } from '../../../types'\n\nexport default (props: RenderButtonProps) => {\n\tconst background = { backgroundColor: props.backgroundColor }\n\treturn (\n\t\t<TouchableOpacity\n\t\t\tonPress={props.onPress}\n\t\t\tstyle={[\n\t\t\t\tstyles.button,\n\t\t\t\t!props.ready ? styles.disabled : props.index > 0 ? styles.second : {},\n\t\t\t\tbackground\n\t\t\t]}\n\t\t>\n\t\t\t<Text style={[styles.text, { color: props.textColor }]}>\n\t\t\t\t{props.text}\n\t\t\t</Text>\n\t\t\t{props.loading && (\n\t\t\t\t<View style={[styles.loader, background]}>\n\t\t\t\t\t<ActivityIndicator color={props.textColor} />\n\t\t\t\t</View>\n\t\t\t)}\n\t\t</TouchableOpacity>\n\t)\n}\n\nconst styles = StyleSheet.create({\n\tbutton: {\n\t\tpadding: 10,\n\t\tbackgroundColor: 'blue',\n\t\talignItems: 'center',\n\t\tflex: 1\n\t},\n\tsecond: { backgroundColor: 'hotpink' },\n\tdisabled: {\n\t\tbackgroundColor: 'lightgray'\n\t},\n\ttext: {\n\t\tfontWeight: 'bold',\n\t\tfontSize: 18,\n\t\tcolor: 'white'\n\t},\n\tloader: {\n\t\t...StyleSheet.absoluteFillObject,\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center'\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/RoomCreator/Content/Footer/Input/index.tsx";import React from'react';import{View,TextInput,StyleSheet}from'react-native';export default(function(props){return React.createElement(View,{style:[styles.container,props.inputContainerStyle],__source:{fileName:_jsxFileName,lineNumber:7}},React.createElement(TextInput,_extends({onChangeText:props.onChangeText,value:props.text,placeholder:"Type a new message...",style:[styles.input,props.inputStyle]},props.inputProps||{},{__source:{fileName:_jsxFileName,lineNumber:8}})));});var styles=StyleSheet.create({container:{},input:{paddingHorizontal:10,paddingTop:16,paddingBottom:16,fontSize:17}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","View","TextInput","StyleSheet","props","styles","container","inputContainerStyle","onChangeText","text","input","inputStyle","inputProps","create","paddingHorizontal","paddingTop","paddingBottom","fontSize"],"mappings":"mLAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CAEA,OAASC,IAAT,CAAeC,SAAf,CAA0BC,UAA1B,KAA4C,cAA5C,CAEA,eAAe,SAACC,KAAD,CAAkC,CAChD,MACC,qBAAC,IAAD,EAAM,KAAK,CAAE,CAACC,MAAM,CAACC,SAAR,CAAmBF,KAAK,CAACG,mBAAzB,CAAb,gDACC,oBAAC,SAAD,WACC,YAAY,CAAEH,KAAK,CAACI,YADrB,CAEC,KAAK,CAAEJ,KAAK,CAACK,IAFd,CAGC,WAAW,CAAC,uBAHb,CAIC,KAAK,CAAE,CAACJ,MAAM,CAACK,KAAR,CAAeN,KAAK,CAACO,UAArB,CAJR,EAKMP,KAAK,CAACQ,UAAN,EAAoB,EAL1B,kDADD,CADD,CAWA,CAZD,EAcA,GAAMP,CAAAA,MAAM,CAAGF,UAAU,CAACU,MAAX,CAAkB,CAChCP,SAAS,CAAE,EADqB,CAEhCI,KAAK,CAAE,CACNI,iBAAiB,CAAE,EADb,CAENC,UAAU,CAAE,EAFN,CAGNC,aAAa,CAAE,EAHT,CAINC,QAAQ,CAAE,EAJJ,CAFyB,CAAlB,CAAf","sourcesContent":["import React from 'react'\nimport { RoomCreatorInputProps } from '../../../types'\nimport { View, TextInput, StyleSheet } from 'react-native'\n\nexport default (props: RoomCreatorInputProps) => {\n\treturn (\n\t\t<View style={[styles.container, props.inputContainerStyle]}>\n\t\t\t<TextInput\n\t\t\t\tonChangeText={props.onChangeText}\n\t\t\t\tvalue={props.text}\n\t\t\t\tplaceholder=\"Type a new message...\"\n\t\t\t\tstyle={[styles.input, props.inputStyle]}\n\t\t\t\t{...(props.inputProps || {})}\n\t\t\t/>\n\t\t</View>\n\t)\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {},\n\tinput: {\n\t\tpaddingHorizontal: 10,\n\t\tpaddingTop: 16,\n\t\tpaddingBottom: 16,\n\t\tfontSize: 17\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/RoomCreator/Content/Footer/index.tsx";import React from'react';import{StyleSheet,SafeAreaView}from'react-native';import ButtonComponent from'./Button';import Input from'./Input';export default function(props){function renderButton(button){if(props.renderButton===null)return null;if(props.renderButton)return props.renderButton(button);var Component=props.ButtonComponent||ButtonComponent;return React.createElement(Component,_extends({key:""+button.text+Math.random()},button,{__source:{fileName:_jsxFileName,lineNumber:14}}));}var renderButtons=function renderButtons(){return React.createElement(SafeAreaView,{style:styles.buttons,__source:{fileName:_jsxFileName,lineNumber:18}},props.buttons.map(function(button,index){var ready=props.ready;var loading=!!button.loading;var buttonProps={backgroundColor:ready?button.color||'blue':button.disabledColor||'lightgray',text:button.text,onPress:function onPress(){return button.onPress({selected:props.selected,ready:ready,loading:loading,text:props.text||''});},textColor:(ready?button.textColor:button.disabledTextColor)||'white',ready:ready,index:index,loading:loading};return renderButton(buttonProps);}));};var maybeRenderInput=function maybeRenderInput(){if(!props.enableTextInput)return null;if(!props.ready&&!props.showInputWhenNotReady)return null;return React.createElement(Input,{text:props.text,onChangeText:props.onChangeText,inputProps:props.inputProps,inputContainerStyle:props.inputContainerStyle,inputStyle:props.inputStyle,__source:{fileName:_jsxFileName,lineNumber:51}});};return React.createElement(React.Fragment,null,maybeRenderInput(),renderButtons());}var styles=StyleSheet.create({buttons:{flexDirection:'row'}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","StyleSheet","SafeAreaView","ButtonComponent","Input","props","renderButton","button","Component","text","Math","random","renderButtons","styles","buttons","map","index","ready","loading","buttonProps","backgroundColor","color","disabledColor","onPress","selected","textColor","disabledTextColor","maybeRenderInput","enableTextInput","showInputWhenNotReady","onChangeText","inputProps","inputContainerStyle","inputStyle","create","flexDirection"],"mappings":"6KAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,UAAT,CAAqBC,YAArB,KAAyC,cAAzC,CAEA,MAAOC,CAAAA,eAAP,KAA4B,UAA5B,CACA,MAAOC,CAAAA,KAAP,KAAkB,SAAlB,CAEA,cAAe,UAASC,KAAT,CAAwC,CACtD,QAASC,CAAAA,YAAT,CAAsBC,MAAtB,CAAiD,CAChD,GAAIF,KAAK,CAACC,YAAN,GAAuB,IAA3B,CAAiC,MAAO,KAAP,CACjC,GAAID,KAAK,CAACC,YAAV,CAAwB,MAAOD,CAAAA,KAAK,CAACC,YAAN,CAAmBC,MAAnB,CAAP,CAExB,GAAMC,CAAAA,SAAS,CAAGH,KAAK,CAACF,eAAN,EAAyBA,eAA3C,CAEA,MAAO,qBAAC,SAAD,WAAW,GAAG,IAAKI,MAAM,CAACE,IAAZ,CAAmBC,IAAI,CAACC,MAAL,EAAjC,EAAsDJ,MAAtD,mDAAP,CACA,CACD,GAAMK,CAAAA,aAAa,CAAG,QAAhBA,CAAAA,aAAgB,EAAM,CAC3B,MACC,qBAAC,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B,CAGC,UAAU,CAAEzB,KAAK,CAAC0B,UAHnB,CAIC,mBAAmB,CAAE1B,KAAK,CAAC2B,mBAJ5B,CAKC,UAAU,CAAE3B,KAAK,CAAC4B,UALnB,iDADD,CASA,CAbD,CAcA,MACC,yCACEN,gBAAgB,EADlB,CAEEf,aAAa,EAFf,CADD,CAMA,CAED,GAAMC,CAAAA,MAAM,CAAGZ,UAAU,CAACiC,MAAX,CAAkB,CAChCpB,OAAO,CAAE,CACRqB,aAAa,CAAE,KADP,CADuB,CAAlB,CAAf","sourcesContent":["import React from 'react'\nimport { StyleSheet, SafeAreaView } from 'react-native'\nimport { RoomCreatorFooterProps, RenderButtonProps } from '../../types'\nimport ButtonComponent from './Button'\nimport Input from './Input'\n\nexport default function(props: RoomCreatorFooterProps) {\n\tfunction renderButton(button: RenderButtonProps) {\n\t\tif (props.renderButton === null) return null\n\t\tif (props.renderButton) return props.renderButton(button)\n\n\t\tconst Component = props.ButtonComponent || ButtonComponent\n\n\t\treturn <Component key={`${button.text}${Math.random()}`} {...button} />\n\t}\n\tconst renderButtons = () => {\n\t\treturn (\n\t\t\t<SafeAreaView style={styles.buttons}>\n\t\t\t\t{props.buttons.map((button, index) => {\n\t\t\t\t\tconst ready = props.ready\n\t\t\t\t\tconst loading = !!button.loading\n\t\t\t\t\tconst buttonProps: RenderButtonProps = {\n\t\t\t\t\t\tbackgroundColor: ready\n\t\t\t\t\t\t\t? button.color || 'blue'\n\t\t\t\t\t\t\t: button.disabledColor || 'lightgray',\n\t\t\t\t\t\ttext: button.text,\n\t\t\t\t\t\tonPress: () =>\n\t\t\t\t\t\t\tbutton.onPress({\n\t\t\t\t\t\t\t\tselected: props.selected,\n\t\t\t\t\t\t\t\tready,\n\t\t\t\t\t\t\t\tloading,\n\t\t\t\t\t\t\t\ttext: props.text || ''\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\ttextColor:\n\t\t\t\t\t\t\t(ready ? button.textColor : button.disabledTextColor) || 'white',\n\t\t\t\t\t\tready,\n\t\t\t\t\t\tindex,\n\t\t\t\t\t\tloading\n\t\t\t\t\t}\n\n\t\t\t\t\treturn renderButton(buttonProps)\n\t\t\t\t})}\n\t\t\t</SafeAreaView>\n\t\t)\n\t}\n\tconst maybeRenderInput = () => {\n\t\tif (!props.enableTextInput) return null\n\t\tif (!props.ready && !props.showInputWhenNotReady) return null\n\n\t\treturn (\n\t\t\t<Input\n\t\t\t\ttext={props.text}\n\t\t\t\tonChangeText={props.onChangeText}\n\t\t\t\tinputProps={props.inputProps}\n\t\t\t\tinputContainerStyle={props.inputContainerStyle}\n\t\t\t\tinputStyle={props.inputStyle}\n\t\t\t/>\n\t\t)\n\t}\n\treturn (\n\t\t<>\n\t\t\t{maybeRenderInput()}\n\t\t\t{renderButtons()}\n\t\t</>\n\t)\n}\n\nconst styles = StyleSheet.create({\n\tbuttons: {\n\t\tflexDirection: 'row'\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/RoomCreator/Content/Item/Icon/index.tsx";import React from'react';import{View}from'react-native';import{Ionicons}from'@expo/vector-icons';export default(function(props){return React.createElement(View,{__source:{fileName:_jsxFileName,lineNumber:8}},React.createElement(Ionicons,{name:"ios-checkmark-circle",size:28,color:props.active?props.activeColor:props.inactiveColor,__source:{fileName:_jsxFileName,lineNumber:9}}));});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","View","Ionicons","props","active","activeColor","inactiveColor"],"mappings":"2HAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CAEA,OAASC,IAAT,KAAqB,cAArB,CACA,OAASC,QAAT,KAAyB,oBAAzB,CAEA,eAAe,SAACC,KAAD,CAA8B,CAC5C,MACC,qBAAC,IAAD,iDACC,oBAAC,QAAD,EACC,IAAI,CAAC,sBADN,CAEC,IAAI,CAAE,EAFP,CAGC,KAAK,CAAEA,KAAK,CAACC,MAAN,CAAeD,KAAK,CAACE,WAArB,CAAmCF,KAAK,CAACG,aAHjD,gDADD,CADD,CASA,CAVD","sourcesContent":["import React from 'react'\nimport { SelectedIconProps } from '../../../types'\nimport { View } from 'react-native'\nimport { Ionicons } from '@expo/vector-icons'\n\nexport default (props: SelectedIconProps) => {\n\treturn (\n\t\t<View>\n\t\t\t<Ionicons\n\t\t\t\tname=\"ios-checkmark-circle\"\n\t\t\t\tsize={28}\n\t\t\t\tcolor={props.active ? props.activeColor : props.inactiveColor}\n\t\t\t/>\n\t\t</View>\n\t)\n}\n"]}
@@ -1,2 +0,0 @@
1
- import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/RoomCreator/Content/Item/index.tsx";import React from'react';import{View,Text,StyleSheet,TouchableOpacity}from'react-native';import Icon from'./Icon';import Avatar from'../../../Avatar';import Initials from'../../../Inbox/Item/Initials';import{getInitials}from'../../../../helpers/getInitials';export default React.memo(function(props){if(props.selected)console.log('selected!!',props.id);var onPress=function onPress(){return props.toggleSelected(props.id);};var renderSelectedIcon=function renderSelectedIcon(){if(props.renderSelectedIcon===null)return null;var iconProps={activeColor:props.selectedIconActiveColor||'#147EFB',inactiveColor:props.selectedIconInactiveColor||'#D3D3D360',active:props.selected};if(props.renderSelectedIcon)return props.renderSelectedIcon(iconProps);return React.createElement(Icon,_extends({},iconProps,{__source:{fileName:_jsxFileName,lineNumber:21}}));};var renderAvatarOrInitials=function renderAvatarOrInitials(){return props.avatar?React.createElement(Avatar,{avatar:props.avatar,size:50,__source:{fileName:_jsxFileName,lineNumber:25}}):React.createElement(Initials,{size:50,initials:getInitials(props.name),__source:{fileName:_jsxFileName,lineNumber:27}});};return React.createElement(View,{__source:{fileName:_jsxFileName,lineNumber:31}},React.createElement(TouchableOpacity,{onPress:onPress,style:styles.container,__source:{fileName:_jsxFileName,lineNumber:32}},React.createElement(View,{style:styles.wrapper,__source:{fileName:_jsxFileName,lineNumber:33}},renderAvatarOrInitials(),React.createElement(View,{style:styles.content,__source:{fileName:_jsxFileName,lineNumber:35}},!!props.handle&&React.createElement(Text,{style:styles.name,__source:{fileName:_jsxFileName,lineNumber:36}},props.handle),React.createElement(Text,{__source:{fileName:_jsxFileName,lineNumber:37}},props.name)),React.createElement(View,{style:styles.checkContainer,__source:{fileName:_jsxFileName,lineNumber:39}},renderSelectedIcon()))));});var styles=StyleSheet.create({container:{paddingHorizontal:16,paddingVertical:10},wrapper:{flexDirection:'row',alignItems:'center'},content:{flex:1,marginLeft:16},name:{fontWeight:'bold'},image:{height:50,width:50,borderRadius:25,overflow:'hidden'},checkContainer:{justifyContent:'center'},check:{height:25,width:25,borderRadius:12.5,backgroundColor:'lightgray'},checked:{flex:1,alignItems:'center',justifyContent:'flex-start'}});
2
- //# sourceMappingURL=index.js.map