File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ export class App extends Component {
110110 position : ( this . token ( ) >= 1 ? 'right' : 'left' ) ,
111111 forwarded : true ,
112112 replyButton : true ,
113+ removeButton : true ,
113114 reply : this . token ( ) >= 1 ? ( {
114115 photoURL : this . token ( ) >= 1 ? `data:image/png;base64,${ this . photo ( 150 ) } ` : null ,
115116 title : loremIpsum ( { count : 2 , units : 'words' } ) ,
@@ -178,6 +179,9 @@ export class App extends Component {
178179 onReplyMessageClick : ( ) => {
179180 console . log ( 'onReplyMessageClick' ) ;
180181 } ,
182+ onRemoveMessageClick : ( ) => {
183+ console . log ( 'onReplyMessageClick' ) ;
184+ } ,
181185 avatar : `data:image/png;base64,${ this . photo ( ) } ` ,
182186 } ;
183187 case 'chat' :
Original file line number Diff line number Diff line change 22 flex-direction : column;
33 display : block;
44 overflow-x : hidden;
5- min-width : 200 px ;
5+ min-width : 300 px ;
66}
77
88.rce-mbox-forward {
6262 visibility : visible;
6363}
6464
65+ .rce-mbox-remove {
66+ width : 30px ;
67+ height : 30px ;
68+ border-radius : 20px ;
69+ background : # fff ;
70+ position : absolute;
71+ /*display: none;*/
72+ flex-direction : row;
73+ align-self : center;
74+ align-items : center;
75+ justify-content : center;
76+ box-shadow : 0 0 5px 0 rgba (164 , 164 , 164 , 1 );
77+ cursor : pointer;
78+ transition : all 0.3s ease;
79+ top : 0 ;
80+ bottom : 0 ;
81+ margin : auto;
82+ }
83+
84+ .rce-mbox-remove-left {
85+ display : flex;
86+ opacity : 0 ;
87+ visibility : hidden;
88+ left : -120px ;
89+ }
90+
91+ .rce-mbox-remove-right {
92+ display : flex;
93+ opacity : 0 ;
94+ visibility : hidden;
95+ right : -120px ;
96+ }
97+
98+ .rce-container-mbox : hover .rce-mbox-remove-left {
99+ opacity : 1 ;
100+ visibility : visible;
101+ }
102+
103+ .rce-container-mbox : hover .rce-mbox-remove-right {
104+ opacity : 1 ;
105+ visibility : visible;
106+ }
107+
65108.rce-container-mbox : hover .rce-mbox-reply-btn-left {
66109 opacity : 1 ;
67110 visibility : visible;
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import IoDoneAll from 'react-icons/lib/io/android-done-all';
1919import MdIosTime from 'react-icons/lib/md/access-time' ;
2020import MdCheck from 'react-icons/lib/md/check' ;
2121import MdMessage from 'react-icons/lib/md/message' ;
22+ import MdRemove from 'react-icons/lib/md/delete' ;
2223
2324import {
2425 format ,
@@ -103,6 +104,19 @@ export class MessageBox extends React.PureComponent {
103104 </ div >
104105 }
105106
107+ {
108+ this . props . removeButton === true &&
109+ < div
110+ className = { classNames (
111+ 'rce-mbox-remove' ,
112+ { 'rce-mbox-remove-right' : this . props . position === 'left' } ,
113+ { 'rce-mbox-remove-left' : this . props . position === 'right' }
114+ ) }
115+ onClick = { this . props . onRemoveMessageClick } >
116+ < MdRemove />
117+ </ div >
118+ }
119+
106120 {
107121 ( this . props . title || this . props . avatar ) &&
108122 < div
@@ -314,6 +328,7 @@ MessageBox.defaultProps = {
314328 onTitleClick : null ,
315329 onForwardClick : null ,
316330 onReplyClick : null ,
331+ onRemoveMessageClick : null ,
317332 onReplyMessageClick : null ,
318333 date : new Date ( ) ,
319334 data : { } ,
Original file line number Diff line number Diff line change @@ -170,6 +170,7 @@ export class MessageList extends Component {
170170 onForwardClick = { this . props . onForwardClick && ( ( e ) => this . onForwardClick ( x , i , e ) ) }
171171 onReplyClick = { this . props . onReplyClick && ( ( e ) => this . onReplyClick ( x , i , e ) ) }
172172 onReplyMessageClick = { this . props . onReplyMessageClick && ( ( e ) => this . onReplyMessageClick ( x , i , e ) ) }
173+ onRemoveMessageClick = { this . props . onRemoveMessageClick && ( ( e ) => this . onRemoveMessageClick ( x , i , e ) ) }
173174 onClick = { this . props . onClick && ( ( e ) => this . onClick ( x , i , e ) ) }
174175 onContextMenu = { this . props . onContextMenu && ( ( e ) => this . onContextMenu ( x , i , e ) ) }
175176 onMeetingMoreSelect = { this . props . onMeetingMoreSelect && ( ( e ) => this . onMeetingMoreSelect ( x , i , e ) ) }
You can’t perform that action at this time.
0 commit comments