making topic sach work

This commit is contained in:
or-else
2018-02-04 18:14:29 -08:00
parent dc91e9d7b7
commit addd27108f
2 changed files with 14 additions and 2 deletions
+8
View File
@@ -660,6 +660,13 @@ table.permission-editor td.checkbox {
height: 3rem; height: 3rem;
border-radius: 50%; border-radius: 50%;
} }
.contact-box .avatar-box > .material-icons {
display: flex;
flex-direction: column;
justify-content: space-around;
width: 3rem;
height: 3rem;
}
.contact-box .text-box { .contact-box .text-box {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -1530,6 +1537,7 @@ ul.tabbar li.active > a:after {
font-size: 1.4rem; font-size: 1.4rem;
line-height: 1; line-height: 1;
vertical-align: middle; vertical-align: middle;
text-align: center;
} }
.material-icons.small { .material-icons.small {
font-size: 1rem; font-size: 1rem;
+6 -2
View File
@@ -1247,6 +1247,7 @@
break; break;
default:; default:;
}; };
console.log("SidepanelView", this.props.foundContacts);
return ( return (
<div id="sidepanel" className={this.props.hideSelf ? 'nodisplay' : null}> <div id="sidepanel" className={this.props.hideSelf ? 'nodisplay' : null}>
<SideNavbar state={this.props.state} <SideNavbar state={this.props.state}
@@ -1626,9 +1627,10 @@
var contactNodes = []; var contactNodes = [];
var instance = this; var instance = this;
var showCheckmark = Array.isArray(this.props.topicSelected); var showCheckmark = Array.isArray(this.props.topicSelected);
console.log("ContactList", this.props.contacts);
if (this.props.contacts && this.props.contacts.length > 0) { if (this.props.contacts && this.props.contacts.length > 0) {
this.props.contacts.map(function(c) { this.props.contacts.map(function(c) {
console.log("ContactList", c);
var key = c.topic ? c.topic : c.user; var key = c.topic ? c.topic : c.user;
// If filter function is provided, filter out the items // If filter function is provided, filter out the items
// which don't satisfy the condition. // which don't satisfy the condition.
@@ -1845,6 +1847,7 @@
/* BEGIN Create new topic and invite users or send an invite */ /* BEGIN Create new topic and invite users or send an invite */
var NewTopicView = React.createClass({ var NewTopicView = React.createClass({
getInitialState: function() { getInitialState: function() {
console.log("NewTopicView", this.props.foundContacts);
return { return {
tabSelected: "p2p", tabSelected: "p2p",
searchQuery: this.props.contactsSearchQuery, searchQuery: this.props.contactsSearchQuery,
@@ -1856,6 +1859,7 @@
this.props.onInitFind(); this.props.onInitFind();
}, },
componentWillReceiveProps: function(nextProps) { componentWillReceiveProps: function(nextProps) {
console.log("NewTopicView-new props", nextProps.foundContacts);
this.setState({ this.setState({
searchQuery: nextProps.contactsSearchQuery, searchQuery: nextProps.contactsSearchQuery,
contactList: nextProps.foundContacts contactList: nextProps.foundContacts
@@ -3444,7 +3448,7 @@
tnFndSubsUpdated: function() { tnFndSubsUpdated: function() {
var contacts = []; var contacts = [];
// Don't attempt to create P2P topics which already exist. Server will reject the duplicates. // Don't attempt to create P2P topics which already exist. Server will reject the duplicates.
Tinode.getFndTopic().subscribers(function(s) { Tinode.getFndTopic().contacts(function(s) {
contacts.push(s); contacts.push(s);
}); });
this.setState({foundContacts: contacts}); this.setState({foundContacts: contacts});