about summary refs log tree commit diff
path: root/app/assets/javascripts/components/features
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-10 01:32:32 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-10 01:32:32 +0100
commit36921be9aa6f4ef68d969ee2a1c49b63a37d4d2a (patch)
tree31a5c6b2a1a09dab654babaec5dfa6eae6163e2b /app/assets/javascripts/components/features
parentca3b364aeaa9014f23b4222a13586f42efb17b93 (diff)
Fix #131 - Make active favourite buttons yellow
Diffstat (limited to 'app/assets/javascripts/components/features')
-rw-r--r--app/assets/javascripts/components/features/status/components/action_bar.jsx30
1 files changed, 25 insertions, 5 deletions
diff --git a/app/assets/javascripts/components/features/status/components/action_bar.jsx b/app/assets/javascripts/components/features/status/components/action_bar.jsx
index d0cae4557..2733cea07 100644
--- a/app/assets/javascripts/components/features/status/components/action_bar.jsx
+++ b/app/assets/javascripts/components/features/status/components/action_bar.jsx
@@ -17,22 +17,42 @@ const ActionBar = React.createClass({
 
   mixins: [PureRenderMixin],
 
+  handleReplyClick () {
+    this.props.onReply(status);
+  },
+
+  handleReblogClick () {
+    this.props.onReblog(status);
+  },
+
+  handleFavouriteClick () {
+    this.props.onFavourite(status);
+  },
+
+  handleDeleteClick () {
+    this.props.onDelete(status);
+  },
+
+  handleMentionClick () {
+    this.props.onMention(status.get('account'));
+  },
+
   render () {
     const { status, me } = this.props;
 
     let menu = [];
 
     if (me === status.getIn(['account', 'id'])) {
-      menu.push({ text: 'Delete', action: () => this.props.onDelete(status) });
+      menu.push({ text: 'Delete', action: this.handleDeleteClick });
     } else {
-      menu.push({ text: 'Mention', action: () => this.props.onMention(status.get('account')) });
+      menu.push({ text: 'Mention', action: this.handleMentionClick });
     }
 
     return (
       <div style={{ background: '#2f3441', display: 'flex', flexDirection: 'row', borderTop: '1px solid #363c4b', borderBottom: '1px solid #363c4b', padding: '10px 0' }}>
-        <div style={{ flex: '1 1 auto', textAlign: 'center' }}><IconButton title='Reply' icon='reply' onClick={() => this.props.onReply(status)} /></div>
-        <div style={{ flex: '1 1 auto', textAlign: 'center' }}><IconButton active={status.get('reblogged')} title='Reblog' icon='retweet' onClick={() => this.props.onReblog(status)} /></div>
-        <div style={{ flex: '1 1 auto', textAlign: 'center' }}><IconButton active={status.get('favourited')} title='Favourite' icon='star' onClick={() => this.props.onFavourite(status)} /></div>
+        <div style={{ flex: '1 1 auto', textAlign: 'center' }}><IconButton title='Reply' icon='reply' onClick={this.handleReplyClick} /></div>
+        <div style={{ flex: '1 1 auto', textAlign: 'center' }}><IconButton active={status.get('reblogged')} title='Reblog' icon='retweet' onClick={this.handleReblogClick} /></div>
+        <div style={{ flex: '1 1 auto', textAlign: 'center' }}><IconButton active={status.get('favourited')} title='Favourite' icon='star' onClick={this.handleFavouriteClick}  activeStyle={{ color: '#ca8f04' }} /></div>
         <div style={{ flex: '1 1 auto', textAlign: 'center' }}><DropdownMenu size={18} icon='ellipsis-h' items={menu} /></div>
       </div>
     );