Commit ae025e63 authored by MrMan's avatar MrMan

Remove stray log messages

parent 92ba5671
......@@ -41,13 +41,11 @@ class MatchConvoPage extends React.Component {
closeButton = (
<div id="match-convo-close-btn"
onClick={() => { if (this.props.closeFn) { this.props.closeFn(); }}}>
<h2 className="no-margin"><i className="fa fa-arrow-left large"></i></h2>
<h2 className="no-margin"><i className="fa fa-times large"></i></h2>
</div>
);
}
console.log("User?", this.state.user);
return (
<div className="match-convo-page-container">
{closeButton}
......
import React from "react";
import { PropTypes } from "react-router";
import Actions from "../actions";
import LHSNav from "./lhs-nav";
import TinderMatchStore from "../stores/tinder-match";
......@@ -62,6 +63,8 @@ class MatchesPage extends React.Component {
this.setState({selectedMatch: null});
}
gotoRecsPage() { this.context.history.pushState(null, '/recs'); }
showMatchConvoContainerWithMatch(m) {
console.log("[MATCHES PAGE] Showing convo container for match:", m);
this.setState({selectedMatch: m});
......@@ -70,18 +73,40 @@ class MatchesPage extends React.Component {
render() {
console.log(`[MATCHES PAGE] Rendering matches page with ${this.state.matches.length} matches`);
let matchLinks = _.map(this.state.matches, m => {
let unseen = _.reduce(m.messages, (acc, m) => !m.seen ? acc+1 : acc , 0);
return (
// Generate elemtn that will list or show empty message
let matchListElem;
if (_.isEmpty(this.state.matches)) {
// Generate no matches message
matchListElem = (
<div id="no-matches-message" className="pure-u-1 center-aligned-text">
<h3 className="slim-text">No matches found</h3>
<button onClick={this.gotoRecsPage.bind(this)}
className="pure-button button-success">
<i className="fa fa-binoculars"></i> {this.i18n`pages.matches.findSomeoneNew`}
</button>
</div>
);
} else {
// Generate list of matches
let matchLinks = _.map(this.state.matches, m => {
let unseen = _.reduce(m.messages, (acc, m) => !m.seen ? acc+1 : acc , 0);
return (
<div key={m.id} onClick={() => this.showMatchConvoContainerWithMatch(m)} >
<MatchConvoLink unseenMessageCount={unseen} matchId={m.id} />
</div>
);
});
matchListElem = (
<div className="pure-u-1">
{matchLinks}
</div>
);
});
let convoShown = _.isNull(this.state.selectedMatch) ? "" : "onscreen";
}
// Generate contents for sliding container
let convoShown = _.isNull(this.state.selectedMatch) ? "" : "onscreen";
let selectedMatch = this.state.selectedMatch;
let matchedUser = _.isNull(selectedMatch) ? {} : _.get(this.state.matchedUserInfo, this.state.selectedMatch.id);
let viewingUser = this.state.user;
......@@ -100,9 +125,7 @@ class MatchesPage extends React.Component {
</div>
<div className="pure-g">
<div className="pure-u-1">
{matchLinks}
</div>
{matchListElem}
</div>
</div>
......@@ -118,4 +141,9 @@ class MatchesPage extends React.Component {
}
}
// Add mixins
MatchesPage.contextTypes = {
history: PropTypes.history
};
export default MatchesPage;
......@@ -46,7 +46,8 @@ export default {
lastActive: "last active"
},
matches: {
pageSubtitle: "Talk with your matches"
pageSubtitle: "Talk with your matches",
findSomeoneNew: "Find someone new"
}
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment