Skip to content

Commit 3932177

Browse files
authored
Merge pull request #682 from GetStream/feature/pinned-messages
Feature/pinned messages
2 parents 93ab582 + 890acb7 commit 3932177

Some content is hidden

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

43 files changed

+907
-349
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ babel.i18next-extract.js
1717
/built
1818
/coverage
1919
types/index.d.ts
20+
src/components/Channel/types.ts

examples/team/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"react": "^16.12.0",
77
"react-dom": "^16.12.0",
88
"react-scripts": "2.1.4",
9-
"stream-chat": "^2.3.0",
9+
"stream-chat": "^2.11.5",
1010
"stream-chat-react": "^2.4.1"
1111
},
1212
"scripts": {

examples/team/src/App.js

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable */
21
import React, { Component } from 'react';
32
import { StreamChat } from 'stream-chat';
43
import {
@@ -18,18 +17,13 @@ import 'stream-chat-react/dist/css/index.css';
1817
import './App.css';
1918

2019
const urlParams = new URLSearchParams(window.location.search);
21-
// const user =
22-
// urlParams.get('user') || process.env.REACT_APP_CHAT_API_DEFAULT_USER;
20+
const user = urlParams.get('user') || process.env.REACT_APP_USER_ID;
2321
const theme = urlParams.get('theme') || 'light';
24-
// const userToken =
25-
// urlParams.get('user_token') ||
26-
// process.env.REACT_APP_CHAT_API_DEFAULT_USER_TOKEN;
22+
const userToken =
23+
urlParams.get('user_token') || process.env.REACT_APP_USER_TOKEN;
2724

28-
const filters = { type: 'team', example: 1 };
29-
const sort = {
30-
last_message_at: -1,
31-
cid: 1,
32-
};
25+
const filters = { type: 'team' };
26+
const sort = { last_message_at: -1, cid: 1 };
3327
const options = {
3428
member: true,
3529
watch: true,
@@ -43,16 +37,11 @@ const Paginator = (props) => (
4337
class App extends Component {
4438
constructor(props) {
4539
super(props);
46-
this.chatClient = new StreamChat('qk4nn7rpcn75');
40+
this.chatClient = new StreamChat(process.env.REACT_APP_STREAM_KEY);
4741
if (process.env.REACT_APP_CHAT_SERVER_ENDPOINT) {
4842
this.chatClient.setBaseURL(process.env.REACT_APP_CHAT_SERVER_ENDPOINT);
4943
}
50-
this.chatClient.setUser(
51-
{
52-
id: 'example-user',
53-
},
54-
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiZXhhbXBsZS11c2VyIn0.HlC0dMKL43y3K_XbfvQS_Yc3V314HU4Z7LrBLil777g',
55-
);
44+
this.chatClient.setUser({ id: user }, userToken);
5645
}
5746

5847
render() {

examples/team/yarn.lock

Lines changed: 67 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@
854854
dependencies:
855855
regenerator-runtime "^0.13.4"
856856

857-
"@babel/runtime@^7.1.2", "@babel/runtime@^7.3.1":
857+
"@babel/runtime@^7.1.2":
858858
version "7.4.5"
859859
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.5.tgz#582bb531f5f9dc67d2fcb682979894f75e253f12"
860860
integrity sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==
@@ -868,6 +868,13 @@
868868
dependencies:
869869
regenerator-runtime "^0.13.4"
870870

871+
"@babel/runtime@^7.12.5":
872+
version "7.12.5"
873+
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e"
874+
integrity sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==
875+
dependencies:
876+
regenerator-runtime "^0.13.4"
877+
871878
"@babel/template@^7.1.0", "@babel/template@^7.2.2", "@babel/template@^7.4.4":
872879
version "7.4.4"
873880
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237"
@@ -1061,6 +1068,13 @@
10611068
resolved "https://registry.yarnpkg.com/@types/domhandler/-/domhandler-2.4.1.tgz#7b3b347f7762180fbcb1ece1ce3dd0ebbb8c64cf"
10621069
integrity sha512-cfBw6q6tT5sa1gSPFSRKzF/xxYrrmeiut7E0TxNBObiLSBTuFEHibcfEe3waQPEDbqBsq+ql/TOniw65EyDFMA==
10631070

1071+
"@types/jsonwebtoken@^8.5.0":
1072+
version "8.5.0"
1073+
resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-8.5.0.tgz#2531d5e300803aa63279b232c014acf780c981c5"
1074+
integrity sha512-9bVao7LvyorRGZCw0VmH/dr7Og+NdjYSsKAxB43OQoComFbBgsEpoR9JW6+qSq/ogwVBg8GI2MfAlk4SYI4OLg==
1075+
dependencies:
1076+
"@types/node" "*"
1077+
10641078
"@types/node@*":
10651079
version "12.0.12"
10661080
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.12.tgz#cc791b402360db1eaf7176479072f91ee6c6c7ca"
@@ -1084,6 +1098,11 @@
10841098
"@types/prop-types" "*"
10851099
csstype "^2.2.0"
10861100

1101+
1102+
version "7.1.13"
1103+
resolved "https://registry.yarnpkg.com/@types/seamless-immutable/-/seamless-immutable-7.1.13.tgz#dc8d645914086300e49410c72f6e5fae902fdbc5"
1104+
integrity sha512-kvgsr2sI8NBtxgR+YZNgSk0S+isAtS77TKtITUCGcNHlwYERrvgv6DbLER4TbvUK4/Qclm8C9jXzHqegpV2Ikg==
1105+
10871106
10881107
version "1.0.2"
10891108
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.2.tgz#e13182e1b69871a422d7863e11a4a6f5b814a4bd"
@@ -1111,6 +1130,13 @@
11111130
"@types/unist" "*"
11121131
"@types/vfile-message" "*"
11131132

1133+
"@types/ws@^7.4.0":
1134+
version "7.4.0"
1135+
resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.0.tgz#499690ea08736e05a8186113dac37769ab251a0e"
1136+
integrity sha512-Y29uQ3Uy+58bZrFLhX36hcI3Np37nqWE7ky5tjiDoy1GDZnIwVxS0CgF+s+1bXMzjKBFy+fqaRfb708iNzdinw==
1137+
dependencies:
1138+
"@types/node" "*"
1139+
11141140
"@webassemblyjs/[email protected]":
11151141
version "1.7.11"
11161142
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.7.11.tgz#b988582cafbb2b095e8b556526f30c90d057cace"
@@ -1652,13 +1678,12 @@ aws4@^1.8.0:
16521678
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
16531679
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
16541680

1655-
axios@^0.18.1:
1656-
version "0.18.1"
1657-
resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.1.tgz#ff3f0de2e7b5d180e757ad98000f1081b87bcea3"
1658-
integrity sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g==
1681+
axios@^0.21.1:
1682+
version "0.21.1"
1683+
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8"
1684+
integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==
16591685
dependencies:
1660-
follow-redirects "1.5.10"
1661-
is-buffer "^2.0.2"
1686+
follow-redirects "^1.10.0"
16621687

16631688
axobject-query@^2.0.1:
16641689
version "2.0.2"
@@ -1935,10 +1960,10 @@ base64-js@^1.0.2:
19351960
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3"
19361961
integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==
19371962

1938-
base64-js@^1.3.1:
1939-
version "1.3.1"
1940-
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1"
1941-
integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==
1963+
base64-js@^1.5.1:
1964+
version "1.5.1"
1965+
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
1966+
integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
19421967

19431968
base@^0.11.1:
19441969
version "0.11.2"
@@ -2553,7 +2578,7 @@ color@^3.0.0:
25532578
color-convert "^1.9.1"
25542579
color-string "^1.5.2"
25552580

2556-
combined-stream@^1.0.6, combined-stream@~1.0.6:
2581+
combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6:
25572582
version "1.0.8"
25582583
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
25592584
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
@@ -3122,13 +3147,6 @@ [email protected], debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6.
31223147
dependencies:
31233148
ms "2.0.0"
31243149

3125-
debug@=3.1.0:
3126-
version "3.1.0"
3127-
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
3128-
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
3129-
dependencies:
3130-
ms "2.0.0"
3131-
31323150
debug@^3.1.0, debug@^3.2.5, debug@^3.2.6:
31333151
version "3.2.6"
31343152
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
@@ -4229,18 +4247,16 @@ focus-lock@^0.6.7:
42294247
resolved "https://registry.yarnpkg.com/focus-lock/-/focus-lock-0.6.8.tgz#61985fadfa92f02f2ee1d90bc738efaf7f3c9f46"
42304248
integrity sha512-vkHTluRCoq9FcsrldC0ulQHiyBYgVJB2CX53I8r0nTC6KnEij7Of0jpBspjt3/CuNb6fyoj3aOh9J2HgQUM0og==
42314249

4232-
4233-
version "1.5.10"
4234-
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a"
4235-
integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==
4236-
dependencies:
4237-
debug "=3.1.0"
4238-
42394250
follow-redirects@^1.0.0:
42404251
version "1.13.0"
42414252
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db"
42424253
integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==
42434254

4255+
follow-redirects@^1.10.0:
4256+
version "1.13.1"
4257+
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.1.tgz#5f69b813376cee4fd0474a3aba835df04ab763b7"
4258+
integrity sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==
4259+
42444260
for-in@^0.1.3:
42454261
version "0.1.8"
42464262
resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.8.tgz#d8773908e31256109952b1fdb9b3fa867d2775e1"
@@ -4283,13 +4299,13 @@ [email protected]:
42834299
semver "^5.6.0"
42844300
tapable "^1.0.0"
42854301

4286-
form-data@^2.3.3:
4287-
version "2.5.0"
4288-
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.0.tgz#094ec359dc4b55e7d62e0db4acd76e89fe874d37"
4289-
integrity sha512-WXieX3G/8side6VIqx44ablyULoGruSde5PNTxoUyo5CeyAMX6nVWUd0rgist/EuX655cjhUhTo1Fo3tRYqbcA==
4302+
form-data@^3.0.0:
4303+
version "3.0.0"
4304+
resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682"
4305+
integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==
42904306
dependencies:
42914307
asynckit "^0.4.0"
4292-
combined-stream "^1.0.6"
4308+
combined-stream "^1.0.8"
42934309
mime-types "^2.1.12"
42944310

42954311
form-data@~2.3.2:
@@ -5239,7 +5255,7 @@ is-buffer@^1.0.2, is-buffer@^1.1.4, is-buffer@^1.1.5:
52395255
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
52405256
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
52415257

5242-
is-buffer@^2.0.0, is-buffer@^2.0.2:
5258+
is-buffer@^2.0.0:
52435259
version "2.0.3"
52445260
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725"
52455261
integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==
@@ -6143,7 +6159,7 @@ jsonify@~0.0.0:
61436159
resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
61446160
integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=
61456161

6146-
jsonwebtoken@^8.3.0:
6162+
jsonwebtoken@^8.5.1:
61476163
version "8.5.1"
61486164
resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz#00e71e0b8df54c2121a1f26137df2280673bcc0d"
61496165
integrity sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==
@@ -9856,20 +9872,22 @@ stream-chat-react@^2.4.1:
98569872
textarea-caret "^3.1.0"
98579873
uuid "^7.0.3"
98589874

9859-
stream-chat@^2.3.0:
9860-
version "2.3.0"
9861-
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-2.3.0.tgz#5ebe22e4078ee9bd52ceb704f7b3f4b6e2073923"
9862-
integrity sha512-L7evlsIyTFpi3/rhwAdQvEXVDzUngxGAo6HV03DTKKAVh4/tu2jKEID+Lv1fCISoJshlwcSXf54ppwvWY/ASSw==
9863-
dependencies:
9864-
"@babel/runtime" "^7.3.1"
9865-
axios "^0.18.1"
9866-
base64-js "^1.3.1"
9867-
form-data "^2.3.3"
9875+
stream-chat@^2.11.5:
9876+
version "2.11.5"
9877+
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-2.11.5.tgz#9c9aa312cb324837d62f270e89d9102d866f19dc"
9878+
integrity sha512-WFFZRCGm5oeTwtWcbhlXExCJCP/VyO6UZP8nMtGvQLAsvDnzInvTzNVc96uQewYhv+/7mxGv3zDZq8GzjebGTw==
9879+
dependencies:
9880+
"@babel/runtime" "^7.12.5"
9881+
"@types/jsonwebtoken" "^8.5.0"
9882+
"@types/seamless-immutable" "7.1.13"
9883+
"@types/ws" "^7.4.0"
9884+
axios "^0.21.1"
9885+
base64-js "^1.5.1"
9886+
form-data "^3.0.0"
98689887
isomorphic-ws "^4.0.1"
9869-
jsonwebtoken "^8.3.0"
9888+
jsonwebtoken "^8.5.1"
98709889
seamless-immutable "^7.1.4"
9871-
uuid "^3.3.2"
9872-
ws "^6.1.3"
9890+
ws "^7.4.2"
98739891

98749892
stream-each@^1.1.0:
98759893
version "1.2.3"
@@ -11186,12 +11204,10 @@ ws@^5.2.0:
1118611204
dependencies:
1118711205
async-limiter "~1.0.0"
1118811206

11189-
ws@^6.1.3:
11190-
version "6.2.1"
11191-
resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb"
11192-
integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==
11193-
dependencies:
11194-
async-limiter "~1.0.0"
11207+
ws@^7.4.2:
11208+
version "7.4.2"
11209+
resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.2.tgz#782100048e54eb36fe9843363ab1c68672b261dd"
11210+
integrity sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==
1119511211

1119611212
x-is-string@^0.1.0:
1119711213
version "0.1.0"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
"rollup-plugin-visualizer": "^4.2.0",
133133
"sass": "^1.29.0",
134134
"sass-loader": "^10.1.0",
135-
"stream-chat": "^2.8.4",
135+
"stream-chat": "^2.11.5",
136136
"style-loader": "^2.0.0",
137137
"stylelint": "^13.8.0",
138138
"stylelint-config-recommended-scss": "^4.2.0",

0 commit comments

Comments
 (0)