Skip to content

Commit 421fd06

Browse files
Merge pull request #132 from Detaysoft/meeting-message-context
Meeting message context
2 parents fae1f4e + e8028f4 commit 421fd06

6 files changed

Lines changed: 35 additions & 6 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ import { MessageBox } from 'react-chat-elements'
147147
| onMeetingTitleClick | none | function | meeting title message on click event |
148148
| onMeetingVideoLinkClick | none | function | meeting video link message on click event |
149149
| onReplyMessageClick | none | function | reply message on click event |
150+
| onMeetingMoreSelect | none | function | message list item onMeetingMoreSelect event, gets 3 parameters: message item, index of item, event |
150151
| onContextMenu | none | function | message contextmenu click event |
151152
| forwarded | none | boolean | message forward icon |
152153
| replyButton | none | boolean | message reply icon |
@@ -235,10 +236,12 @@ import { MeetingMessage } from 'react-chat-elements'
235236
| date | new Date() | Date | Meeting date |
236237
| collapseTitle | none | string | Meeting subtitle |
237238
| participants | [] | array | Meeting participant array |
239+
| moreItems | none | array | message more items |
238240
| dataSource | [] | array | meeting list array |
239241
| onClick | none | function | meeting message on click event (message(object) is returned) |
240242
| onMeetingTitleClick | none | function | meeting title message on click event (message(object) is returned) |
241243
| onMeetingVideoLinkClick | none | function | meeting video link message on click event (message(object) is returned) |
244+
| onMeetingMoreSelect | none | function | message list item onMeetingMoreSelect event, gets 3 parameters: message item, index of item, event |
242245

243246
## SystemMessage Component
244247

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.11.2",
3+
"version": "10.11.3",
44
"description": "Reactjs chat components",
55
"author": "Avare Kodcu <abdurrahmaneker58@gmail.com>",
66
"main": "dist/main.js",

src/MeetingMessage/MeetingMessage.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,14 @@
105105
}
106106

107107
.rce-mtmg-right-icon {
108-
display: flex;
109-
align-items: center;
110-
position: relative;
111108
right: 10px;
112109
cursor: pointer;
110+
height: 100%;
111+
background: transparent !important;
112+
}
113+
114+
.rce-mtmg-body .rce-dropdown-container {
115+
height: 100%;
113116
}
114117

115118
.rce-mtmg-right-icon > svg {

src/MeetingMessage/MeetingMessage.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
} from'timeago.js';
1414

1515
import Avatar from '../Avatar/Avatar';
16+
import Dropdown from '../Dropdown/Dropdown';
1617

1718
import classNames from 'classnames';
1819

@@ -38,6 +39,8 @@ export class MeetingMessage extends Component {
3839
title,
3940
subject,
4041
onClick,
42+
onMeetingMoreSelect,
43+
moreItems,
4144
collapseTitle,
4245
dataSource,
4346
participants,
@@ -70,8 +73,19 @@ export class MeetingMessage extends Component {
7073
</span>
7174
</div>
7275
</div>
73-
<div className="rce-mtmg-right-icon">
74-
<MdMoreHoriz/>
76+
<div>
77+
<Dropdown
78+
animationType="bottom"
79+
animationPosition="norteast"
80+
buttonProps={{
81+
className:'rce-mtmg-right-icon',
82+
icon: {
83+
component: <MdMoreHoriz/>,
84+
size: 24,
85+
},
86+
}}
87+
items={moreItems}
88+
onSelect={onMeetingMoreSelect}/>
7589
</div>
7690
</div>
7791
<div
@@ -237,6 +251,7 @@ MeetingMessage.defaultProps = {
237251
dataSource: [],
238252
participants: [],
239253
onClick: () => void(0),
254+
onMeetingMoreSelect: () => void(0),
240255
onMeetingTitleClick: () => void(0),
241256
onMeetingVideoLinkClick: () => void(0),
242257
onAvatarError: () => void(0),

src/MessageBox/MessageBox.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,10 @@ export class MessageBox extends Component {
196196
dateString={this.props.meeting.dateString}
197197
collapseTitle={this.props.meeting.collapseTitle}
198198
participants={this.props.meeting.participants}
199+
moreItems={this.props.meeting.moreItems}
199200
dataSource={this.props.meeting.dataSource}
200201
onClick={this.props.onMeetingMessageClick}
202+
onMeetingMoreSelect={this.props.onMeetingMoreSelect}
201203
onMeetingVideoLinkClick={this.props.onMeetingVideoLinkClick}
202204
onMeetingTitleClick={this.props.onMeetingTitleClick} />
203205
}

src/MessageList/MessageList.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ export class MessageList extends Component {
145145
}
146146
}
147147

148+
onMeetingMoreSelect(item, i, e) {
149+
if (this.props.onMeetingMoreSelect instanceof Function)
150+
this.props.onMeetingMoreSelect(item, i, e);
151+
}
152+
148153
render() {
149154
return (
150155
<div
@@ -167,6 +172,7 @@ export class MessageList extends Component {
167172
onReplyMessageClick={this.props.onReplyMessageClick && ((e) => this.onReplyMessageClick(x, i, e))}
168173
onClick={this.props.onClick && ((e) => this.onClick(x, i, e))}
169174
onContextMenu={this.props.onContextMenu && ((e) => this.onContextMenu(x, i, e))}
175+
onMeetingMoreSelect={this.props.onMeetingMoreSelect && ((e) => this.onMeetingMoreSelect(x, i, e))}
170176
onMessageFocused={this.props.onMessageFocused && ((e) => this.onMessageFocused(x, i, e))}
171177
onMeetingMessageClick={this.props.onMeetingMessageClick && ((e) => this.onMeetingMessageClick(x, i, e))}
172178
onMeetingTitleClick={this.props.onMeetingTitleClick}

0 commit comments

Comments
 (0)