Skip to content

Commit 95a9bb9

Browse files
authored
Merge pull request #1702 from GetStream/docs/fix-grammar-and-editing
docs: fix grammar and formatting
2 parents 86c252b + 650f28e commit 95a9bb9

File tree

3 files changed

+95
-88
lines changed

3 files changed

+95
-88
lines changed

docusaurus/docs/reactnative/basics/offline_support.mdx

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,49 @@ React Native Chat SDK provides OOTB support for offline mode, which means user w
88
with chat even when the network is off. This is an opt-in feature that needs to be explicitely enabled on application
99
level.
1010

11-
> Offline support is currently not supported for Expo package (stream-chat-expo).
11+
> Offline support is currently not implemented for Expo package (stream-chat-expo).
1212
1313
## Features
1414

15-
- ✅ Access to channel list and message list without network
16-
- ✅ Faster loading of chat since chat gets loaded from offline storage first before loading data from network
17-
- ✅ Syncing the local database using websocket events and sync api (once network is recovered)
18-
- ❌ Caching of image attachments
19-
- ❌ Optimistic updates to database on user action in offline mode e.g., send message, add reaction etc
15+
The offline storage implementation currently offers the following features:
16+
17+
- Access to chat when Internet connection is disabled or low.
18+
- Faster startup times and loading, since initial data is loaded from offline storage before performing any network requests.
19+
- Syncing of the offline database using WebSocket events and Sync API.
20+
21+
The following features are currently **NOT** implemented. They will be implemented gradually as part of minor releases in v5.
22+
23+
- Optimistically update offline database during chat interactions, such as send message, add reaction, etc.
24+
- Access to threads in offline mode.
25+
- Offline caching of attachment images and profile images.
2026

2127
## How To Enable Offline Support
2228

23-
- **Upgrade stream-chat dependency (optional)**
29+
First and foremost make sure to follow all steps from [Migrating to v5](./upgrade_helper.mdx) guide.
30+
To enable offline support, please follow the given steps:
2431

25-
If you have installed `stream-chat` dependency explicitely on your application, then upgrade it to v7
32+
1. **Upgrade stream-chat dependency (optional)**
2633

27-
```bash
28-
29-
```
34+
If you have installed `stream-chat` dependency explicitly on your application, then upgrade it to v7:
35+
36+
```bash
37+
38+
```
3039

31-
- **Add `react-native-quick-sqlite` dependency**
40+
2. **Add `react-native-quick-sqlite` dependency**
3241

33-
```bash
42+
```bash
3443
yarn add react-native-quick-sqlite
3544
npx pod-install
36-
```
37-
38-
- **Ensure unique instance of Chat component**
39-
40-
Until v4, you could provide separate `Chat` component for each usage of `Channel` component or `ChannelList` component.
41-
But from v5, it is necessary that you provide only one instance of `Chat` component within your application.
42-
This component needs to be a parent for all the chat related components such as `ChannelList`, `Channel` or `Thread`.
45+
```
4346

44-
- **Do not wait for `connectUser` call to succeed**
47+
3. **Do not wait for `connectUser` call to succeed**
4548

46-
It is important that you call `connectUser` method on chat client, before you render Chat components.
47-
But you don't need to wait for `connectUser` to succeed before rendering Chat components. This is to ensure:
49+
It is important that you call the `connectUser` method on the chat client, before you render Chat components.
50+
But you don't need to wait for `connectUser` to succeed before rendering Chat components. This is to ensure:
4851

49-
- Chat components have access to current user information, which is important to store/access offline data.
50-
- In case or slow or no network, Chat components will still load the chat data without waiting for connectUser to succeed.
52+
- Chat components have access to current user information, which is important to store/access offline data.
53+
- In case of slow or no network access, Chat components will still load the chat data without waiting for `connectUser` to succeed.
5154

5255
```tsx {7,8,16}
5356
const chatClient = StreamChat.getInstance('API_KEY');
@@ -75,26 +78,26 @@ level.
7578
};
7679
```
7780

78-
- **Add `enableOfflineSupport` prop on Chat component**
81+
4. **Add `enableOfflineSupport` prop on Chat component**
7982

80-
```tsx
81-
import { Chat } from 'stream-chat-react-native';
83+
```tsx
84+
import { Chat } from 'stream-chat-react-native';
8285

83-
<Chat client={chatClient} enableOfflineSupport>
84-
...
85-
</Chat>;
86-
```
86+
<Chat client={chatClient} enableOfflineSupport>
87+
...
88+
</Chat>;
89+
```
8790

88-
- **Reset the database when signing out the user**
91+
-5. **Reset the database when signing out the user**
8992

90-
Since SDK doesn't handle the app level authentication logic, its application's responsibility
91-
to ensure resetting database when user gets logged out. This should be generally done before you
92-
call `client.disconnectUser()`
93+
Since the SDK doesn't handle app-level authentication logic, it's the application's responsibility
94+
to ensure the database is reset when a user gets logged out. This should generally be done before you
95+
call `client.disconnectUser()`.
9396

94-
```jsx
95-
import { QuickSqliteClient } from 'stream-chat-react-native';
97+
```tsx
98+
import { QuickSqliteClient } from 'stream-chat-react-native';
9699

97-
// Sign out logic
98-
QuickSqliteClient.resetDB();
99-
chatClient.disconnectUser();
100-
```
100+
// Sign out logic
101+
QuickSqliteClient.resetDB();
102+
chatClient.disconnectUser();
103+
```

docusaurus/docs/reactnative/basics/upgrade_helper.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ title: Upgrading from V4
66
import Tabs from '@theme/Tabs';
77
import TabItem from '@theme/TabItem';
88

9+
This guide highlights the changes introduced from v4 to v5.
10+
911
## Prop or Context Changes
1012

11-
Following values in [`ImageGalleryContext`](https://getstream.io/chat/docs/sdk/reactnative/v5/contexts/image-gallery-context/#value) have been renamed
13+
The following values in [`ImageGalleryContext`](https://getstream.io/chat/docs/sdk/reactnative/v5/contexts/image-gallery-context/#value) have been renamed:
1214

1315
- `image` -> `selectedMessage`
1416
- `setImage` -> `setSelectedMessage`
@@ -17,27 +19,25 @@ Following values in [`ImageGalleryContext`](https://getstream.io/chat/docs/sdk/r
1719

1820
## Dependency Changes
1921

20-
- If you have installed `stream-chat` dependency explicitly on your application, then upgrade it to v7
22+
- If you have installed `stream-chat` dependency explicitly in your application, then upgrade it to v7:
2123

2224
```bash
2325
2426
```
2527

26-
- Replace [`@react-native-community/cameraroll`](https://github.com/react-native-cameraroll/react-native-cameraroll) dependency with [`@react-native-camera-roll/camera-roll`](https://www.npmjs.com/package/@react-native-camera-roll/camera-roll)
28+
- Replace [`@react-native-community/cameraroll`](https://github.com/react-native-cameraroll/react-native-cameraroll) dependency with [`@react-native-camera-roll/camera-roll`](https://www.npmjs.com/package/@react-native-camera-roll/camera-roll):
2729

2830
```bash
2931
yarn remove @react-native-community/cameraroll
3032
yarn add @react-native-camera-roll/camera-roll
3133
```
3234

33-
## Offline Support
34-
35-
Offline Support is a major opt-in feature introduced in v5 of SDK.
35+
## Unique Chat Component Instance
3636

37-
This feature allows users to:
37+
Until v4, you could provide a separate `Chat` component for each usage of `Channel` component or `ChannelList` component.
38+
But from v5, you must provide only one instance of the `Chat` component within your application.
39+
This component needs to be a parent for all the chat-related components such as `ChannelList`, `Channel` or `Thread`.
3840

39-
- access to chat when internet is disabled
40-
- faster loading of chat since chat gets loaded from offline storage first before loading data from network
41-
- syncing of database using websocket events and sync api.
41+
## Enable Offline Support
4242

4343
To enable offline support please check the [Offline Support](./offline_support.mdx) guide.

docusaurus/docs/reactnative/guides/debug_mode_using_flipper_plugin.mdx

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,63 +9,67 @@ import FlipperDesktopGuide from '../assets/guides/debug-mode-using-flipper-plugi
99

1010
## Overview
1111

12-
Flipper is a platform for debugging iOS, Android and React Native apps. You can debug Stream Chat within your application by using our interface within the Flipper Desktop app. This will help you analyze multiple parameters of the application which are a part of Stream Chat React Native interface.
12+
Flipper is a platform for debugging iOS, Android, and React Native apps. You can debug Stream Chat within your application using our Flipper Desktop app interface. This plugin will help you analyze multiple parameters of your application which are part of the Stream Chat React Native interface.
1313

1414
<img src={FlipperBanner} />
1515

16-
## Features:
16+
## Features
17+
18+
The plugin supports the following features:
1719

1820
- Viewing the authenticated client in the Chat.
19-
- Viewing the Channels, Message and Thread list data as we navigate through the screen.
21+
- Viewing the Channels, Message, and Thread list data as you navigate the app.
2022
- Copying and visualizing all the data.
2123

22-
These features are part of the 1st version of this plugin. More features will be added in the future, may you have any ideas/suggestions, please reach out via the [SDK's discussions page](https://github.com/GetStream/stream-chat-react-native/discussions)
24+
These features are part of the 1st version of this plugin; more features will be added in the future. If you have any ideas/suggestions, please reach out via the [SDK's discussions page](https://github.com/GetStream/stream-chat-react-native/discussions).
25+
26+
## Installation Instructions
2327

24-
## How to do so?
28+
1. First, install the Flipper plugin within your Desktop client. To do so, follow these steps:
2529

26-
- Firstly, you would need to install the Flipper plugin within your Desktop client. To do so, follow these steps:
30+
- Download the Flipper Desktop app from [here](https://fbflipper.com/).
31+
- After downloading the desktop app, move to the **Plugin Manager** section of the app and select the **Install Plugins** tab.
32+
- Search for **stream-chat-react-native**, and you will find the plugin.
33+
- Click on **Install** to install it.
2734

28-
- Download the Flipper Desktop app from [here](https://fbflipper.com/).
29-
- After downloading the desktop app, move to **Plugin Manager** section of the app and then select the **Install Plugins** tab.
30-
- Search for **stream-chat-react-native** and you will find this plugin.
31-
- Click on Install to install it.
35+
{' '}
3236

33-
<img src={FlipperDesktopGuide} />
37+
<img src={FlipperDesktopGuide} />
3438

35-
- Next, we will need to install `stream-chat-react-native-devtools` to your application as a dev dependency. This dependency will make communication possible between the RN Stream Chat SDK and the flipper plugin.
39+
2. Next, install `stream-chat-react-native-devtools` to your application as a dev dependency. This dependency will make communication possible between the RN Stream Chat SDK and the Flipper plugin.
3640

37-
```
38-
yarn add --dev stream-chat-react-native-devtools
39-
```
41+
```
42+
yarn add --dev stream-chat-react-native-devtools
43+
```
4044

41-
or
45+
or
4246

43-
```
44-
npm install --save-dev stream-chat-react-native-devtools
45-
```
47+
```
48+
npm install --save-dev stream-chat-react-native-devtools
49+
```
4650

47-
- To interact with the Flipper Plugin you need an additional dependency `react-native-flipper`. You can install it as a dev dependency, as:
51+
3. To interact with the Flipper Plugin you need an additional dependency `react-native-flipper`. You can install it as a dev dependency, as:
4852

49-
```
50-
yarn add --dev react-native-flipper
51-
```
53+
```
54+
yarn add --dev react-native-flipper
55+
```
5256

53-
or
57+
or
5458

55-
```
56-
npm install --save-dev react-native-flipper
57-
```
59+
```
60+
npm install --save-dev react-native-flipper
61+
```
5862

59-
- Wrap `DebugContextProvider` to the root of the component tree to the App component and pass the `useFlipper` function.
63+
4. Wrap the root of the component tree with `DebugContextProvider` and pass the `useFlipper` function.
6064

61-
```tsx
62-
import { DebugContextProvider } from 'stream-chat-react-native';
63-
import { useFlipper } from 'stream-chat-react-native-devtools';
64-
...
65+
```tsx
66+
import { DebugContextProvider } from 'stream-chat-react-native';
67+
import { useFlipper } from 'stream-chat-react-native-devtools';
68+
...
6569

66-
<DebugContextProvider useFlipper={useFlipper}>
67-
{/* All other elements of the App component comes here */}
68-
</DebugContextProvider>
69-
```
70+
<DebugContextProvider useFlipper={useFlipper}>
71+
{/* All other elements of the App component comes here */}
72+
</DebugContextProvider>
73+
```
7074

7175
Kudos 🎉, everything else is handled by our SDK, the package [stream-chat-react-native-devtools](https://www.npmjs.com/package/stream-chat-react-native-devtools), and the [Flipper Plugin](https://www.npmjs.com/package/flipper-plugin-stream-chat-react-native).

0 commit comments

Comments
 (0)