|
1 | | -import './App.css'; |
2 | | -import '@sendbird/uikit-react/dist/index.css'; |
| 1 | +import './App.css' |
| 2 | +import '@sendbird/uikit-react/dist/index.css' |
3 | 3 |
|
4 | | -import React from 'react'; |
| 4 | +import React from 'react' |
5 | 5 |
|
6 | | -import SendbirdProvider from '@sendbird/uikit-react/SendbirdProvider'; |
7 | | -import ChannelList from '@sendbird/uikit-react/ChannelList'; |
8 | | -import Channel from '@sendbird/uikit-react/Channel'; |
| 6 | +import SendbirdProvider from '@sendbird/uikit-react/SendbirdProvider' |
| 7 | +import ChannelList from '@sendbird/uikit-react/ChannelList' |
| 8 | +import Channel from '@sendbird/uikit-react/Channel' |
9 | 9 |
|
10 | | -import { APP_ID, USER_ID, NICKNAME } from './const'; |
| 10 | +import { APP_ID, USER_ID, NICKNAME } from './const' |
11 | 11 |
|
12 | 12 | function App() { |
13 | | - const [currentChannelUrl, setCurrentChannelUrl] = React.useState(''); |
| 13 | + const [currentChannelUrl, setCurrentChannelUrl] = React.useState('') |
14 | 14 | return ( |
15 | 15 | <div className="App"> |
16 | 16 | <SendbirdProvider appId={APP_ID} userId={USER_ID} nickname={NICKNAME}> |
17 | | - <div className="sendbird-app__channellist-wrap"> |
18 | | - {/* ChannelList has wrong props will fix in 2.0.1 |
19 | | - // @ts-ignore */} |
20 | | - <ChannelList |
21 | | - onChannelSelect={(channel) => { |
22 | | - if (channel?.url) { |
23 | | - setCurrentChannelUrl(channel.url); |
24 | | - } |
25 | | - }} |
26 | | - /> |
27 | | - </div> |
28 | | - <div className="sendbird-app__conversation-wrap"> |
29 | | - <Channel |
30 | | - channelUrl={currentChannelUrl} |
31 | | - /> |
32 | | - </div> |
| 17 | + <> |
| 18 | + <div className="sendbird-app__channellist-wrap"> |
| 19 | + <ChannelList |
| 20 | + onChannelSelect={(channel) => { |
| 21 | + if (channel?.url) { |
| 22 | + setCurrentChannelUrl(channel.url) |
| 23 | + } |
| 24 | + }} |
| 25 | + /> |
| 26 | + </div> |
| 27 | + <div className="sendbird-app__conversation-wrap"> |
| 28 | + <Channel |
| 29 | + channelUrl={currentChannelUrl} |
| 30 | + /> |
| 31 | + </div> |
| 32 | + </> |
33 | 33 | </SendbirdProvider> |
34 | 34 | </div> |
35 | | - ); |
| 35 | + ) |
36 | 36 | } |
37 | 37 |
|
38 | | -export default App; |
| 38 | +export default App |
0 commit comments