forwarding UI prettier and more usable
This commit is contained in:
@@ -78,6 +78,7 @@ class BaseChatMessage extends React.PureComponent {
|
||||
menuItems.push('menu_item_reply');
|
||||
menuItems.push('menu_item_forward');
|
||||
}
|
||||
|
||||
this.props.showContextMenu({
|
||||
seq: this.props.seq,
|
||||
content: this.props.content,
|
||||
|
||||
@@ -191,9 +191,7 @@ class ContextMenu extends React.Component {
|
||||
'menu_item_forward': {
|
||||
id: 'menu_item_forward',
|
||||
title: formatMessage(messages.forward),
|
||||
handler: (params, errorHandler) => {
|
||||
return this.forwardMessage(params, errorHandler);
|
||||
}
|
||||
handler: () => {} /* the action is taken directly in tinode-web */
|
||||
},
|
||||
'topic_unmute': {
|
||||
id: 'topic_unmute',
|
||||
@@ -439,12 +437,6 @@ class ContextMenu extends React.Component {
|
||||
params.pickReply(params.seq, params.content, params.forwarded, params.userFrom, params.userName, errorHandler);
|
||||
}
|
||||
|
||||
forwardMessage(params, errorHandler) {
|
||||
//params.pickReply({ seq: params.seq, content: params.content });
|
||||
//this.props.
|
||||
console.log('forwarding msg ', params);
|
||||
}
|
||||
|
||||
render() {
|
||||
const menu = [];
|
||||
let count = 0;
|
||||
|
||||
@@ -50,8 +50,11 @@ export default class ForwardDialog extends React.Component {
|
||||
|
||||
render() {
|
||||
let contacts = this.state.query != null ? this.props.searchResults : this.props.contacts;
|
||||
// Filter out contacts without a 'W' permission.
|
||||
contacts = contacts.filter((c) => { return c.acs.isJoiner() && c.acs.isWriter(); });
|
||||
// Filter out contacts without a 'W' or 'J' permissions as well as the current topic.
|
||||
contacts = contacts.filter((c) => {
|
||||
console.log(c.name, this.props.topicSelected);
|
||||
return (c.name != this.props.topicSelected) && c.acs.isJoiner() && c.acs.isWriter();
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="alert-container">
|
||||
|
||||
@@ -177,17 +177,17 @@ class SendMessage extends React.PureComponent {
|
||||
formatMessage(messages[this.props.messagePrompt]) :
|
||||
formatMessage(messages.type_new_message));
|
||||
|
||||
const quote =
|
||||
(<div id="reply-quote-preview">
|
||||
<div className="cancel">
|
||||
<a href="#" onClick={(e) => {e.preventDefault(); this.props.onCancelReply();}}><i className="material-icons gray">close</i></a>
|
||||
</div>
|
||||
{this.state.quote}
|
||||
</div>);
|
||||
|
||||
return (
|
||||
<div id="send-message-wrapper">
|
||||
{this.state.quote ?
|
||||
<div id="reply-quote-preview">
|
||||
<div className="cancel">
|
||||
<a href="#" onClick={(e) => {e.preventDefault(); this.props.onCancelReply();}}><i className="material-icons gray">close</i></a>
|
||||
</div>
|
||||
{this.state.quote}
|
||||
</div>
|
||||
:
|
||||
null}
|
||||
{this.state.quote && !this.props.noInput ? quote : null}
|
||||
<div id="send-message-panel">
|
||||
{!this.props.disabled ?
|
||||
<>
|
||||
@@ -203,7 +203,7 @@ class SendMessage extends React.PureComponent {
|
||||
:
|
||||
null}
|
||||
{this.props.noInput ?
|
||||
<div className="hr thin" /> :
|
||||
(this.state.quote ? quote : <div className="hr thin" />) :
|
||||
<textarea id="sendMessage" placeholder={prompt}
|
||||
value={this.state.message} onChange={this.handleMessageTyping}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
|
||||
Reference in New Issue
Block a user