rn-erxes-sdk 0.1.22 → 0.1.24

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 (233) hide show
  1. package/README.md +40 -2
  2. package/lib/commonjs/App.js +41 -21
  3. package/lib/commonjs/App.js.map +1 -1
  4. package/lib/commonjs/Widget.js +158 -31
  5. package/lib/commonjs/Widget.js.map +1 -1
  6. package/lib/commonjs/components/Avatar.js +24 -27
  7. package/lib/commonjs/components/Avatar.js.map +1 -1
  8. package/lib/commonjs/components/AvatarWithStatus.js +56 -0
  9. package/lib/commonjs/components/AvatarWithStatus.js.map +1 -0
  10. package/lib/commonjs/components/ConversationItem.js +161 -0
  11. package/lib/commonjs/components/ConversationItem.js.map +1 -0
  12. package/lib/commonjs/components/Icons.js +558 -0
  13. package/lib/commonjs/components/Icons.js.map +1 -0
  14. package/lib/commonjs/components/InputTools.js +329 -38
  15. package/lib/commonjs/components/InputTools.js.map +1 -1
  16. package/lib/commonjs/components/MessengerShell.js +64 -0
  17. package/lib/commonjs/components/MessengerShell.js.map +1 -0
  18. package/lib/commonjs/components/conversation/DateSeparator.js +47 -0
  19. package/lib/commonjs/components/conversation/DateSeparator.js.map +1 -0
  20. package/lib/commonjs/components/conversation/EmojiPicker.js +62 -0
  21. package/lib/commonjs/components/conversation/EmojiPicker.js.map +1 -0
  22. package/lib/commonjs/components/conversation/PersistentMenu.js +64 -0
  23. package/lib/commonjs/components/conversation/PersistentMenu.js.map +1 -0
  24. package/lib/commonjs/components/conversation/TypingStatus.js +122 -0
  25. package/lib/commonjs/components/conversation/TypingStatus.js.map +1 -0
  26. package/lib/commonjs/components/conversation/WelcomeMessage.js +85 -0
  27. package/lib/commonjs/components/conversation/WelcomeMessage.js.map +1 -0
  28. package/lib/commonjs/components/nav/Navigation.js +130 -0
  29. package/lib/commonjs/components/nav/Navigation.js.map +1 -0
  30. package/lib/commonjs/components/nav/constants.js +23 -0
  31. package/lib/commonjs/components/nav/constants.js.map +1 -0
  32. package/lib/commonjs/graphql/ApolloContainer.js +1 -2
  33. package/lib/commonjs/graphql/ApolloContainer.js.map +1 -1
  34. package/lib/commonjs/graphql/mutation.js +58 -23
  35. package/lib/commonjs/graphql/mutation.js.map +1 -1
  36. package/lib/commonjs/graphql/query.js +85 -55
  37. package/lib/commonjs/graphql/query.js.map +1 -1
  38. package/lib/commonjs/graphql/subscription.js +32 -28
  39. package/lib/commonjs/graphql/subscription.js.map +1 -1
  40. package/lib/commonjs/screen/conversation/Attachment.js +77 -12
  41. package/lib/commonjs/screen/conversation/Attachment.js.map +1 -1
  42. package/lib/commonjs/screen/conversation/ConversationDetail.js +307 -136
  43. package/lib/commonjs/screen/conversation/ConversationDetail.js.map +1 -1
  44. package/lib/commonjs/screen/conversation/Message.js +145 -82
  45. package/lib/commonjs/screen/conversation/Message.js.map +1 -1
  46. package/lib/commonjs/screen/faq/Faq.js +373 -0
  47. package/lib/commonjs/screen/faq/Faq.js.map +1 -0
  48. package/lib/commonjs/screen/greetings/Social.js +19 -9
  49. package/lib/commonjs/screen/greetings/Social.js.map +1 -1
  50. package/lib/commonjs/screen/greetings/Supporters.js +49 -46
  51. package/lib/commonjs/screen/greetings/Supporters.js.map +1 -1
  52. package/lib/commonjs/screen/home/Home.js +246 -0
  53. package/lib/commonjs/screen/home/Home.js.map +1 -0
  54. package/lib/commonjs/screen/messages/Messages.js +312 -0
  55. package/lib/commonjs/screen/messages/Messages.js.map +1 -0
  56. package/lib/commonjs/theme.js +132 -0
  57. package/lib/commonjs/theme.js.map +1 -0
  58. package/lib/commonjs/utils/messages.js +93 -0
  59. package/lib/commonjs/utils/messages.js.map +1 -0
  60. package/lib/commonjs/utils/onlineHours.js +127 -0
  61. package/lib/commonjs/utils/onlineHours.js.map +1 -0
  62. package/lib/commonjs/utils/upload.js +245 -0
  63. package/lib/commonjs/utils/upload.js.map +1 -0
  64. package/lib/module/App.js +41 -21
  65. package/lib/module/App.js.map +1 -1
  66. package/lib/module/Widget.js +161 -34
  67. package/lib/module/Widget.js.map +1 -1
  68. package/lib/module/components/Avatar.js +25 -28
  69. package/lib/module/components/Avatar.js.map +1 -1
  70. package/lib/module/components/AvatarWithStatus.js +47 -0
  71. package/lib/module/components/AvatarWithStatus.js.map +1 -0
  72. package/lib/module/components/ConversationItem.js +153 -0
  73. package/lib/module/components/ConversationItem.js.map +1 -0
  74. package/lib/module/components/Icons.js +537 -0
  75. package/lib/module/components/Icons.js.map +1 -0
  76. package/lib/module/components/InputTools.js +331 -39
  77. package/lib/module/components/InputTools.js.map +1 -1
  78. package/lib/module/components/MessengerShell.js +55 -0
  79. package/lib/module/components/MessengerShell.js.map +1 -0
  80. package/lib/module/components/conversation/DateSeparator.js +40 -0
  81. package/lib/module/components/conversation/DateSeparator.js.map +1 -0
  82. package/lib/module/components/conversation/EmojiPicker.js +55 -0
  83. package/lib/module/components/conversation/EmojiPicker.js.map +1 -0
  84. package/lib/module/components/conversation/PersistentMenu.js +57 -0
  85. package/lib/module/components/conversation/PersistentMenu.js.map +1 -0
  86. package/lib/module/components/conversation/TypingStatus.js +113 -0
  87. package/lib/module/components/conversation/TypingStatus.js.map +1 -0
  88. package/lib/module/components/conversation/WelcomeMessage.js +76 -0
  89. package/lib/module/components/conversation/WelcomeMessage.js.map +1 -0
  90. package/lib/module/components/nav/Navigation.js +121 -0
  91. package/lib/module/components/nav/Navigation.js.map +1 -0
  92. package/lib/module/components/nav/constants.js +16 -0
  93. package/lib/module/components/nav/constants.js.map +1 -0
  94. package/lib/module/graphql/ApolloContainer.js +1 -2
  95. package/lib/module/graphql/ApolloContainer.js.map +1 -1
  96. package/lib/module/graphql/mutation.js +57 -23
  97. package/lib/module/graphql/mutation.js.map +1 -1
  98. package/lib/module/graphql/query.js +83 -52
  99. package/lib/module/graphql/query.js.map +1 -1
  100. package/lib/module/graphql/subscription.js +31 -28
  101. package/lib/module/graphql/subscription.js.map +1 -1
  102. package/lib/module/screen/conversation/Attachment.js +79 -14
  103. package/lib/module/screen/conversation/Attachment.js.map +1 -1
  104. package/lib/module/screen/conversation/ConversationDetail.js +311 -139
  105. package/lib/module/screen/conversation/ConversationDetail.js.map +1 -1
  106. package/lib/module/screen/conversation/Message.js +145 -82
  107. package/lib/module/screen/conversation/Message.js.map +1 -1
  108. package/lib/module/screen/faq/Faq.js +363 -0
  109. package/lib/module/screen/faq/Faq.js.map +1 -0
  110. package/lib/module/screen/greetings/Social.js +19 -9
  111. package/lib/module/screen/greetings/Social.js.map +1 -1
  112. package/lib/module/screen/greetings/Supporters.js +50 -46
  113. package/lib/module/screen/greetings/Supporters.js.map +1 -1
  114. package/lib/module/screen/home/Home.js +236 -0
  115. package/lib/module/screen/home/Home.js.map +1 -0
  116. package/lib/module/screen/messages/Messages.js +303 -0
  117. package/lib/module/screen/messages/Messages.js.map +1 -0
  118. package/lib/module/theme.js +122 -0
  119. package/lib/module/theme.js.map +1 -0
  120. package/lib/module/utils/messages.js +81 -0
  121. package/lib/module/utils/messages.js.map +1 -0
  122. package/lib/module/utils/onlineHours.js +118 -0
  123. package/lib/module/utils/onlineHours.js.map +1 -0
  124. package/lib/module/utils/upload.js +233 -0
  125. package/lib/module/utils/upload.js.map +1 -0
  126. package/lib/typescript/App.d.ts +2 -1
  127. package/lib/typescript/App.d.ts.map +1 -1
  128. package/lib/typescript/Widget.d.ts.map +1 -1
  129. package/lib/typescript/components/Avatar.d.ts +7 -1
  130. package/lib/typescript/components/Avatar.d.ts.map +1 -1
  131. package/lib/typescript/components/AvatarWithStatus.d.ts +11 -0
  132. package/lib/typescript/components/AvatarWithStatus.d.ts.map +1 -0
  133. package/lib/typescript/components/ConversationItem.d.ts +9 -0
  134. package/lib/typescript/components/ConversationItem.d.ts.map +1 -0
  135. package/lib/typescript/components/Icons.d.ts +33 -0
  136. package/lib/typescript/components/Icons.d.ts.map +1 -0
  137. package/lib/typescript/components/InputTools.d.ts.map +1 -1
  138. package/lib/typescript/components/MessengerShell.d.ts +4 -0
  139. package/lib/typescript/components/MessengerShell.d.ts.map +1 -0
  140. package/lib/typescript/components/conversation/DateSeparator.d.ts +6 -0
  141. package/lib/typescript/components/conversation/DateSeparator.d.ts.map +1 -0
  142. package/lib/typescript/components/conversation/EmojiPicker.d.ts +7 -0
  143. package/lib/typescript/components/conversation/EmojiPicker.d.ts.map +1 -0
  144. package/lib/typescript/components/conversation/PersistentMenu.d.ts +13 -0
  145. package/lib/typescript/components/conversation/PersistentMenu.d.ts.map +1 -0
  146. package/lib/typescript/components/conversation/TypingStatus.d.ts +4 -0
  147. package/lib/typescript/components/conversation/TypingStatus.d.ts.map +1 -0
  148. package/lib/typescript/components/conversation/WelcomeMessage.d.ts +6 -0
  149. package/lib/typescript/components/conversation/WelcomeMessage.d.ts.map +1 -0
  150. package/lib/typescript/components/nav/Navigation.d.ts +12 -0
  151. package/lib/typescript/components/nav/Navigation.d.ts.map +1 -0
  152. package/lib/typescript/components/nav/constants.d.ts +7 -0
  153. package/lib/typescript/components/nav/constants.d.ts.map +1 -0
  154. package/lib/typescript/graphql/ApolloContainer.d.ts.map +1 -1
  155. package/lib/typescript/graphql/mutation.d.ts +2 -1
  156. package/lib/typescript/graphql/mutation.d.ts.map +1 -1
  157. package/lib/typescript/graphql/query.d.ts +2 -3
  158. package/lib/typescript/graphql/query.d.ts.map +1 -1
  159. package/lib/typescript/graphql/subscription.d.ts +2 -1
  160. package/lib/typescript/graphql/subscription.d.ts.map +1 -1
  161. package/lib/typescript/screen/conversation/Attachment.d.ts.map +1 -1
  162. package/lib/typescript/screen/conversation/ConversationDetail.d.ts.map +1 -1
  163. package/lib/typescript/screen/conversation/Message.d.ts.map +1 -1
  164. package/lib/typescript/screen/faq/Faq.d.ts +4 -0
  165. package/lib/typescript/screen/faq/Faq.d.ts.map +1 -0
  166. package/lib/typescript/screen/greetings/Social.d.ts +1 -1
  167. package/lib/typescript/screen/greetings/Social.d.ts.map +1 -1
  168. package/lib/typescript/screen/greetings/Supporters.d.ts.map +1 -1
  169. package/lib/typescript/screen/home/Home.d.ts +4 -0
  170. package/lib/typescript/screen/home/Home.d.ts.map +1 -0
  171. package/lib/typescript/screen/messages/Messages.d.ts +4 -0
  172. package/lib/typescript/screen/messages/Messages.d.ts.map +1 -0
  173. package/lib/typescript/theme.d.ts +93 -0
  174. package/lib/typescript/theme.d.ts.map +1 -0
  175. package/lib/typescript/utils/messages.d.ts +27 -0
  176. package/lib/typescript/utils/messages.d.ts.map +1 -0
  177. package/lib/typescript/utils/onlineHours.d.ts +19 -0
  178. package/lib/typescript/utils/onlineHours.d.ts.map +1 -0
  179. package/lib/typescript/utils/upload.d.ts +32 -0
  180. package/lib/typescript/utils/upload.d.ts.map +1 -0
  181. package/package.json +25 -21
  182. package/src/App.tsx +48 -24
  183. package/src/Widget.tsx +214 -40
  184. package/src/components/Avatar.tsx +30 -30
  185. package/src/components/AvatarWithStatus.tsx +63 -0
  186. package/src/components/ConversationItem.tsx +199 -0
  187. package/src/components/Icons.tsx +532 -0
  188. package/src/components/InputTools.tsx +387 -48
  189. package/src/components/MessengerShell.tsx +58 -0
  190. package/src/components/conversation/DateSeparator.tsx +36 -0
  191. package/src/components/conversation/EmojiPicker.tsx +111 -0
  192. package/src/components/conversation/PersistentMenu.tsx +74 -0
  193. package/src/components/conversation/TypingStatus.tsx +112 -0
  194. package/src/components/conversation/WelcomeMessage.tsx +70 -0
  195. package/src/components/nav/Navigation.tsx +137 -0
  196. package/src/components/nav/constants.ts +16 -0
  197. package/src/graphql/ApolloContainer.tsx +0 -1
  198. package/src/graphql/mutation.ts +58 -22
  199. package/src/graphql/query.ts +83 -55
  200. package/src/graphql/subscription.ts +31 -27
  201. package/src/screen/conversation/Attachment.tsx +123 -33
  202. package/src/screen/conversation/ConversationDetail.tsx +367 -134
  203. package/src/screen/conversation/Message.tsx +160 -98
  204. package/src/screen/faq/Faq.tsx +425 -0
  205. package/src/screen/greetings/Social.tsx +18 -4
  206. package/src/screen/greetings/Supporters.tsx +56 -41
  207. package/src/screen/home/Home.tsx +276 -0
  208. package/src/screen/messages/Messages.tsx +331 -0
  209. package/src/theme.ts +104 -0
  210. package/src/utils/messages.ts +105 -0
  211. package/src/utils/onlineHours.ts +167 -0
  212. package/src/utils/upload.ts +326 -0
  213. package/lib/commonjs/components/FAB.js +0 -51
  214. package/lib/commonjs/components/FAB.js.map +0 -1
  215. package/lib/commonjs/screen/conversation/Conversations.js +0 -158
  216. package/lib/commonjs/screen/conversation/Conversations.js.map +0 -1
  217. package/lib/commonjs/screen/greetings/Greetings.js +0 -96
  218. package/lib/commonjs/screen/greetings/Greetings.js.map +0 -1
  219. package/lib/module/components/FAB.js +0 -42
  220. package/lib/module/components/FAB.js.map +0 -1
  221. package/lib/module/screen/conversation/Conversations.js +0 -147
  222. package/lib/module/screen/conversation/Conversations.js.map +0 -1
  223. package/lib/module/screen/greetings/Greetings.js +0 -85
  224. package/lib/module/screen/greetings/Greetings.js.map +0 -1
  225. package/lib/typescript/components/FAB.d.ts +0 -16
  226. package/lib/typescript/components/FAB.d.ts.map +0 -1
  227. package/lib/typescript/screen/conversation/Conversations.d.ts +0 -4
  228. package/lib/typescript/screen/conversation/Conversations.d.ts.map +0 -1
  229. package/lib/typescript/screen/greetings/Greetings.d.ts +0 -4
  230. package/lib/typescript/screen/greetings/Greetings.d.ts.map +0 -1
  231. package/src/components/FAB.tsx +0 -69
  232. package/src/screen/conversation/Conversations.tsx +0 -148
  233. package/src/screen/greetings/Greetings.tsx +0 -98
@@ -6,74 +6,95 @@ import HTML from 'react-native-render-html';
6
6
  import { strip_html } from '../../utils/utils';
7
7
  import Attachment from './Attachment';
8
8
  import Avatar from '../../components/Avatar';
9
+ import { messengerTheme } from '../../theme';
9
10
 
10
11
  const { width } = Dimensions.get('window');
11
12
 
12
- const isDarkColor = (hex: any) => {
13
- 'worklet';
14
- // https://stackoverflow.com/a/69353003/9999202
15
- const r = parseInt(hex.slice(1, 3), 16);
16
- const g = parseInt(hex.slice(3, 5), 16);
17
- const b = parseInt(hex.slice(5, 7), 16);
18
- // https://stackoverflow.com/a/58270890/9999202
19
- const hsp = Math.sqrt(0.299 * r ** 2 + 0.587 * g ** 2 + 0.114 * b ** 2);
20
- return hsp < 170;
21
- };
13
+ const INCOMING_MAX = width * 0.8;
14
+ const OUTGOING_MAX = width * 0.78;
15
+ const AVATAR_SIZE = 32;
22
16
 
23
17
  const Message = (props: any) => {
24
- const { item, bgColor } = props;
18
+ const {
19
+ item,
20
+ bgColor,
21
+ // Grouping props (default to a standalone message when not provided).
22
+ isFirstInGroup = true,
23
+ isLastInGroup = true,
24
+ } = props;
25
+
26
+ const showName = isFirstInGroup;
27
+ const showAvatar = isLastInGroup;
28
+ const showTime = isLastInGroup;
25
29
 
26
- const position = item?.customerId ? 'right' : 'left';
30
+ const isOutgoing = Boolean(item?.customerId);
31
+ const name = item?.user?.details?.fullName || item?.user?.details?.firstName;
27
32
 
28
- const renderContent = () => {
29
- const strippedContent = strip_html(item?.content || '');
30
- if (strippedContent?.length === 0) {
31
- return null;
32
- }
33
- return <RenderHTML html={item?.content} />;
33
+ const strippedContent = strip_html(item?.content || '', true);
34
+ const hasContent = !!strippedContent && strippedContent.trim().length > 0;
35
+ const hasAttachments = item?.attachments?.length > 0;
36
+
37
+ const rowSpacing = {
38
+ marginTop: isFirstInGroup ? messengerTheme.spacing.md : 2,
34
39
  };
35
40
 
36
- return (
37
- <View style={[customStyles[position].container]}>
38
- {position === 'left' ? (
39
- <Avatar user={item?.user} bgColor={bgColor} />
40
- ) : null}
41
- <View>
42
- <View
43
- style={[
44
- styles.contentStyle,
45
- {
46
- backgroundColor: position === 'left' ? '#E7F2F7FF' : bgColor,
47
- borderBottomLeftRadius: position === 'left' ? 0 : 20,
48
- borderBottomRightRadius: position === 'left' ? 20 : 0,
49
- },
50
- ]}
51
- >
52
- {position === 'left' ? (
53
- renderContent()
54
- ) : (
55
- <Text
56
- style={{
57
- paddingVertical: 12,
58
- color: isDarkColor(bgColor) ? '#fff' : '#000',
59
- }}
60
- >
61
- {item?.content}
41
+ if (isOutgoing) {
42
+ return (
43
+ <View style={[styles.outgoingRow, rowSpacing]}>
44
+ <View style={styles.outgoingColumn}>
45
+ {hasContent ? (
46
+ <View style={[styles.outgoingBubble, { backgroundColor: bgColor }]}>
47
+ <Text style={styles.outgoingText}>{item?.content}</Text>
48
+ </View>
49
+ ) : null}
50
+ {hasAttachments ? (
51
+ <View style={styles.attachmentWrap}>
52
+ <Attachment images={item?.attachments} />
53
+ </View>
54
+ ) : null}
55
+ {showTime ? (
56
+ <Text style={[styles.timestamp, styles.timestampRight]}>
57
+ {dayjs(item?.createdAt).format('hh:mm A')}
62
58
  </Text>
63
- )}
64
- {item?.attachments?.length > 0 ? (
65
- <Attachment images={item?.attachments} />
66
59
  ) : null}
67
60
  </View>
68
- <Text
69
- style={{
70
- color: '#686868',
71
- fontSize: 12,
72
- textAlign: position === 'left' ? 'left' : 'right',
73
- }}
74
- >
75
- {dayjs(item?.createdAt).format('hh:mm A')}
76
- </Text>
61
+ </View>
62
+ );
63
+ }
64
+
65
+ return (
66
+ <View style={[styles.incomingRow, rowSpacing]}>
67
+ {showAvatar ? (
68
+ <Avatar
69
+ user={item?.user}
70
+ bgColor={bgColor}
71
+ size={AVATAR_SIZE}
72
+ name={name}
73
+ />
74
+ ) : (
75
+ <View style={styles.avatarSpacer} />
76
+ )}
77
+ <View style={styles.incomingColumn}>
78
+ {showName && name ? (
79
+ <Text numberOfLines={1} style={styles.senderName}>
80
+ {name}
81
+ </Text>
82
+ ) : null}
83
+ {hasContent ? (
84
+ <View style={styles.incomingBubble}>
85
+ <RenderHTML html={item?.content} />
86
+ </View>
87
+ ) : null}
88
+ {hasAttachments ? (
89
+ <View style={styles.attachmentWrap}>
90
+ <Attachment images={item?.attachments} />
91
+ </View>
92
+ ) : null}
93
+ {showTime ? (
94
+ <Text style={[styles.timestamp, styles.timestampLeft]}>
95
+ {dayjs(item?.createdAt).format('hh:mm A')}
96
+ </Text>
97
+ ) : null}
77
98
  </View>
78
99
  </View>
79
100
  );
@@ -81,41 +102,79 @@ const Message = (props: any) => {
81
102
 
82
103
  export default Message;
83
104
 
84
- const customStyles = {
85
- left: StyleSheet.create({
86
- container: {
87
- justifyContent: 'flex-start',
88
- marginLeft: 0,
89
- marginRight: 0,
90
- marginTop: 10,
91
- flexDirection: 'row',
92
- alignItems: 'center',
93
- },
94
- }),
95
- right: StyleSheet.create({
96
- container: {
97
- justifyContent: 'flex-end',
98
- marginLeft: 0,
99
- marginRight: 0,
100
- marginTop: 10,
101
- flexDirection: 'row',
102
- alignItems: 'center',
103
- },
104
- }),
105
- } as any;
106
-
107
105
  const styles = StyleSheet.create({
108
- contentStyle: {
109
- paddingHorizontal: 15,
110
- maxWidth: width * 0.8,
111
- marginVertical: 5,
112
- borderTopLeftRadius: 20,
113
- borderTopRightRadius: 20,
106
+ // Incoming (operator) — avatar + bubble on the left.
107
+ incomingRow: {
108
+ flexDirection: 'row',
109
+ alignItems: 'flex-end',
110
+ marginTop: messengerTheme.spacing.md,
111
+ maxWidth: INCOMING_MAX,
112
+ alignSelf: 'flex-start',
113
+ },
114
+ incomingColumn: {
115
+ marginLeft: messengerTheme.spacing.sm,
116
+ flexShrink: 1,
117
+ },
118
+ avatarSpacer: {
119
+ width: AVATAR_SIZE,
120
+ height: AVATAR_SIZE,
121
+ },
122
+ senderName: {
123
+ fontSize: 11,
124
+ color: messengerTheme.colors.mutedText,
125
+ fontWeight: '500',
126
+ marginBottom: 3,
127
+ marginLeft: 4,
128
+ },
129
+ incomingBubble: {
130
+ backgroundColor: messengerTheme.colors.incomingBubble,
131
+ paddingHorizontal: messengerTheme.spacing.md,
132
+ paddingVertical: 8,
133
+ borderRadius: messengerTheme.radius.bubble,
134
+ borderBottomLeftRadius: messengerTheme.radius.tail,
135
+ alignSelf: 'flex-start',
136
+ ...messengerTheme.shadow.bubble,
137
+ },
138
+
139
+ // Outgoing (customer) — bubble pinned right.
140
+ outgoingRow: {
141
+ marginTop: messengerTheme.spacing.md,
142
+ maxWidth: OUTGOING_MAX,
143
+ alignSelf: 'flex-end',
144
+ },
145
+ outgoingColumn: {
146
+ alignItems: 'flex-end',
147
+ },
148
+ outgoingBubble: {
149
+ paddingHorizontal: messengerTheme.spacing.md,
150
+ paddingVertical: 8,
151
+ borderRadius: messengerTheme.radius.bubble,
152
+ borderBottomRightRadius: messengerTheme.radius.tail,
153
+ alignSelf: 'flex-end',
154
+ ...messengerTheme.shadow.bubble,
155
+ },
156
+ outgoingText: {
157
+ color: messengerTheme.colors.outgoingText,
158
+ fontSize: 14,
159
+ lineHeight: 20,
160
+ fontWeight: '500',
161
+ },
162
+
163
+ attachmentWrap: {
164
+ marginTop: 4,
165
+ },
166
+ timestamp: {
167
+ color: messengerTheme.colors.subtleText,
168
+ fontSize: 10,
169
+ marginTop: 4,
170
+ },
171
+ timestampLeft: {
172
+ textAlign: 'left',
173
+ marginLeft: 4,
114
174
  },
115
- avatar: {
116
- width: 40,
117
- height: 40,
118
- borderRadius: 90,
175
+ timestampRight: {
176
+ textAlign: 'right',
177
+ marginRight: 2,
119
178
  },
120
179
  });
121
180
 
@@ -130,23 +189,26 @@ const RenderHTML = React.memo(function RenderHTML({ html }: any) {
130
189
 
131
190
  return (
132
191
  <HTML
133
- contentWidth={width - 150}
134
- source={{
135
- html: html,
192
+ contentWidth={INCOMING_MAX - AVATAR_SIZE - 24}
193
+ source={{ html }}
194
+ baseStyle={{
195
+ color: messengerTheme.colors.incomingText,
196
+ fontSize: 14,
197
+ lineHeight: 20,
136
198
  }}
137
199
  tagsStyles={{
138
- p: { color: '#686868' },
200
+ p: { color: messengerTheme.colors.incomingText, margin: 0 },
139
201
  a: { color: '#3B85F4' },
140
- li: { color: '#3B85F4' },
141
- ol: { color: '#686868' },
202
+ li: { color: messengerTheme.colors.incomingText },
203
+ ol: { color: messengerTheme.colors.incomingText },
204
+ ul: { color: messengerTheme.colors.incomingText },
142
205
  }}
143
206
  ignoredDomTags={['meta', 'script', 'font', 'title']}
144
207
  ignoredStyles={['borderStyle']}
145
208
  renderersProps={renderersProps}
146
209
  defaultTextProps={{
147
- style: {
148
- color: '#000',
149
- },
210
+ selectable: true,
211
+ style: { color: messengerTheme.colors.incomingText },
150
212
  }}
151
213
  />
152
214
  );