Skip to content

Commit f6a9177

Browse files
authored
chore: major version bumps (#3550)
## 🎯 Goal This PR addresses 2 small UI issues regarding giphies and bumps the peer dependency versions to what they'll be for V9. It should be the last change before the V9 release. ## 🛠 Implementation details <!-- Provide a description of the implementation --> ## 🎨 UI Changes <!-- Add relevant screenshots --> <details> <summary>iOS</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> <details> <summary>Android</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> ## 🧪 Testing <!-- Explain how this change can be tested (or why it can't be tested) --> ## ☑️ Checklist - [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required) - [ ] PR targets the `develop` branch - [ ] Documentation is updated - [ ] New code is tested in main example apps, including all possible scenarios - [ ] SampleApp iOS and Android - [ ] Expo iOS and Android
1 parent ea8ad75 commit f6a9177

7 files changed

Lines changed: 78 additions & 21 deletions

File tree

package/expo-package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"stream-chat-react-native-core": "8.1.0"
3131
},
3232
"peerDependencies": {
33-
"expo": ">=51.0.0",
33+
"expo": ">=52.0.0",
3434
"react-native": ">=0.76.0",
3535
"expo-av": "*",
3636
"expo-clipboard": "*",

package/native-package/package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,26 @@
3333
"stream-chat-react-native-core": "8.1.0"
3434
},
3535
"peerDependencies": {
36-
"@react-native-camera-roll/camera-roll": ">=7.8.0",
37-
"@react-native-clipboard/clipboard": ">=1.14.1",
36+
"@react-native-camera-roll/camera-roll": ">=7.9.0",
37+
"@react-native-clipboard/clipboard": ">=1.16.0",
3838
"@react-native-documents/picker": ">=10.1.1",
39-
"@stream-io/flat-list-mvcp": ">=0.10.3",
40-
"react-native": ">=0.73.0",
39+
"react-native": ">=0.76.0",
4140
"react-native-audio-recorder-player": ">=3.6.13",
4241
"react-native-nitro-sound": ">=0.2.9",
43-
"react-native-blob-util": ">=0.21.1",
42+
"react-native-blob-util": ">=0.22.0",
4443
"react-native-haptic-feedback": ">=2.3.0",
4544
"react-native-image-picker": ">=7.1.2",
4645
"react-native-share": ">=11.0.0",
4746
"react-native-video": ">=6.4.2"
4847
},
48+
4949
"peerDependenciesMeta": {
5050
"@react-native-camera-roll/camera-roll": {
5151
"optional": true
5252
},
5353
"@react-native-clipboard/clipboard": {
5454
"optional": true
5555
},
56-
"@stream-io/flat-list-mvcp": {
57-
"optional": true
58-
},
5956
"react-native-share": {
6057
"optional": true
6158
},

package/src/__tests__/offline-support/offline-feature.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,11 @@ export const Generic = () => {
15691569
expect(matchingReadRows[0].lastReadMessageId).toBe('321');
15701570
// FIXME: Currently missing from the DB, uncomment when added.
15711571
// expect(matchingReadRows[0].firstUnreadMessageId).toBe('123');
1572-
expect(matchingReadRows[0].lastRead).toBe(readTimestamp);
1572+
expect(
1573+
Math.abs(
1574+
new Date(matchingReadRows[0].lastRead).getTime() - new Date(readTimestamp).getTime(),
1575+
),
1576+
).toBeLessThanOrEqual(1);
15731577
});
15741578
});
15751579

@@ -1613,7 +1617,11 @@ export const Generic = () => {
16131617
expect(matchingReadRows[0].lastReadMessageId).toBe('321');
16141618
// FIXME: Currently missing from the DB, uncomment when added.
16151619
// expect(matchingReadRows[0].firstUnreadMessageId).toBe('123');
1616-
expect(matchingReadRows[0].lastRead).toBe(readTimestamp);
1620+
expect(
1621+
Math.abs(
1622+
new Date(matchingReadRows[0].lastRead).getTime() - new Date(readTimestamp).getTime(),
1623+
),
1624+
).toBeLessThanOrEqual(1);
16171625
});
16181626
});
16191627
});

package/src/components/Attachment/Giphy/Giphy.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const GiphyWithContext = (props: GiphyPropsWithContext) => {
5454
},
5555
} = useTheme();
5656

57-
const styles = useStyles({ isMyMessage });
57+
const styles = useStyles({ hasActions: !!actions, isMyMessage });
5858

5959
const uri = image_url || thumb_url;
6060

@@ -209,16 +209,21 @@ export const Giphy = (props: GiphyProps) => {
209209

210210
Giphy.displayName = 'Giphy{messageItemView{giphy}}';
211211

212-
const useStyles = ({ isMyMessage }: Pick<GiphyPropsWithContext, 'isMyMessage'>) => {
212+
const useStyles = ({
213+
hasActions,
214+
isMyMessage,
215+
}: Pick<GiphyPropsWithContext, 'isMyMessage'> & { hasActions: boolean }) => {
213216
const {
214217
theme: { semantics },
215218
} = useTheme();
216219
return useMemo(() => {
217220
return StyleSheet.create({
218221
container: {
219-
backgroundColor: isMyMessage
220-
? semantics.chatBgAttachmentOutgoing
221-
: semantics.chatBgAttachmentIncoming,
222+
backgroundColor: hasActions
223+
? semantics.chatBgOutgoing
224+
: isMyMessage
225+
? semantics.chatBgAttachmentOutgoing
226+
: semantics.chatBgAttachmentIncoming,
222227
borderRadius: primitives.radiusLg,
223228
maxWidth: 256, // TODO: Not sure how to fix this
224229
overflow: 'hidden',
@@ -252,5 +257,5 @@ const useStyles = ({ isMyMessage }: Pick<GiphyPropsWithContext, 'isMyMessage'>)
252257
lineHeight: primitives.typographyLineHeightTight,
253258
},
254259
});
255-
}, [isMyMessage, semantics]);
260+
}, [hasActions, isMyMessage, semantics]);
256261
};

package/src/components/Attachment/__tests__/Giphy.test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,31 @@ describe('Giphy', () => {
147147
});
148148
});
149149

150+
it('uses the outgoing bubble background for ephemeral giphy previews', async () => {
151+
render(
152+
getAttachmentComponent(
153+
{
154+
attachment: {
155+
...attachment,
156+
actions,
157+
},
158+
},
159+
{ isMyMessage: false },
160+
),
161+
);
162+
163+
await waitFor(() => {
164+
const style = screen.getByTestId('giphy-action-attachment').props.style;
165+
expect(style).toEqual(
166+
expect.arrayContaining([
167+
expect.objectContaining({
168+
backgroundColor: lightTheme.semantics.chatBgOutgoing,
169+
}),
170+
]),
171+
);
172+
});
173+
});
174+
150175
it('"giphy" attachment size should be customisable', async () => {
151176
attachment.giphy = giphy;
152177
render(getAttachmentComponent({ attachment, giphyVersion: 'fixed_height' }));

package/src/components/Message/MessageItemView/MessageItemView.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,12 @@ const useStyles = ({
9999
...bubbleReactionListTopContainer,
100100
},
101101
bubbleWrapper: {
102+
zIndex: 1,
102103
...bubbleWrapper,
103104
},
104105
repliesContainer: {
105106
marginTop: -primitives.spacingXxs, // Reducing the margin to account the gap added in the content container
107+
zIndex: 0,
106108
...repliesContainer,
107109
},
108110
leftAlignItems: {

package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,11 @@ exports[`Thread should match thread snapshot 1`] = `
465465
testID="message-components"
466466
>
467467
<View
468-
style={{}}
468+
style={
469+
{
470+
"zIndex": 1,
471+
}
472+
}
469473
>
470474
<View
471475
style={
@@ -606,6 +610,7 @@ exports[`Thread should match thread snapshot 1`] = `
606610
style={
607611
{
608612
"marginTop": -4,
613+
"zIndex": 0,
609614
}
610615
}
611616
/>
@@ -799,7 +804,11 @@ exports[`Thread should match thread snapshot 1`] = `
799804
testID="message-components"
800805
>
801806
<View
802-
style={{}}
807+
style={
808+
{
809+
"zIndex": 1,
810+
}
811+
}
803812
>
804813
<View
805814
style={
@@ -940,6 +949,7 @@ exports[`Thread should match thread snapshot 1`] = `
940949
style={
941950
{
942951
"marginTop": -4,
952+
"zIndex": 0,
943953
}
944954
}
945955
/>
@@ -1166,7 +1176,11 @@ exports[`Thread should match thread snapshot 1`] = `
11661176
testID="message-components"
11671177
>
11681178
<View
1169-
style={{}}
1179+
style={
1180+
{
1181+
"zIndex": 1,
1182+
}
1183+
}
11701184
>
11711185
<View
11721186
style={
@@ -1307,6 +1321,7 @@ exports[`Thread should match thread snapshot 1`] = `
13071321
style={
13081322
{
13091323
"marginTop": -4,
1324+
"zIndex": 0,
13101325
}
13111326
}
13121327
/>
@@ -1491,7 +1506,11 @@ exports[`Thread should match thread snapshot 1`] = `
14911506
testID="message-components"
14921507
>
14931508
<View
1494-
style={{}}
1509+
style={
1510+
{
1511+
"zIndex": 1,
1512+
}
1513+
}
14951514
>
14961515
<View
14971516
style={
@@ -1632,6 +1651,7 @@ exports[`Thread should match thread snapshot 1`] = `
16321651
style={
16331652
{
16341653
"marginTop": -4,
1654+
"zIndex": 0,
16351655
}
16361656
}
16371657
/>

0 commit comments

Comments
 (0)