Skip to content

Commit da37c96

Browse files
Merge pull request #84 from Detaysoft/next
Next 10.1.2
2 parents 77a6cc5 + 39ba386 commit da37c96

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ import { MessageBox } from 'react-chat-elements'
136136
| onLoad | none | function | message on load photo |
137137
| onTitleClick | none | function | message title on click event |
138138
| onForwardClick | none | function | message forward on click event |
139+
| onContextMenu | none | function | message contextmenu click event |
139140
| forwarded | none | boolean | message forward icon |
140141
| status | none | string | message status info (waiting, sent, received, read) |
141142
| notch | true | boolean | message box notch |
@@ -200,7 +201,7 @@ import { MessageList } from 'react-chat-elements'
200201
| downButton | true | boolean | message list scroll to bottom button |
201202
| downButtonBadge | none | boolean | message list downButton badge content |
202203
| onDownButtonClick | none | function | message list onDownButtonClick |
203-
204+
| onContextMenu | none | function | message list item onContextMenu event, gets 3 parameters: message item, index of item, event |
204205

205206
## ChatList Component
206207

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-chat-elements",
3-
"version": "10.1.1",
3+
"version": "10.1.2",
44
"description": "Reactjs chat components",
55
"author": "Avare Kodcu <abdurrahmaneker58@gmail.com>",
66
"main": "dist/main.js",

src/MessageBox/MessageBox.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ export class MessageBox extends Component {
5050
{'rce-mbox--clear-padding': thatAbsoluteTime},
5151
{'rce-mbox--clear-notch': !this.props.notch}
5252
)}>
53-
<div className='rce-mbox-body'>
53+
<div
54+
className='rce-mbox-body'
55+
onContextMenu={this.props.onContextMenu}>
5456
{
5557
this.props.forwarded === true &&
5658
<div
@@ -229,6 +231,7 @@ MessageBox.defaultProps = {
229231
avatar: null,
230232
renderAddCmp: null,
231233
copiableDate: false,
234+
onContextMenu: null,
232235
};
233236

234237

src/MessageList/MessageList.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ export class MessageList extends Component {
6969
this.props.onForwardClick(item, i, e);
7070
}
7171

72+
onContextMenu(item, i, e) {
73+
if (this.props.onContextMenu instanceof Function)
74+
this.props.onContextMenu(item, i, e);
75+
}
76+
7277
loadRef(ref) {
7378
this.mlistRef = ref;
7479
if (this.props.cmpRef instanceof Function)
@@ -127,7 +132,9 @@ export class MessageList extends Component {
127132
onDownload={this.props.onDownload && ((e) => this.onDownload(x, i, e))}
128133
onTitleClick={this.props.onDownload && ((e) => this.onTitleClick(x, i, e))}
129134
onForwardClick={this.props.onForwardClick && ((e) => this.onForwardClick(x, i, e))}
130-
onClick={this.props.onClick && ((e) => this.onClick(x, i, e))}/>
135+
onClick={this.props.onClick && ((e) => this.onClick(x, i, e))}
136+
onContextMenu={this.props.onContextMenu && ((e) => this.onContextMenu(x, i, e))}
137+
/>
131138
))
132139
}
133140
</div>

0 commit comments

Comments
 (0)