adding support for trusted, verified/staff/danger badges, wip
This commit is contained in:
+2
-1
@@ -175,5 +175,6 @@
|
||||
"channel": "Sender",
|
||||
"drafty_attachment": "Dateianhang",
|
||||
"drafty_form": "Formular:",
|
||||
"drafty_image": "Bild"
|
||||
"drafty_image": "Bild",
|
||||
"menu_item_restore_topic": ":!![MISSING]!!:[object Object]"
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
"menu_item_info": "Info",
|
||||
"menu_item_member_delete": "Remove",
|
||||
"menu_item_mute": "Mute",
|
||||
"menu_item_restore_topic": "Restore",
|
||||
"menu_item_send_retry": "Retry",
|
||||
"menu_item_unblock": "Unblock",
|
||||
"menu_item_unmute": "Unmute",
|
||||
|
||||
+2
-1
@@ -175,5 +175,6 @@
|
||||
"channel": "canal",
|
||||
"drafty_attachment": "Archivo",
|
||||
"drafty_form": "Formulario:",
|
||||
"drafty_image": "Imagen"
|
||||
"drafty_image": "Imagen",
|
||||
"menu_item_restore_topic": ":!![MISSING]!!:[object Object]"
|
||||
}
|
||||
|
||||
@@ -421,6 +421,10 @@
|
||||
"defaultMessage": "Mute",
|
||||
"description": "Turn off notifications"
|
||||
},
|
||||
"menu_item_restore_topic": {
|
||||
"defaultMessage": "Restore",
|
||||
"description": "Restore topic from archive"
|
||||
},
|
||||
"menu_item_send_retry": {
|
||||
"defaultMessage": "Retry",
|
||||
"description": "Retry sending message"
|
||||
|
||||
+2
-1
@@ -178,5 +178,6 @@
|
||||
"channel": "채널",
|
||||
"drafty_attachment": "부착",
|
||||
"drafty_form": "형태:",
|
||||
"drafty_image": "이미지"
|
||||
"drafty_image": "이미지",
|
||||
"menu_item_restore_topic": ":!![MISSING]!!:[object Object]"
|
||||
}
|
||||
|
||||
+2
-1
@@ -175,5 +175,6 @@
|
||||
"title_manage_tags": "Administrează",
|
||||
"drafty_attachment": "Atasament",
|
||||
"drafty_form": "Formă:",
|
||||
"drafty_image": "Imagine"
|
||||
"drafty_image": "Imagine",
|
||||
"menu_item_restore_topic": ":!![MISSING]!!:[object Object]"
|
||||
}
|
||||
|
||||
+2
-1
@@ -175,5 +175,6 @@
|
||||
"channel": "канал",
|
||||
"drafty_attachment": "Аттачмент",
|
||||
"drafty_form": "Форма:",
|
||||
"drafty_image": "Картинка"
|
||||
"drafty_image": "Картинка",
|
||||
"menu_item_restore_topic": ":!![MISSING]!!:[object Object]"
|
||||
}
|
||||
|
||||
+2
-1
@@ -175,5 +175,6 @@
|
||||
"channel": "频道",
|
||||
"drafty_attachment": "附件",
|
||||
"drafty_form": "形式:",
|
||||
"drafty_image": "图像"
|
||||
"drafty_image": "图像",
|
||||
"menu_item_restore_topic": ":!![MISSING]!!:[object Object]"
|
||||
}
|
||||
|
||||
@@ -285,6 +285,7 @@
|
||||
"menu_item_info": "Info",
|
||||
"menu_item_member_delete": "Remove",
|
||||
"menu_item_mute": "Mute",
|
||||
"menu_item_restore_topic": "Restore",
|
||||
"menu_item_send_retry": "Retry",
|
||||
"menu_item_unblock": "Unblock",
|
||||
"menu_item_unmute": "Unmute",
|
||||
|
||||
@@ -760,6 +760,7 @@ class TinodeWeb extends React.Component {
|
||||
// Contacts expect c.topic to be set.
|
||||
c.topic = c.name;
|
||||
}
|
||||
|
||||
newState.chatList.push(c);
|
||||
if (this.state.topicSelected == c.topic) {
|
||||
newState.topicSelectedOnline = c.online;
|
||||
@@ -1373,7 +1374,7 @@ class TinodeWeb extends React.Component {
|
||||
subscribed && deleter ? 'messages_clear_hard' : null,
|
||||
muted ? (blocked ? null : 'topic_unmute') : 'topic_mute',
|
||||
self_blocked ? 'topic_unblock' : 'topic_block',
|
||||
!archived ? 'topic_archive' : null,
|
||||
!archived ? 'topic_restore' : 'topic_archive',
|
||||
'topic_delete'
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
const icon_mapping = {'muted': 'notifications_off', 'banned': 'block'};
|
||||
const icon_mapping = {'muted': 'notifications_off', 'banned': 'block',
|
||||
'verified': 'verified', 'staff': 'verified_user', 'dangerous': 'dangerous'};
|
||||
|
||||
/* Contact's labels: [you], or icons [muted], [blocked] */
|
||||
export default class ContactBadges extends React.PureComponent {
|
||||
@@ -10,7 +11,7 @@ export default class ContactBadges extends React.PureComponent {
|
||||
badges = [];
|
||||
this.props.badges.map(function(b) {
|
||||
if (b.icon) {
|
||||
badges.push(<i className="material-icons as-badge" key={b.key || b.icon}>{icon_mapping[b.icon]}</i>);
|
||||
badges.push(<i className="material-icons as-badge" key={b.key || b.icon}>{icon_mapping[b.icon] || b.icon}</i>);
|
||||
} else {
|
||||
const style = 'badge' + (b.color ? ' ' + b.color : '');
|
||||
badges.push(<span className={style} key={b.key || b.name}>{b.name}</span>);
|
||||
|
||||
@@ -105,6 +105,9 @@ class ContactList extends React.Component {
|
||||
isChannel={isChannel}
|
||||
onSelected={this.props.onTopicSelected}
|
||||
showContextMenu={this.props.showContextMenu}
|
||||
isVerified={c.isVerified()}
|
||||
isStaff={c.isStaff()}
|
||||
isDangerous={c.isDangerous()}
|
||||
item={key}
|
||||
index={contactNodes.length}
|
||||
key={key} />
|
||||
|
||||
+10
-1
@@ -65,6 +65,15 @@ class Contact extends React.Component {
|
||||
const avatar = this.props.avatar ? this.props.avatar : true;
|
||||
const badges = this.props.badges ? this.props.badges.slice() : [];
|
||||
const icon_badges = [];
|
||||
if (this.props.isVerified) {
|
||||
icon_badges.push({icon: 'verified'});
|
||||
}
|
||||
if (this.props.isStaff) {
|
||||
icon_badges.push({icon: 'staff'});
|
||||
}
|
||||
if (this.props.isDangerous) {
|
||||
icon_badges.push({icon: 'dangerous'});
|
||||
}
|
||||
if (this.props.acs) {
|
||||
if (this.props.showMode) {
|
||||
badges.push({name: this.props.acs.getMode(), key: 'mode'});
|
||||
@@ -101,7 +110,7 @@ class Contact extends React.Component {
|
||||
<div className="text-box">
|
||||
<div><span className="contact-title">{title}</span>
|
||||
{this.props.isChannel ? <img src="/img/channel.png" className="channel" alt="channel" /> : null}
|
||||
<UnreadBadge count={this.props.unread} /><ContactBadges badges={icon_badges} />
|
||||
<ContactBadges badges={icon_badges} /><UnreadBadge count={this.props.unread} />
|
||||
</div>
|
||||
{this.props.showMode ?
|
||||
<span><ContactBadges badges={badges} /></span> :
|
||||
|
||||
+56
-7
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user