@@ -2,7 +2,6 @@ import React, { useState } from 'react';
22import type { GroupChannel } from '@sendbird/chat/groupChannel' ;
33
44import GroupChannelListHeader from '../GroupChannelListHeader' ;
5- import AddChannel from '../AddGroupChannel' ;
65
76import useSendbirdStateContext from '../../../../hooks/useSendbirdStateContext' ;
87import EditUserProfile from '../../../EditUserProfile' ;
@@ -17,16 +16,15 @@ export interface Props {
1716 renderPlaceHolderEmptyList ?: ( props : void ) => React . ReactElement ;
1817
1918 onChangeTheme : ( theme : string ) => void ;
20- onUserProfileUpdated : ( user :User ) => void ;
19+ onUserProfileUpdated : ( user : User ) => void ;
2120 allowProfileEdit : boolean ;
2221
2322 channels : GroupChannel [ ] ;
2423 onLoadMore : ( ) => void ;
2524 initialized : boolean ;
26- renderChannel : ( props : {
27- item : GroupChannel ;
28- index : number ;
29- } ) => React . ReactElement ;
25+ renderChannel : ( props : { item : GroupChannel ; index : number } ) => React . ReactElement ;
26+
27+ renderAddChannel ( ) : React . ReactElement ;
3028}
3129
3230export const GroupChannelListUIView = ( {
@@ -43,11 +41,14 @@ export const GroupChannelListUIView = ({
4341 onLoadMore,
4442 initialized,
4543 renderChannel,
44+
45+ renderAddChannel,
4646} : Props ) => {
4747 const [ showProfileEdit , setShowProfileEdit ] = useState ( false ) ;
4848 const { stores } = useSendbirdStateContext ( ) ;
4949
5050 const renderer = {
51+ addChannel : renderAddChannel ,
5152 channel : renderChannel ,
5253 placeholder : {
5354 loading ( ) {
@@ -78,7 +79,7 @@ export const GroupChannelListUIView = ({
7879 < GroupChannelListHeader
7980 onEdit = { ( ) => allowProfileEdit && setShowProfileEdit ( true ) }
8081 allowProfileEdit = { allowProfileEdit }
81- renderIconButton = { ( ) => < AddChannel /> }
82+ renderIconButton = { ( ) => renderer . addChannel ( ) }
8283 />
8384 ) }
8485 </ div >
@@ -120,14 +121,7 @@ const ChannelListComponent = <T, >(props: {
120121 placeholderEmpty ?: React . ReactNode ;
121122 placeholderError ?: React . ReactNode ;
122123} ) => {
123- const {
124- data,
125- renderItem,
126- onLoadMore,
127- placeholderLoading,
128- placeholderError,
129- placeholderEmpty,
130- } = props ;
124+ const { data, renderItem, onLoadMore, placeholderLoading, placeholderError, placeholderEmpty } = props ;
131125
132126 const onScroll = useOnScrollPositionChangeDetector ( {
133127 onReachedBottom : ( ) => onLoadMore ( ) ,
0 commit comments