@cometchat/chat-uikit-react-native 5.5.2 → 5.5.4

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.
@@ -160,56 +160,57 @@ export const LinkPreviewBubble = (props: LinkPreviewBubbleInterface) => {
160
160
  );
161
161
 
162
162
  return (
163
- <View
164
- onLayout={onLayoutHandler}
165
- onTouchStart={handleTouchStart}
166
- onTouchEnd={handleTouchEnd}
167
- onTouchMove={onTouchMove}
168
- >
169
- {imageSource ? (
170
- <View
171
- style={style?.headerImageContainerStyle}
172
- onTouchStart={handleTouchStart}
173
- onTouchEnd={handleTouchEnd}
174
- onTouchMove={onTouchMove}
175
- >
176
- <Image
177
- source={imageSource}
178
- style={[{ height: imageHeight, width: imageWidth }, style?.headerImageStyle]}
179
- onError={(err) => {
180
- setImageSource(DefaultLinkPreview);
181
- }}
182
- />
183
- </View>
184
- ) : null}
163
+ <View onLayout={onLayoutHandler}>
164
+ {/* Only the preview card (image, title, description, link) opens the link. Raw touch
165
+ events reach every ancestor of the touched view, whichever child handles the press, so
166
+ these handlers on the outer view also fired for taps on the message text and its
167
+ "Read more" below, and the image container's second copy made an image tap open the
168
+ link twice (ENG-41080). */}
169
+ <View
170
+ onTouchStart={handleTouchStart}
171
+ onTouchEnd={handleTouchEnd}
172
+ onTouchMove={onTouchMove}
173
+ >
174
+ {imageSource ? (
175
+ <View style={style?.headerImageContainerStyle}>
176
+ <Image
177
+ source={imageSource}
178
+ style={[{ height: imageHeight, width: imageWidth }, style?.headerImageStyle]}
179
+ onError={() => {
180
+ setImageSource(DefaultLinkPreview);
181
+ }}
182
+ />
183
+ </View>
184
+ ) : null}
185
+
186
+ <View style={style?.bodyStyle?.containerStyle}>
187
+ <View style={{ flexDirection: "row" }}>
188
+ <View style={style?.bodyStyle?.titleContainerStyle}>
189
+ <Text style={style?.bodyStyle?.titleStyle} ellipsizeMode='tail'>
190
+ {title}
191
+ </Text>
192
+ </View>
185
193
 
186
- <View style={style?.bodyStyle?.containerStyle}>
187
- <View style={{ flexDirection: "row" }}>
188
- <View style={style?.bodyStyle?.titleContainerStyle}>
189
- <Text style={style?.bodyStyle?.titleStyle} ellipsizeMode='tail'>
190
- {title}
194
+ {!imageSource && !faviconError && (
195
+ <View style={style?.bodyStyle?.faviconContainerStyle}>
196
+ <Image
197
+ source={faviconSource}
198
+ style={style?.bodyStyle?.faviconStyle}
199
+ onError={() => {
200
+ setFaviconError(true);
201
+ }}
202
+ />
203
+ </View>
204
+ )}
205
+ </View>
206
+ <View style={style?.bodyStyle?.subtitleContainerStyle}>
207
+ <Text style={style?.bodyStyle?.subtitleTitle} numberOfLines={2} ellipsizeMode='tail'>
208
+ {description}
209
+ </Text>
210
+ <Text style={style?.bodyStyle?.subtitleTitle} numberOfLines={2} ellipsizeMode='tail'>
211
+ {link}
191
212
  </Text>
192
213
  </View>
193
-
194
- {!imageSource && !faviconError && (
195
- <View style={style?.bodyStyle?.faviconContainerStyle}>
196
- <Image
197
- source={faviconSource}
198
- style={style?.bodyStyle?.faviconStyle}
199
- onError={(err) => {
200
- setFaviconError(true);
201
- }}
202
- />
203
- </View>
204
- )}
205
- </View>
206
- <View style={style?.bodyStyle?.subtitleContainerStyle}>
207
- <Text style={style?.bodyStyle?.subtitleTitle} numberOfLines={2} ellipsizeMode='tail'>
208
- {description}
209
- </Text>
210
- <Text style={style?.bodyStyle?.subtitleTitle} numberOfLines={2} ellipsizeMode='tail'>
211
- {link}
212
- </Text>
213
214
  </View>
214
215
  </View>
215
216
  {/* Only the card that carries the message text gets this padded row; the others would show an empty band. */}