Skip to content

Commit 996c911

Browse files
authored
Merge pull request #11 from xometry/upgrade_SCR_from_upstream
upgrade xometry/stream-chat-react from upstream
2 parents be2eabb + 228a36c commit 996c911

File tree

123 files changed

+12243
-18984
lines changed

Some content is hidden

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

123 files changed

+12243
-18984
lines changed

.eslintrc.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
2-
"plugins": ["babel", "markdown"],
3-
"extends": ["eslint:recommended", "plugin:react/recommended"],
2+
"plugins": ["babel", "markdown", "sonarjs"],
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:react/recommended",
6+
"plugin:sonarjs/recommended"
7+
],
48
"rules": {
59
"no-console": 0,
610
"no-class-assign": 0,
@@ -22,7 +26,8 @@
2226
"react/prop-types": 0,
2327
"no-var": 2,
2428
"linebreak-style": [2, "unix"],
25-
"semi": [1, "always"]
29+
"semi": [1, "always"],
30+
"sonarjs/cognitive-complexity": ["error", 30]
2631
},
2732
"env": {
2833
"es6": true,

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
language: node_js
22
node_js:
3+
- 10
34
- 11
5+
- 12
6+
- 13
7+
before_install:
8+
- npm install -g yarn
49
script:
510
- yarn lint
611
# - yarn test
712
- yarn docs
8-

CHANGELOG.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,66 @@
11
# Changelog
22

3+
## [0.8.1](https://github.com/GetStream/stream-chat-react/releases/tag/v0.8.1) 2020-02-07
4+
5+
- Fixing broken typescript file [cc86f6f](https://github.com/GetStream/stream-chat-react/commit/cc86f6fea998e8581121c7da42870b0c5d316d8c)
6+
7+
## [0.8.0](https://github.com/GetStream/stream-chat-react/releases/tag/v0.8.0) 2020-02-07
8+
9+
- Updated dependencies [dfe466d](https://github.com/GetStream/stream-chat-react/commit/dfe466d43e75b7213857fdf9a6e007ecfc3d4614)
10+
- Exported all the components and updated typescript types - [41e478f](https://github.com/GetStream/stream-chat-react/commit/41e478fc1d37aad8994b9b1075ce9a576a1497f0)
11+
12+
## [0.7.20](https://github.com/GetStream/stream-chat-react/releases/tag/v0.7.20) 2020-01-14
13+
14+
- When you change the filters prop on the ChannelList component this now we will refresh the channels with the new query
15+
16+
## [0.7.17](https://github.com/GetStream/stream-chat-react/releases/tag/v0.7.17) 2020-01-02
17+
18+
- Added `maxRows` props to MessageInput component
19+
20+
## [0.7.16](https://github.com/GetStream/stream-chat-react/releases/tag/v0.7.16) 2020-01-02
21+
22+
- Removed inline styles from multiple locations
23+
- Exporting new component `ChatAutoComplete` (Advanced usage only)
24+
25+
## [0.7.15](https://github.com/GetStream/stream-chat-react/releases/tag/v0.7.15) 2019-12-30
26+
27+
- Added the following props on the `Thread` component so the underlying MessageList, MessageInput and Message components can be customized using props:
28+
- `additionalParentMessageProps`
29+
- `additionalMessageListProps`
30+
- `additionalMessageInputProps`
31+
- Added the following props to the `Channel` component:
32+
- `doUpdateMessageRequest` to override the update(edit) message request (Advanced usage only)
33+
- `doSendMessageRequest` to override the send message request (Advanced usage only)
34+
35+
## [0.7.13](https://github.com/GetStream/stream-chat-react/releases/tag/v0.7.13) 2019-12-03
36+
37+
- Handling and updating channel list on `channel.truncated` and `channel.deleted` event.
38+
39+
## [0.7.12](https://github.com/GetStream/stream-chat-react/releases/tag/v0.7.12) 2019-11-22
40+
41+
- Adding prop `MessageSystem` to customize system messages
42+
43+
## [0.7.11](https://github.com/GetStream/stream-chat-react/releases/tag/v0.7.11) 2019-11-05
44+
45+
- Fixed z-index issue on MessageInputLarge component https://github.com/GetStream/stream-chat-react/commit/f78b0bf6566fe587da62a8162ab5f1b3d799a10e
46+
47+
## [0.7.10](https://github.com/GetStream/stream-chat-react/releases/tag/v0.7.10) 2019-10-16
48+
49+
- Added `customActiveChannel` prop on `ChannelList` to specify a custom channel to be moved to the top and set to active upon mounting.
50+
51+
## [0.7.9](https://github.com/GetStream/stream-chat-react/releases/tag/v0.7.9) 2019-10-16
52+
53+
- Changing prop name for MessageSimple from openThread to handleOpenThread.
54+
- Fixing scroll issue on messagelist. Related to issue [#67](https://github.com/GetStream/stream-chat-react/issues/67)
55+
56+
## [0.7.8](https://github.com/GetStream/stream-chat-react/releases/tag/v0.7.8) 2019-10-11
57+
58+
- Bug fix with dateseperator in messagelist
59+
60+
## [0.7.7](https://github.com/GetStream/stream-chat-react/releases/tag/v0.7.7) 2019-10-11
61+
62+
- Adding intro message to messagelist
63+
364
## [0.7.6](https://github.com/GetStream/stream-chat-react/releases/tag/v0.7.6) 2019-10-08
465

566
- Fixed unbinding of visibility listener

README.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
## React Chat Components
1+
# React Chat Components
2+
3+
<a href="https://getstream.io/chat/react-chat/tutorial/"><img src="https://i.imgur.com/SRkDlFX.png" alt="react native chat" /></a>
24

35
> The official React components for Stream Chat, a service for
46
> building chat applications.
@@ -7,7 +9,11 @@
79
[![Build Status](https://travis-ci.org/GetStream/stream-chat-react.svg?branch=master)](https://travis-ci.org/GetStream/stream-chat-react)
810
[![Component Reference](https://img.shields.io/badge/docs-component%20reference-blue.svg)](https://getstream.github.io/stream-chat-react/)
911

10-
You can sign up for a Stream account at https://getstream.io/chat/get_started/.
12+
**Quick Links**
13+
14+
- [Register](https://getstream.io/chat/trial/) to get an API key for Stream Chat
15+
- [React Chat Tutorial](https://getstream.io/chat/react-chat/tutorial/)
16+
- [Chat UI Kit](https://getstream.io/chat/ui-kit/)
1117

1218
With these chat components you can support any type of chat use case:
1319

@@ -17,22 +23,36 @@ With these chat components you can support any type of chat use case:
1723
- Messaging style chat like Whatsapp or Facebook's messenger
1824
- Commerce chat like Drift or Intercom
1925

20-
### React Chat Tutorial & Docs
26+
## React Chat Tutorial
27+
28+
The best place to start is the [React Chat Tutorial](https://getstream.io/chat/react-chat/tutorial/). It teaches you how to use this SDK and also shows how to make common changes.
29+
30+
## Example Apps
31+
32+
This repo includes 4 example apps. You can try them out like this:
33+
34+
```
35+
git clone [email protected]:GetStream/stream-chat-react.git
36+
cd examples/messaging
37+
yarn
38+
yarn start
39+
```
40+
41+
The 4 examples are `messaging`, `team`, `commerce` and `livestream`. You can also preview these demos online in the [Chat Demos](https://getstream.io/chat/demos/)
2142

22-
The best place to start is the React Chat Tutorial
43+
## Docs
2344

24-
You'll also want to review the React Chat Component Documentation.
45+
The [styleguidist docs for stream-chat-react](https://getstream.github.io/stream-chat-react/) document how all the components work.
2546

26-
If you're customizing the components it's important to learn how the Chat Server API works.
27-
You can read about that in the Chat API docs.
47+
The React components are created using the stream-chat-js library. If you're customizing the components it's important to learn how the Chat Server API works. You'll want to review our [JS chat API docs](https://getstream.io/chat/docs/js/).
2848

29-
### Commands
49+
## Commands
3050

3151
- yarn docs-server
3252
- yarn lint-fix
3353
- yarn lint
3454

35-
### Component Reusability
55+
## Component Reusability
3656

3757
1. If a component implements a ton of logic it's nice if you split it out into 2 Components
3858
The top level component which handles all the logic, and a lower level component which just handles rendering.
@@ -61,7 +81,7 @@ You can read about that in the Chat API docs.
6181
- Make the changes you want in the scss files
6282
- Run `yarn build-styles` or `yarn watch-styles`
6383

64-
### Performance
84+
## Performance
6585

6686
Since chat can get pretty active it's important to pay attention to performance.
6787
For every component either:
@@ -96,6 +116,6 @@ Common mistakes that hurt performance are:
96116
- Mistake: Passing an object {} or an array [] that's not using seamless-immutable
97117
- Solution: Use an immutable type (ie a number or a string) or use a seamless immutable version of an object or an array
98118

99-
### Contributing
119+
## Contributing
100120

101121
We welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our [Contributor License Agreement (CLA)](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) first. See our license file for more details.

docs/build/0.468737e0.js

Lines changed: 0 additions & 115 deletions
This file was deleted.

docs/build/bundle.a394a8cb.js

Lines changed: 0 additions & 13167 deletions
This file was deleted.

docs/build/bundle.af9ae501.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/build/bundle.af9ae501.js.LICENSE.txt

Lines changed: 6971 additions & 0 deletions
Large diffs are not rendered by default.

docs/index.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
<!DOCTYPE html><html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>React Chat - Docs</title><link rel="icon" type="image/x-icon" href="https://getstream.imgix.net/images/favicons/favicon-96x96.png"></head><body><div id="rsg-root"></div><script src="build/bundle.a394a8cb.js"></script></body></html>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>React Chat - Docs</title>
8+
<link rel="icon" type="image/x-icon" href="https://getstream.imgix.net/images/favicons/favicon-96x96.png">
9+
</head>
10+
<body>
11+
<div id="rsg-root"></div>
12+
<script src="build/bundle.af9ae501.js"></script>
13+
</body>
14+
</html>

examples/commerce/README.md

Lines changed: 14 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,20 @@
1-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
1+
# Stream Chat Customer Support Example App
22

3-
## Available Scripts
3+
Support teams require reliable chat that is available for every visitor. Build engaging chat with an infrastructure as a service you can trust to make sure every question gets an answer, and every visitor can convert to a customer.
44

5-
In the project directory, you can run:
5+
- Reliability
6+
- Custom Message Types
7+
- Bot automation and forms
68

7-
### `npm start`
9+
To run this example on your machine simply run:
810

9-
Runs the app in the development mode.<br>
10-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11+
```
12+
yarn && yarn start
13+
```
1114

12-
The page will reload if you make edits.<br>
13-
You will also see any lint errors in the console.
15+
**Quick Links**
1416

15-
### `npm test`
16-
17-
Launches the test runner in the interactive watch mode.<br>
18-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19-
20-
### `npm run build`
21-
22-
Builds the app for production to the `build` folder.<br>
23-
It correctly bundles React in production mode and optimizes the build for the best performance.
24-
25-
The build is minified and the filenames include the hashes.<br>
26-
Your app is ready to be deployed!
27-
28-
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29-
30-
### `npm run eject`
31-
32-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33-
34-
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35-
36-
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37-
38-
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39-
40-
## Learn More
41-
42-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43-
44-
To learn React, check out the [React documentation](https://reactjs.org/).
45-
46-
### Code Splitting
47-
48-
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49-
50-
### Analyzing the Bundle Size
51-
52-
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53-
54-
### Making a Progressive Web App
55-
56-
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57-
58-
### Advanced Configuration
59-
60-
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61-
62-
### Deployment
63-
64-
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65-
66-
### `npm run build` fails to minify
67-
68-
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
17+
- [Component Reference](https://getstream.github.io/stream-chat-react/)
18+
- [Register](https://getstream.io/chat/trial/) to get an API key for Stream Chat
19+
- [React Chat Tutorial](https://getstream.io/chat/react-chat/tutorial/)
20+
- [Chat UI Kit](https://getstream.io/chat/ui-kit/)

examples/commerce/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"react": "^16.7.0",
77
"react-dom": "^16.7.0",
88
"react-scripts": "2.1.4",
9-
"stream-chat-react": "link:../.."
9+
"stream-chat-react": "0.7.12"
1010
},
1111
"scripts": {
1212
"start": "react-scripts start",

examples/commerce/src/App.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ body {
2424
display: flex;
2525
align-items: flex-end;
2626
}
27+
.str-chat.commerce {
28+
background: none;
29+
}
2730

2831
.str-chat-channel .str-chat__container {
2932
height: auto;

examples/commerce/src/App.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* globals process */
21
import React, { Component } from 'react';
32
import { StreamChat } from 'stream-chat';
43
import {
@@ -16,24 +15,24 @@ import 'stream-chat-react/dist/css/index.css';
1615
import './App.css';
1716

1817
const urlParams = new URLSearchParams(window.location.search);
19-
const user =
20-
urlParams.get('user') || process.env.REACT_APP_CHAT_API_DEFAULT_USER;
18+
// const user =
19+
// urlParams.get('user') || process.env.REACT_APP_CHAT_API_DEFAULT_USER;
2120
const theme = urlParams.get('theme') || 'light';
2221
const channelName = urlParams.get('channel') || 'demo';
23-
const userToken =
24-
urlParams.get('user_token') ||
25-
process.env.REACT_APP_CHAT_API_DEFAULT_USER_TOKEN;
22+
// const userToken =
23+
// urlParams.get('user_token') ||
24+
// process.env.REACT_APP_CHAT_API_DEFAULT_USER_TOKEN;
2625

2726
class App extends Component {
2827
constructor(props) {
2928
super(props);
30-
this.chatClient = new StreamChat(process.env.REACT_APP_CHAT_API_KEY);
31-
this.chatClient.setBaseURL(process.env.REACT_APP_CHAT_SERVER_ENDPOINT);
29+
this.chatClient = new StreamChat('qk4nn7rpcn75');
30+
// this.chatClient.setBaseURL(process.env.REACT_APP_CHAT_SERVER_ENDPOINT);
3231
this.chatClient.setUser(
3332
{
34-
id: user,
33+
id: 'example-user',
3534
},
36-
userToken,
35+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiZXhhbXBsZS11c2VyIn0.HlC0dMKL43y3K_XbfvQS_Yc3V314HU4Z7LrBLil777g',
3736
);
3837
this.channel = this.chatClient.channel('messaging', channelName, {
3938
image: 'https://i.stack.imgur.com/e7G42m.jpg',

0 commit comments

Comments
 (0)