Skip to content

Commit 09b5251

Browse files
authored
fix: resolve conflicts from branch develop to v6 (#2621)
* fix: resolve conflicts from branch develop to v6 * fix: remove cameraroll on ts messaging app * fix: remove shared folder * chore: bump vale version * chore: bump vale version * chore: update vale version
1 parent 49ab5f4 commit 09b5251

File tree

161 files changed

+2762
-1657
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+2762
-1657
lines changed
445 KB
Loading

docusaurus/docs/reactnative/basics/installation.mdx

Lines changed: 245 additions & 55 deletions
Large diffs are not rendered by default.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Function to customize the behaviour when the [AttachButton](../../../../ui-components/attach-button.mdx) is pressed in the message input.
2+
3+
| Type |
4+
| ------------ |
5+
| `() => void` |

docusaurus/docs/reactnative/contexts/message-context.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ id: message-context
33
title: MessageContext
44
---
55

6-
import Disabled from '../common-content/contexts/channel-context/disabled.mdx';
7-
86
import Alignment from '../common-content/contexts/message-context/alignment.mdx';
97
import Files from '../common-content/contexts/message-context/files.mdx';
108
import GroupStyles from '../common-content/contexts/message-context/group_styles.mdx';
@@ -80,10 +78,6 @@ True if one of the following condition is true:
8078
| ------- |
8179
| boolean |
8280

83-
### disabled
84-
85-
<Disabled />
86-
8781
### files
8882

8983
<Files />

docusaurus/docs/reactnative/contexts/message-input-context.mdx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import DoDocUploadRequest from '../common-content/ui-components/channel/props/do
2626
import DoImageUploadRequest from '../common-content/ui-components/channel/props/do_image_upload_request.mdx';
2727
import EmojiSearchIndex from '../common-content/ui-components/channel/props/emoji_search_index.mdx';
2828
import FileUploadPreview from '../common-content/ui-components/channel/props/file_upload_preview.mdx';
29+
import HandleAttachButtonPress from '../common-content/ui-components/channel/props/handle_attach_button_press.mdx';
2930
import HasCameraPicker from '../common-content/ui-components/channel/props/has_camera_picker.mdx';
3031
import HasCommands from '../common-content/ui-components/channel/props/has_commands.mdx';
3132
import HasFilePicker from '../common-content/ui-components/channel/props/has_file_picker.mdx';
@@ -183,6 +184,10 @@ const { sendMessage, toggleAttachmentPicker } = useMessageInputContext();
183184

184185
<EmojiSearchIndex />
185186

187+
### <div class="label description">_forwarded from [Channel](../../core-components/channel#handleattachbuttonpress)_ props</div> `handleAttachButtonPress` {#handleAttachButtonPress}
188+
189+
<HandleAttachButtonPress />
190+
186191
### <div class="label description">_forwarded from [Channel](../../core-components/channel#hascamerapicker)_ props</div> `hasCameraPicker` {#hascamerapicker}
187192

188193
<HasCameraPicker />
@@ -239,17 +244,17 @@ const { sendMessage, toggleAttachmentPicker } = useMessageInputContext();
239244

240245
<SendMessage />
241246

242-
<!-- ### setInputRef -->
247+
{/* ### setInputRef */}
243248

244-
<!-- ### setQuotedMessageState -->
249+
{/* ### setQuotedMessageState */}
245250

246251
### `appendText`
247252

248253
<AppendText />
249254

250-
<!-- ### asyncIds -->
255+
{/* ### asyncIds */}
251256

252-
<!-- ### asyncUploads -->
257+
{/* ### asyncUploads */}
253258

254259
### closeAttachmentPicker
255260

@@ -283,9 +288,9 @@ const { sendMessage, toggleAttachmentPicker } = useMessageInputContext();
283288

284289
<NumberOfUploads />
285290

286-
<!-- ### onChange -->
291+
{/* ### onChange */}
287292

288-
<!-- ### onSelectItem -->
293+
{/* ### onSelectItem */}
289294

290295
### openAttachmentPicker
291296

@@ -303,7 +308,7 @@ const { sendMessage, toggleAttachmentPicker } = useMessageInputContext();
303308

304309
<OpenMentionsPicker />
305310

306-
<!-- ### pickFile -->
311+
{/* ### pickFile */}
307312

308313
### `removeFile`
309314

@@ -321,17 +326,17 @@ const { sendMessage, toggleAttachmentPicker } = useMessageInputContext();
321326

322327
<SelectedPicker />
323328

324-
<!-- ### sending -->
329+
{/* ### sending */}
325330

326-
<!-- ### sendMessageAsync -->
331+
{/* ### sendMessageAsync */}
327332

328333
### sendThreadMessageInChannel
329334

330335
<SendThreadMessageInChannel />
331336

332-
<!-- ### setAsyncIds -->
337+
{/* ### setAsyncIds */}
333338

334-
<!-- ### setAsyncUploads -->
339+
{/* ### setAsyncUploads */}
335340

336341
### setFileUploads
337342

docusaurus/docs/reactnative/core-components/channel.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import GetMessagesGroupStyles from '../common-content/ui-components/channel/prop
6363
import Giphy from '../common-content/ui-components/channel/props/giphy.mdx';
6464
import GiphyEnabled from '../common-content/ui-components/channel/props/giphy_enabled.mdx';
6565
import GiphyVersion from '../common-content/ui-components/channel/props/giphy_version.mdx';
66+
import HandleAttachButtonPress from '../common-content/ui-components/channel/props/handle_attach_button_press.mdx';
6667
import HandleBlock from '../common-content/ui-components/channel/props/handle_block.mdx';
6768
import HandleCopy from '../common-content/ui-components/channel/props/handle_copy.mdx';
6869
import HandleDelete from '../common-content/ui-components/channel/props/handle_delete.mdx';
@@ -481,6 +482,10 @@ The max allowable is 255, which when reached displays as `255+`.
481482

482483
<GiphyVersion />
483484

485+
### `handleAttachButtonPress`
486+
487+
<HandleAttachButtonPress />
488+
484489
### `handleBlock`
485490

486491
<HandleBlock />

docusaurus/docs/reactnative/customization/native-handlers.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ A function to open the document picker and return documents picked from it.
8686
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
8787
| [`react-native-document-picker`](https://github.com/rnmods/react-native-document-picker) | [`expo-document-picker`](https://docs.expo.io/versions/latest/sdk/document-picker/) |
8888

89+
### `pickImage`
90+
91+
A function to open the native image picker and return images picked from it.
92+
93+
| React Native CLI | Expo |
94+
| ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
95+
| [`react-native-image-picker`](https://github.com/react-native-image-picker/react-native-image-picker) | [`expo-image-picker`](https://docs.expo.io/versions/latest/sdk/imagepicker/) |
96+
8997
### `saveFile`
9098

9199
A function to save a file from a URL to local storage.
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
id: native-image-picker
3+
title: Native Image Picker
4+
---
5+
6+
import Tabs from '@theme/Tabs';
7+
import TabItem from '@theme/TabItem';
8+
9+
:::note
10+
This guide can help you to comply with the new Google Play's [android policy for photo and video permissions](https://support.google.com/googleplay/android-developer/answer/14115180?hl=en).
11+
:::
12+
13+
To enable the native image picker, you need to do the following steps and that would provide a native image picker for both iOS and Android.
14+
15+
### Step 1: Uninstall the media library
16+
17+
Uninstall the media library by running the following command(if you have already installed it) else choose not to install it at all as it is a optional dependency.
18+
19+
<Tabs
20+
defaultValue='rncli'
21+
groupId='rn-platform'
22+
values={[
23+
{ label: 'RN CLI', value: 'rncli' },
24+
{ label: 'Expo', value: 'expo' },
25+
]}
26+
>
27+
<TabItem value='rncli'>
28+
29+
```bash title="Terminal"
30+
yarn remove @react-native-camera-roll/camera-roll
31+
```
32+
33+
</TabItem>
34+
35+
<TabItem value='expo'>
36+
37+
```bash title="Terminal"
38+
yarn remove expo-media-library
39+
```
40+
41+
</TabItem>
42+
</Tabs>
43+
44+
### Step 2: Install the native image picker
45+
46+
Install the native image picker by running the following command:
47+
48+
<Tabs
49+
defaultValue='rncli'
50+
groupId='rn-platform'
51+
values={[
52+
{ label: 'RN CLI', value: 'rncli' },
53+
{ label: 'Expo', value: 'expo' },
54+
]}
55+
>
56+
<TabItem value='rncli'>
57+
58+
```bash title="Terminal"
59+
yarn add react-native-image-picker
60+
```
61+
62+
</TabItem>
63+
64+
<TabItem value='expo'>
65+
66+
```bash title="Terminal"
67+
npx expo install expo-image-picker
68+
```
69+
70+
</TabItem>
71+
</Tabs>
72+
73+
This shall give you a UI to select images from the gallery using native image picker or take a picture from the camera or alternatively select a file.
74+
75+
![](../assets/guides/native-image-picker/options.png)
76+
77+
:::note
78+
Please follow the post installation steps as mentioned in the [react-native-image-picker](https://github.com/react-native-image-picker/react-native-image-picker?tab=readme-ov-file#post-install-steps).
79+
:::
80+
81+
### Step 3: Add customization(if necessary)
82+
83+
You can customize what happens on clicking the [`AttachButton`](../ui-components/attach-button.mdx) by passing your own `onPress` function to the `handleAttachButtonPress` of the `Channel` component.
84+
85+
```jsx
86+
import { useCallback } from 'react';
87+
import { Channel } from 'stream-chat-react-native';
88+
89+
const App = () => {
90+
const handleAttachButtonPress = useCallback(async () => {
91+
// Your custom logic here
92+
}, []);
93+
94+
return <Channel channel={channel} handleAttachButtonPress={handleAttachButtonPress} />;
95+
};
96+
```
97+
98+
The other alternative is customizing the `AttachButton` component itself.
99+
100+
```jsx
101+
import { AttachButton } from 'stream-chat-react-native';
102+
103+
const CustomAttachButton = props => {
104+
const { onPress } = props;
105+
106+
const handlePress = async () => {
107+
// Your custom logic here
108+
};
109+
110+
return <AttachButton onPress={handlePress} />;
111+
};
112+
113+
const App = () => {
114+
return <Channel channel={channel} AttachButton={CustomAttachButton} />;
115+
};
116+
```

docusaurus/shared

Lines changed: 0 additions & 1 deletion
This file was deleted.

docusaurus/sidebars-react-native.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
"Advanced Guides": [
131131
"guides/audio-messages-support",
132132
"guides/date-time-formatting",
133+
"guides/native-image-picker",
133134
"customization/typescript",
134135
"basics/troubleshooting",
135136
"basics/stream_chat_with_navigation",

0 commit comments

Comments
 (0)