Skip to content

Commit ad3de67

Browse files
Adjust README.md
1 parent 9e7073c commit ad3de67

File tree

1 file changed

+24
-27
lines changed

1 file changed

+24
-27
lines changed

README.md

+24-27
Original file line numberDiff line numberDiff line change
@@ -42,46 +42,36 @@ For complete pricing and details visit our [Chat Pricing Page](https://getstream
4242

4343
## Installation
4444

45-
### Install with NPM
45+
### With NPM
4646

47-
`npm install react react-dom stream-chat stream-chat-react`
47+
`npm install stream-chat stream-chat-react`
4848

49-
### Install with Yarn
49+
### With Yarn
5050

51-
`yarn add react react-dom stream-chat stream-chat-react`
51+
`yarn add stream-chat stream-chat-react`
5252

53-
### Install via CDN
5453

55-
```
56-
<script src="https://cdn.jsdelivr.net/npm/react@16.13.1/umd/react.production.min.js"></script>
57-
<script src="https://cdn.jsdelivr.net/npm/react-dom@16/umd/react-dom.production.min.js"></script>
58-
<script src="https://cdn.jsdelivr.net/npm/stream-chat"></script>
59-
<script src="https://cdn.jsdelivr.net/npm/stream-chat-react"></script>
60-
```
61-
62-
## Example Apps
54+
## Example Applications
6355

6456
We have built five demo applications showcasing a variety of chat use cases, including social messaging, team collaboration, customer support, livestream gaming, and virtual event. You can preview these [demos](https://getstream.io/chat/demos/) on our website. Also, the code is [open source](https://github.com/GetStream/website-react-examples/).
6557

66-
## Docs
58+
## Documentation
6759

6860
We use a doc generator to build our [component documentation](https://getstream.io/chat/docs/sdk/react/). We provide a brief description of each chat component and define all of the props it accepts.
6961

70-
The React components are created using the [stream-chat-js](https://github.com/getstream/stream-chat-js) library. If you're customizing the components, it's likely you'll need to make additional calls to our Chat API using our JavaScript client, which has [documentation](https://getstream.io/chat/docs/js/) on our website.
71-
72-
## TypeScript Support
73-
74-
As of version `5.0.0`, the component library has been converted to TypeScript. Please read the [TypeScript guide](https://github.com/GetStream/stream-chat-react/wiki/Typescript-support) for details and implementation assistance.
62+
The React components are created using the [stream-chat](https://github.com/getstream/stream-chat-js) library. If you're customizing the components, it's likely you'll need to make additional calls to our Chat API using our JavaScript client, which has [documentation](https://getstream.io/chat/docs/javascript/) on our website.
7563

7664
## Component Reusability
7765

78-
For components that implement significant logic, it's helpful to split the component into two parts: a top-level component which handles functionality and a lower level component which renders the UI. This way you can swap UI without altering the logic that gives the component its functionality. We use this provider/consumer pattern frequently in the library, and the below example shows how to swap out the `Message` UI component with `MessageTeam`, without affecting any logic in the app.
66+
For components that implement significant logic, it's helpful to split the component into two parts: a top-level component which handles functionality and a lower level component which renders the UI. This way you can swap UI without altering the logic that gives the component its functionality. We use this provider/consumer pattern frequently in the library, and the below example shows how to swap out the `Message` UI component with `CustomMessageUI` (using `WithComponents`), without affecting any logic in the application.
7967

8068
```jsx
81-
<Channel Message={MessageTeam}>
69+
<Channel>
8270
<Window>
8371
<ChannelHeader />
84-
<MessageList />
72+
<WithComponents overrides={{Message: CustomMessageUI}}>
73+
<MessageList />
74+
</WithComponents>
8575
<MessageInput />
8676
</Window>
8777
<Thread />
@@ -90,11 +80,18 @@ For components that implement significant logic, it's helpful to split the compo
9080

9181
### Customizing Styles
9282

93-
The preferred method for overriding the pre-defined styles in the library is to two-step process. First, import our bundled CSS into the file where you instantiate your chat application. Second, locate any Stream styles you want to override using either the browser inspector or by viewing the library code. You can then add selectors to your local CSS file to override our defaults. For example:
83+
The preferred method for overriding the pre-defined styles in the library is to two-step process. First, import our bundled CSS into your main CSS file (or CSS file loaded with your chat application). Second, locate any Stream styles you want to override using either the browser inspector or by viewing the library code. You can then add selectors to your local CSS file to override our defaults (ideally within the stream-overrides layer). Layers (when ordered correctly, see example) ensure that your overrides take precedence even if your overriding selectors are less specific. For example:
84+
85+
```css title="index.css"
86+
@layer stream, stream-overrides;
87+
88+
@import "stream-chat-react/css/v2/index.css" layer(stream);
89+
/* or */
90+
@import "stream-chat-react/dist/css/v2/index.css" layer(stream);
9491

95-
```js
96-
import 'stream-chat-react/dist/css/v2/index.css';
97-
import './App.css';
92+
@layer stream-overrides {
93+
/* your overrides */
94+
}
9895
```
9996

10097
## Internationalization
@@ -113,7 +110,7 @@ Check out our current openings and apply via [Stream's website](https://getstrea
113110

114111
## Acknowledgements
115112

116-
### Lamejs
113+
### lamejs
117114

118115
This project uses `lamejs` library under the LGPL license to convert the recorded audio to mp3 format.
119116
The library source code is dynamically imported and used only if audio recording is enabled.

0 commit comments

Comments
 (0)