about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-09-18 03:57:13 +0200
committerEugen Rochko <eugen@zeonfederated.com>2018-09-18 03:57:13 +0200
commitf8b54d229f70cb726511bcd35e1440618e487672 (patch)
tree3671da6f8a294227e58c5382b439e23709809819 /app/javascript
parent9b32898e3c9e9284baa0792d0d7ee5723c860c4f (diff)
Fix “Toots” tab highlighting for replies and media timelines (#8715)
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/mastodon/features/account/components/action_bar.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/account/components/action_bar.js b/app/javascript/mastodon/features/account/components/action_bar.js
index ac4af3d6b..c9ae2df98 100644
--- a/app/javascript/mastodon/features/account/components/action_bar.js
+++ b/app/javascript/mastodon/features/account/components/action_bar.js
@@ -60,6 +60,13 @@ class ActionBar extends React.PureComponent {
     });
   }
 
+  isStatusesPageActive = (match, location) => {
+    if (!match) {
+      return false;
+    }
+    return !location.pathname.match(/\/(followers|following)\/?$/);
+  }
+
   render () {
     const { account, intl } = this.props;
 
@@ -147,7 +154,7 @@ class ActionBar extends React.PureComponent {
 
         <div className='account__action-bar'>
           <div className='account__action-bar-links'>
-            <NavLink exact activeClassName='active' className='account__action-bar__tab' to={`/accounts/${account.get('id')}`} title={intl.formatNumber(account.get('statuses_count'))}>
+            <NavLink isActive={this.isStatusesPageActive} activeClassName='active' className='account__action-bar__tab' to={`/accounts/${account.get('id')}`} title={intl.formatNumber(account.get('statuses_count'))}>
               <FormattedMessage id='account.posts' defaultMessage='Toots' />
               <strong>{shortNumberFormat(account.get('statuses_count'))}</strong>
             </NavLink>