@@ -9,7 +9,6 @@ import classNames from 'classnames'
99
1010import { MdVideoCall , MdVolumeOff , MdVolumeUp } from 'react-icons/md'
1111import { IChatItemProps } from '../type'
12- import { FaArrowDown , FaArrowUp } from 'react-icons/fa'
1312
1413const ChatItem : React . FC < IChatItemProps > = ( {
1514 avatarFlexible = false ,
@@ -66,12 +65,6 @@ const ChatItem: React.FC<IChatItemProps> = ({
6665 if ( onDrag ) setOnDrag ( false )
6766 }
6867
69- const onExpandItem = ( e : React . MouseEvent , id : string | number ) => {
70- e . preventDefault ( ) ;
71- e . stopPropagation ( ) ;
72- if ( props . onExpandItem instanceof Function ) props . onExpandItem ( id ) ;
73- }
74-
7568 return (
7669 < >
7770 < div
@@ -117,43 +110,44 @@ const ChatItem: React.FC<IChatItemProps> = ({
117110 lazyLoadingImage = { lazyLoadingImage }
118111 type = { classNames ( 'circle' , { 'flexible' : avatarFlexible } ) }
119112 />
120- { props . subList && props . subList . length > 0 && (
121- < button className = 'rce-citem-expand-button' onClick = { ( e ) => onExpandItem ( e , props . id ) } >
122- { props . expanded ? < FaArrowUp /> : < FaArrowDown /> }
123- </ button >
124- ) }
125113 </ div > ,
126114 < div key = { 'rce-citem-body' } className = 'rce-citem-body' >
127115 < div className = 'rce-citem-body--top' >
128- < div className = 'rce-citem-body--top-title' > { props . title } </ div >
129- < div className = 'rce-citem-body--top-time' > { date && ( props . dateString || format ( date ) ) } </ div >
116+ < div className = 'rce-citem-body--top-title' > { props . title } </ div >
117+ < div className = 'rce-citem-body--top-time' > { date && ( props . dateString || format ( date ) ) } </ div >
130118 </ div >
131119
132120 < div className = 'rce-citem-body--bottom' >
133- < div className = 'rce-citem-body--bottom-title' > { props . subtitle } </ div >
134- < div className = 'rce-citem-body--bottom-tools' onMouseEnter = { handleOnMouseEnter } onMouseLeave = { handleOnMouseLeave } >
135- { props . showMute && (
136- < div className = 'rce-citem-body--bottom-tools-item' onClick = { props . onClickMute } >
137- { props . muted === true && < MdVolumeOff /> }
138- { props . muted === false && < MdVolumeUp /> }
121+ < div className = 'rce-citem-body--bottom-title' > { props . subtitle } </ div >
122+ < div className = 'rce-citem-body--bottom-tools' onMouseEnter = { handleOnMouseEnter } onMouseLeave = { handleOnMouseLeave } >
123+ { props . showMute && (
124+ < div className = 'rce-citem-body--bottom-tools-item' onClick = { props . onClickMute } >
125+ { props . muted === true && < MdVolumeOff /> }
126+ { props . muted === false && < MdVolumeUp /> }
127+ </ div >
128+ ) }
129+ { props . showVideoCall && (
130+ < div className = 'rce-citem-body--bottom-tools-item' onClick = { props . onClickVideoCall } >
131+ < MdVideoCall />
132+ </ div >
133+ ) }
139134 </ div >
140- ) }
141- { props . showVideoCall && (
142- < div className = 'rce-citem-body--bottom-tools-item' onClick = { props . onClickVideoCall } >
143- < MdVideoCall />
135+ < div className = 'rce-citem-body--bottom-tools-item-hidden-hover' >
136+ { props . showMute && props . muted && (
137+ < div className = 'rce-citem-body--bottom-tools-item' >
138+ < MdVolumeOff />
139+ </ div >
140+ ) }
144141 </ div >
145- ) }
142+ < div className = 'rce-citem-body--bottom-status' > { unread && unread > 0 ? < span > { unread } </ span > : null } </ div >
143+ { props . customStatusComponents !== undefined ? props . customStatusComponents . map ( Item => < Item /> ) : null }
146144 </ div >
147- < div className = 'rce-citem-body--bottom-tools-item-hidden-hover' >
148- { props . showMute && props . muted && (
149- < div className = 'rce-citem-body--bottom-tools-item ' >
150- < MdVolumeOff />
145+
146+ { props . subTextElement && (
147+ < div className = 'rce-citem-body--subinfo ' >
148+ { props . subTextElement }
151149 </ div >
152- ) }
153- </ div >
154- < div className = 'rce-citem-body--bottom-status' > { unread && unread > 0 ? < span > { unread } </ span > : null } </ div >
155- { props . customStatusComponents !== undefined ? props . customStatusComponents . map ( Item => < Item /> ) : null }
156- </ div >
150+ ) }
157151 </ div > ,
158152 ] }
159153 </ div >
0 commit comments