Skip to content

Commit 2e06daa

Browse files
committed
Raise userSelected event instead of purpose specific setText action
1 parent 215ad92 commit 2e06daa

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/ChatReact/ChatReact/js/components/Actions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var Actions = Reflux.createActions([
77
"showError",
88
"logError",
99
"announce",
10+
"userSelected",
1011
"setText",
1112
"toggleExamples"
1213
]);

src/ChatReact/ChatReact/js/components/User.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
var User = React.createClass({
2-
privateMsg: function(e) {
3-
Actions.setText("@" + e.target.innerHTML + " ");
2+
handleClick: function() {
3+
Actions.userSelected(this.props.user);
44
},
55
render: function() {
66
return (
77
<div className="user">
88
<img src={this.props.user.profileUrl || "/img/no-profile64.png"}/>
9-
<span onClick={this.privateMsg}>
9+
<span onClick={this.handleClick}>
1010
{this.props.user.displayName}
1111
</span>
1212
</div>

0 commit comments

Comments
 (0)