Skip to content

Commit 15b2dcf

Browse files
Nwagba OkechukwuNwagba Okechukwu
authored andcommitted
Merge branch 'develop' into Enigma-I-am/link-preview-component
2 parents 1d539bb + 02150d0 commit 15b2dcf

File tree

15 files changed

+86
-35
lines changed

15 files changed

+86
-35
lines changed

.github/workflows/check-pr.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Lint & Unit Tests
1+
name: Lint, Unit Tests, and Code Analysis
22

33
on:
44
pull_request:
@@ -13,6 +13,9 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v2
16+
with:
17+
# Disabling shallow clone is recommended for improving relevancy of reporting
18+
fetch-depth: 0
1619
- name: Use Node.js ${{ matrix.node-version }}
1720
uses: actions/setup-node@v2
1821
with:
@@ -25,3 +28,16 @@ jobs:
2528
run: yarn lerna-workspaces run lint && cd docusaurus && npx prettier --check '**/*.mdx'
2629
- name: Test
2730
run: yarn test:unit
31+
- name: SonarCloud Scan
32+
uses: sonarsource/sonarcloud-github-action@master
33+
with:
34+
args: >
35+
-Dsonar.organization=getstream
36+
-Dsonar.projectKey=GetStream_stream-chat-react-native
37+
-Dsonar.javascript.lcov.reportPaths=./package/coverage/lcov.info
38+
-Dsonar.sources=package/src/
39+
-Dsonar.test.exclusions=**/__tests__/**
40+
-Dsonar.verbose=true
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
[![NPM](https://img.shields.io/npm/v/stream-chat-react-native.svg)](https://www.npmjs.com/package/stream-chat-react-native)
1212
[![Build Status](https://github.com/GetStream/stream-chat-react-native/workflows/test/badge.svg?branch=main)](https://github.com/GetStream/stream-chat-react-native/actions)
1313
[![Component Reference](https://img.shields.io/badge/docs-component%20reference-blue.svg)](https://getstream.io/chat/docs/sdk/reactnative)
14+
[![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)
1415

1516
<img align="right" src="https://getstream.imgix.net/images/ios-chat-tutorial/[email protected]?auto=format,enhance" width="50%" />
1617

docusaurus/docs/reactnative/basics/getting_started.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Most if not all of the required packages now support auto-linking so setup shoul
6060
- [`react-native-safe-area-context`](https://github.com/th3rdwave/react-native-safe-area-context)
6161
- [`react-native-share`](https://github.com/react-native-share/react-native-share)
6262
- [`react-native-svg`](https://github.com/react-native-svg/react-native-svg)
63+
- [`react-native-video`](https://github.com/react-native-video/react-native-video)
6364

6465
<Tabs
6566
defaultValue='yarn'
@@ -71,14 +72,14 @@ Most if not all of the required packages now support auto-linking so setup shoul
7172
<TabItem value='yarn'>
7273

7374
```bash
74-
yarn add @react-native-community/cameraroll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-haptic-feedback react-native-haptic-feedback react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-safe-area-context react-native-share react-native-svg
75+
yarn add @react-native-community/cameraroll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-haptic-feedback react-native-haptic-feedback react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-safe-area-context react-native-share react-native-svg react-native-video
7576
```
7677

7778
</TabItem>
7879
<TabItem value='npm'>
7980

8081
```bash
81-
npm install @react-native-community/cameraroll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-haptic-feedback react-native-haptic-feedback react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-safe-area-context react-native-share react-native-svg
82+
npm install @react-native-community/cameraroll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-document-picker react-native-fs react-native-gesture-handler react-native-haptic-feedback react-native-haptic-feedback react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-safe-area-context react-native-share react-native-svg react-native-video
8283
```
8384

8485
</TabItem>
@@ -150,6 +151,7 @@ For some of the packages listed below, there are additional steps required to se
150151
- `react-native` - [additional installation steps](https://reactnative.dev/docs/image#gif-and-webp-support-on-android)
151152
- `react-native-image-crop-picker` - [additional installation steps](https://github.com/ivpusic/react-native-image-crop-picker#step-3)
152153
- `react-native-cameraroll` - [additional installation steps](https://github.com/react-native-cameraroll/react-native-cameraroll#permissions)
154+
- `react-native-video` - [additional installation steps](https://github.com/react-native-video/react-native-video/blob/master/API.md#installation)
153155

154156
:::note
155157

@@ -174,5 +176,5 @@ Stream Chat for React Native is set up for parity on Expo, expo requires a diffe
174176

175177
```bash
176178
expo install stream-chat-expo
177-
expo install @react-native-community/netinfo expo-document-picker expo-file-system expo-haptics expo-image-manipulator expo-image-picker expo-media-library expo-sharing react-native-gesture-handler react-native-reanimated react-native-safe-area-context react-native-svg
179+
expo install @react-native-community/netinfo expo-document-picker expo-file-system expo-haptics expo-image-manipulator expo-image-picker expo-media-library expo-sharing react-native-gesture-handler react-native-reanimated react-native-safe-area-context react-native-svg expo-av
178180
```

docusaurus/docs/reactnative/common-content/core-components/channel/props/on_press_message.mdx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,20 @@ For example:
2222

2323
```tsx
2424
<Channel
25-
onPressMessage={({ additionalInfo, defaultHandler, emitter }) => {
26-
if (emitter === 'textMention') {
27-
console.log(additionalInfo?.user);
28-
return;
29-
}
30-
defaultHandler?.();
31-
}}
25+
onPressMessage={({ additionalInfo, defaultHandler, emitter }) => {
26+
27+
if (emitter === 'textMention') {
28+
console.log(additionalInfo?.user);
29+
return;
30+
}
31+
32+
if (emitter === 'card' || emitter === 'textLink') {
33+
console.log(additionalInfo?.url);
34+
return;
35+
}
36+
37+
defaultHandler?.();
38+
}}
3239
>
3340
```
3441

examples/SampleApp/ios/SampleApp.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@
514514
CLANG_ENABLE_MODULES = YES;
515515
CODE_SIGN_ENTITLEMENTS = SampleApp/SampleAppDebug.entitlements;
516516
CODE_SIGN_IDENTITY = "iPhone Developer";
517-
CURRENT_PROJECT_VERSION = 109;
517+
CURRENT_PROJECT_VERSION = 113;
518518
DEVELOPMENT_TEAM = EHV7XZLAHA;
519519
ENABLE_BITCODE = NO;
520520
INFOPLIST_FILE = SampleApp/Info.plist;
@@ -545,7 +545,7 @@
545545
CODE_SIGN_ENTITLEMENTS = SampleApp/SampleAppRelease.entitlements;
546546
CODE_SIGN_IDENTITY = "iPhone Distribution";
547547
CODE_SIGN_STYLE = Manual;
548-
CURRENT_PROJECT_VERSION = 109;
548+
CURRENT_PROJECT_VERSION = 113;
549549
DEVELOPMENT_TEAM = EHV7XZLAHA;
550550
INFOPLIST_FILE = SampleApp/Info.plist;
551551
LD_RUNPATH_SEARCH_PATHS = (

examples/SampleApp/ios/SampleApp/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.5.0</string>
20+
<string>1.6.1</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>109</string>
24+
<string>113</string>
2525
<key>LSRequiresIPhoneOS</key>
2626
<true />
2727
<key>NSAppTransportSecurity</key>

examples/SampleApp/ios/SampleAppTests/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
<key>CFBundlePackageType</key>
1616
<string>BNDL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.5.0</string>
18+
<string>1.6.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>109</string>
22+
<string>113</string>
2323
</dict>
2424
</plist>

package/native-package/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,10 +1619,10 @@ source-map@^0.5.0:
16191619
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
16201620
integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=
16211621

1622-
stream-chat-react-native-core@4.3.1:
1623-
version "4.3.1"
1624-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-4.3.1.tgz#bc53a044c45b60f6bd3feb425e70100d077cc064"
1625-
integrity sha512-2DZO89EyDtXtmc5MhivD1kOOU6aklK/rgZVvo4RZ15419VlpVFqMjswvFAcF41z2ZJujP86cSSKg5YMhNy7uZw==
1622+
stream-chat-react-native-core@4.5.0:
1623+
version "4.5.0"
1624+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-4.5.0.tgz#7c74f542e66ef9028f3c303b9a5149db681df1ff"
1625+
integrity sha512-koDw3Nzw8mORGrSeL2JfHqXWFHWHdJLMrhd/UIuShDVJcZmxcPjvXoFUrMWMbu4C8yrlftcsKKmDGWlUzdSqaA==
16261626
dependencies:
16271627
"@babel/runtime" "^7.12.5"
16281628
"@gorhom/bottom-sheet" "4.1.5"

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"prepare-distribution": "cd examples/SampleApp && npm version patch && react-native-version && git add ./ && git commit -m 'Bump build version' --no-verify",
3535
"prettier": "prettier --list-different '**/*.{js,ts,tsx,md,json}' .eslintrc.json ../.prettierrc .babelrc",
3636
"prettier-fix": "prettier --write '**/*.{js,ts,tsx,md,json}' .eslintrc.json ../.prettierrc .babelrc",
37-
"test:unit": "TZ=UTC jest",
37+
"test:unit": "TZ=UTC jest --coverage",
3838
"validate-translations": "node bin/validate-translations.js",
3939
"get-version": "echo $npm_package_version",
4040
"version": "bash ./bin/before-tag.sh",

package/src/components/Attachment/Card.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ const CardWithContext = <
165165
onLongPress={(event) => {
166166
if (onLongPress) {
167167
onLongPress({
168+
additionalInfo: { url: og_scrape_url },
168169
emitter: 'card',
169170
event,
170171
});
@@ -173,6 +174,7 @@ const CardWithContext = <
173174
onPress={(event) => {
174175
if (onPress) {
175176
onPress({
177+
additionalInfo: { url: og_scrape_url },
176178
defaultHandler: defaultOnPress,
177179
emitter: 'card',
178180
event,
@@ -182,6 +184,7 @@ const CardWithContext = <
182184
onPressIn={(event) => {
183185
if (onPressIn) {
184186
onPressIn({
187+
additionalInfo: { url: og_scrape_url },
185188
defaultHandler: defaultOnPress,
186189
emitter: 'card',
187190
event,

0 commit comments

Comments
 (0)