Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next Release #2217

Merged
merged 5 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/changelog-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
cd package/
yarn --frozen-lockfile
cd native-package/
yarn --frozen-lockfile
yarn
cd ../../examples/SampleApp/
yarn --frozen-lockfile
yarn

- name: Generate Changelog
id: generate_changelog
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,5 @@ jobs:
run: yarn lerna-workspaces run lint && cd docusaurus && npx prettier --check '**/*.mdx'
- name: Test
run: yarn test:coverage
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=getstream
-Dsonar.projectKey=GetStream_stream-chat-react-native
-Dsonar.javascript.lcov.reportPaths=./package/coverage/lcov.info
-Dsonar.sources=package/src/
-Dsonar.test.exclusions=**/__tests__/**
-Dsonar.verbose=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
11 changes: 0 additions & 11 deletions .github/workflows/next-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,8 @@ jobs:
run: yarn lerna-workspaces run lint && (cd docusaurus; npx prettier --check '**/*.mdx')
- name: Test
run: yarn test:coverage
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=getstream
-Dsonar.projectKey=GetStream_stream-chat-react-native
-Dsonar.javascript.lcov.reportPaths=./package/coverage/lcov.info
-Dsonar.sources=package/src/
-Dsonar.test.exclusions=**/__tests__/**
-Dsonar.verbose=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Publish Next Release
run: GITHUB_SHORT_SHA="$(git rev-parse --short $GITHUB_SHA)" yarn release-next
env:
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


[![NPM](https://img.shields.io/npm/v/stream-chat-react-native.svg)](https://www.npmjs.com/package/stream-chat-react-native)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=GetStream_stream-chat-react-native&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=GetStream_stream-chat-react-native)
[![Build Status](https://github.com/GetStream/stream-chat-react-native/workflows/build/badge.svg)](https://github.com/GetStream/stream-chat-react-native/actions)
[![Component Reference](https://img.shields.io/badge/docs-component%20reference-blue.svg)](https://getstream.io/chat/docs/sdk/reactnative)

Expand Down
8 changes: 4 additions & 4 deletions examples/ExpoMessaging/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7105,10 +7105,10 @@ stream-buffers@2.2.x:
version "0.0.0"
uid ""

stream-chat-react-native-core@5.15.3:
version "5.15.3"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.15.3.tgz#c8312bc7d374587f1f023abaffc746620b7396a4"
integrity sha512-d6cNXTW9vMP/yjyHteAGHze6/ye/rLsUedPyhXyFGewdm3wz2zJPEDlKrUjR8QAbDwmUnttLSKELVdt98WhSHw==
stream-chat-react-native-core@5.16.0:
version "5.16.0"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.16.0.tgz#c3475a8f297732b0d765b5976d209b1ee838bea4"
integrity sha512-ZiKEl6JI1G/SzbjqMZH158x21R1nJiDPUbEx1t23SXb/6nN/ihL331kVQt0Ei95FeKcb77l71fhd2B7lAhzupQ==
dependencies:
"@babel/runtime" "^7.12.5"
"@gorhom/bottom-sheet" "4.4.5"
Expand Down
8 changes: 4 additions & 4 deletions examples/SampleApp/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7055,10 +7055,10 @@ statuses@~1.5.0:
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==

stream-chat-react-native-core@5.15.3:
version "5.15.3"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.15.3.tgz#c8312bc7d374587f1f023abaffc746620b7396a4"
integrity sha512-d6cNXTW9vMP/yjyHteAGHze6/ye/rLsUedPyhXyFGewdm3wz2zJPEDlKrUjR8QAbDwmUnttLSKELVdt98WhSHw==
stream-chat-react-native-core@5.16.0:
version "5.16.0"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.16.0.tgz#c3475a8f297732b0d765b5976d209b1ee838bea4"
integrity sha512-ZiKEl6JI1G/SzbjqMZH158x21R1nJiDPUbEx1t23SXb/6nN/ihL331kVQt0Ei95FeKcb77l71fhd2B7lAhzupQ==
dependencies:
"@babel/runtime" "^7.12.5"
"@gorhom/bottom-sheet" "4.4.5"
Expand Down
8 changes: 4 additions & 4 deletions examples/TypeScriptMessaging/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7183,10 +7183,10 @@ statuses@~1.5.0:
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==

stream-chat-react-native-core@5.15.3:
version "5.15.3"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.15.3.tgz#c8312bc7d374587f1f023abaffc746620b7396a4"
integrity sha512-d6cNXTW9vMP/yjyHteAGHze6/ye/rLsUedPyhXyFGewdm3wz2zJPEDlKrUjR8QAbDwmUnttLSKELVdt98WhSHw==
stream-chat-react-native-core@5.16.0:
version "5.16.0"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.16.0.tgz#c3475a8f297732b0d765b5976d209b1ee838bea4"
integrity sha512-ZiKEl6JI1G/SzbjqMZH158x21R1nJiDPUbEx1t23SXb/6nN/ihL331kVQt0Ei95FeKcb77l71fhd2B7lAhzupQ==
dependencies:
"@babel/runtime" "^7.12.5"
"@gorhom/bottom-sheet" "4.4.5"
Expand Down
8 changes: 4 additions & 4 deletions package/expo-package/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3036,10 +3036,10 @@ stream-buffers@2.2.x:
resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4"
integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==

stream-chat-react-native-core@5.15.3:
version "5.15.3"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.15.3.tgz#c8312bc7d374587f1f023abaffc746620b7396a4"
integrity sha512-d6cNXTW9vMP/yjyHteAGHze6/ye/rLsUedPyhXyFGewdm3wz2zJPEDlKrUjR8QAbDwmUnttLSKELVdt98WhSHw==
stream-chat-react-native-core@5.16.0:
version "5.16.0"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.16.0.tgz#c3475a8f297732b0d765b5976d209b1ee838bea4"
integrity sha512-ZiKEl6JI1G/SzbjqMZH158x21R1nJiDPUbEx1t23SXb/6nN/ihL331kVQt0Ei95FeKcb77l71fhd2B7lAhzupQ==
dependencies:
"@babel/runtime" "^7.12.5"
"@gorhom/bottom-sheet" "4.4.5"
Expand Down
8 changes: 4 additions & 4 deletions package/native-package/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4381,10 +4381,10 @@ statuses@~1.5.0:
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==

stream-chat-react-native-core@5.15.3:
version "5.15.3"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.15.3.tgz#c8312bc7d374587f1f023abaffc746620b7396a4"
integrity sha512-d6cNXTW9vMP/yjyHteAGHze6/ye/rLsUedPyhXyFGewdm3wz2zJPEDlKrUjR8QAbDwmUnttLSKELVdt98WhSHw==
stream-chat-react-native-core@5.16.0:
version "5.16.0"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.16.0.tgz#c3475a8f297732b0d765b5976d209b1ee838bea4"
integrity sha512-ZiKEl6JI1G/SzbjqMZH158x21R1nJiDPUbEx1t23SXb/6nN/ihL331kVQt0Ei95FeKcb77l71fhd2B7lAhzupQ==
dependencies:
"@babel/runtime" "^7.12.5"
"@gorhom/bottom-sheet" "4.4.5"
Expand Down
109 changes: 55 additions & 54 deletions package/src/components/Attachment/Gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,52 +35,6 @@ import { isVideoPackageAvailable } from '../../native';
import type { DefaultStreamChatGenerics } from '../../types/types';
import { getUrlWithoutParams } from '../../utils/utils';

const styles = StyleSheet.create({
errorTextSize: { fontSize: 10 },
galleryContainer: {
borderTopLeftRadius: 13,
borderTopRightRadius: 13,
flexDirection: 'row',
flexWrap: 'wrap',
overflow: 'hidden',
},
imageContainer: {
alignItems: 'center',
display: 'flex',
flexDirection: 'row',
justifyContent: 'center',
padding: 1,
},
imageContainerStyle: { alignItems: 'center', flex: 1, justifyContent: 'center' },
imageLoadingErrorIndicatorStyle: {
bottom: 4,
left: 4,
position: 'absolute',
},
imageLoadingIndicatorContainer: {
height: '100%',
justifyContent: 'center',
position: 'absolute',
width: '100%',
},
imageLoadingIndicatorStyle: {
alignItems: 'center',
justifyContent: 'center',
position: 'absolute',
},
imageReloadContainerStyle: {
...StyleSheet.absoluteFillObject,
alignItems: 'center',
justifyContent: 'center',
},
moreImagesContainer: {
alignItems: 'center',
justifyContent: 'center',
margin: 1,
},
moreImagesText: { color: '#FFFFFF', fontSize: 26, fontWeight: '700' },
});

export type GalleryPropsWithContext<
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
> = Pick<ImageGalleryContextValue<StreamChatGenerics>, 'setSelectedMessage' | 'setMessages'> &
Expand Down Expand Up @@ -468,18 +422,19 @@ const GalleryImageThumbnail = <

const {
theme: {
messageSimple: {
gallery: { image },
},
messageSimple: { gallery },
},
} = useTheme();

return (
<View
style={{
height: thumbnail.height - 1,
width: thumbnail.width - 1,
}}
style={[
{
height: thumbnail.height - 1,
width: thumbnail.width - 1,
},
gallery.thumbnail,
]}
>
{isLoadingImageError ? (
<>
Expand All @@ -502,7 +457,7 @@ const GalleryImageThumbnail = <
resizeMode={thumbnail.resizeMode}
style={[
borderRadius,
image,
gallery.image,
{
height: thumbnail.height - 1,
width: thumbnail.width - 1,
Expand Down Expand Up @@ -680,4 +635,50 @@ export const Gallery = <
);
};

const styles = StyleSheet.create({
errorTextSize: { fontSize: 10 },
galleryContainer: {
borderTopLeftRadius: 13,
borderTopRightRadius: 13,
flexDirection: 'row',
flexWrap: 'wrap',
overflow: 'hidden',
},
imageContainer: {
alignItems: 'center',
display: 'flex',
flexDirection: 'row',
justifyContent: 'center',
padding: 1,
},
imageContainerStyle: { alignItems: 'center', flex: 1, justifyContent: 'center' },
imageLoadingErrorIndicatorStyle: {
bottom: 4,
left: 4,
position: 'absolute',
},
imageLoadingIndicatorContainer: {
height: '100%',
justifyContent: 'center',
position: 'absolute',
width: '100%',
},
imageLoadingIndicatorStyle: {
alignItems: 'center',
justifyContent: 'center',
position: 'absolute',
},
imageReloadContainerStyle: {
...StyleSheet.absoluteFillObject,
alignItems: 'center',
justifyContent: 'center',
},
moreImagesContainer: {
alignItems: 'center',
justifyContent: 'center',
margin: 1,
},
moreImagesText: { color: '#FFFFFF', fontSize: 26, fontWeight: '700' },
});

Gallery.displayName = 'Gallery{messageSimple{gallery}}';
7 changes: 7 additions & 0 deletions package/src/components/Channel/Channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,9 @@ const ChannelWithContext = <
const clearQuotedMessageState: InputMessageInputContextValue<StreamChatGenerics>['clearQuotedMessageState'] =
() => setQuotedMessage(false);

/**
* Removes the message from local state
*/
const removeMessage: MessagesContextValue<StreamChatGenerics>['removeMessage'] = (message) => {
if (channel) {
channel.state.removeMessage(message);
Expand Down Expand Up @@ -1668,6 +1671,10 @@ const ChannelWithContext = <
}

if (!enableOfflineSupport) {
if (message.status === MessageStatusTypes.FAILED) {
removeMessage(message);
return;
}
await client.deleteMessage(message.id);
return;
}
Expand Down
2 changes: 2 additions & 0 deletions package/src/contexts/themeContext/utils/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ export type Theme = {
minWidth: number;
moreImagesContainer: ViewStyle;
moreImagesText: TextStyle;
thumbnail: ViewStyle;
};
giphy: {
buttonContainer: ViewStyle;
Expand Down Expand Up @@ -982,6 +983,7 @@ export const defaultTheme: Theme = {
minWidth: 170,
moreImagesContainer: {},
moreImagesText: {},
thumbnail: {},
},
giphy: {
buttonContainer: {},
Expand Down
Loading