Skip to content
This repository was archived by the owner on Aug 30, 2022. It is now read-only.

Commit 52ea6cd

Browse files
author
Sravan S
committed
Release v1
1 parent 0d309e9 commit 52ea6cd

File tree

3 files changed

+102
-1
lines changed

3 files changed

+102
-1
lines changed

CHANGELOG.md

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

3+
## 1.0.0(APR 1, 2020)
4+
5+
- Official release of v1
6+
37
## beta.3(APR 1, 2020)
48

59
- Branding fix - sendbird b -> B

README.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,100 @@
11
# Sendbird UIKIT React
22

33
Find the docs at: https://docs.sendbird.com/javascript/ui_kit_getting_started
4+
5+
## Install
6+
7+
`npm i sendbird-uikit`
8+
9+
## Available Components
10+
11+
The components that you receive once you install the uikit
12+
13+
* SendBirdProvider: The context provider that stores SDK and user information
14+
* withSendBird: The Higher Order Component to access data from SendBirdProvider
15+
* ChannelList: UI component to render a list of components
16+
* Channel: A UI Component where conversations happen
17+
* ChannelSettings: A component to change various settings of a given channel
18+
* App: A full fledged app component made by combining the above components
19+
20+
## Usage
21+
22+
There are two usages
23+
24+
### Simple
25+
26+
```
27+
import React from 'react';
28+
29+
import { App as SendBirdApp } from 'sendbird-uikit';
30+
import 'sendbird-uikit/dist/index.css';
31+
32+
function App() {
33+
return (
34+
<div className="App">
35+
<SendBirdApp
36+
appId={APP_ID}
37+
userId="sendbird"
38+
nickname="sendbird"
39+
/>
40+
</div>
41+
);
42+
}
43+
44+
export default App;
45+
```
46+
47+
### With provider
48+
49+
```
50+
import React, { useEffect, useState } from 'react';
51+
52+
import {
53+
SendBirdProvider,
54+
ChannelList,
55+
Channel,
56+
ChannelSettings,
57+
} from 'sendbird-uikit';
58+
import 'sendbird-uikit/dist/index.css';
59+
60+
export default function Chat({ userId, nickname, theme }) {
61+
const [showSettings, setShowSettings] = useState(false);
62+
const [currentChannelUrl, setCurrentChannelUrl] = useState(null);
63+
return (
64+
<div style={{ height: '100vh' }}>
65+
<SendBirdProvider
66+
appId={APP_ID}
67+
theme={theme}
68+
userId={userId}
69+
nickname={nickname}
70+
>
71+
<div className="sendbird-app__wrap">
72+
<div className="sendbird-app__channellist-wrap">
73+
<ChannelList
74+
onChannelSelect={(channel) => {
75+
if (channel && channel.url) {
76+
setCurrentChannelUrl(channel.url);
77+
}
78+
}}
79+
/>
80+
</div>
81+
<div className="sendbird-app__conversation-wrap">
82+
<Channel
83+
channelUrl={currentChannelUrl}
84+
onChatHeaderActionClick={() => { setShowSettings(true); }}
85+
/>
86+
</div>
87+
</div>
88+
{showSettings && (
89+
<div className="sendbird-app__settingspanel-wrap">
90+
<ChannelSettings
91+
channelUrl={currentChannelUrl}
92+
onCloseClick={() => { setShowSettings(false); }}
93+
/>
94+
</div>
95+
)}
96+
</SendBirdProvider>
97+
</div>
98+
)
99+
}
100+
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sendbird-uikit",
3-
"version": "0.0.0-beta.3",
3+
"version": "1.0.0",
44
"description": "React based UI kit for sendbird",
55
"main": "dist/index.js",
66
"style": "dist/styles.css",

0 commit comments

Comments
 (0)