diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-09-21 07:17:44 +0200 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2018-09-21 12:56:29 +0200 |
commit | c1701ae2a837d7e6a59fc98d800a4c67fc4adaa8 (patch) | |
tree | d5a000a90ae90cfcb2d4c85fa75fb12d6a379a77 | |
parent | 925c185ef9cfba24cdeb7c3555b7f75c55738cab (diff) |
[Glitch] Fix “Toots” tab highlighting for replies and media timelines
Port front-end changes from f8b54d229f70cb726511bcd35e1440618e487672
-rw-r--r-- | app/javascript/flavours/glitch/features/account/components/action_bar.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/account/components/action_bar.js b/app/javascript/flavours/glitch/features/account/components/action_bar.js index e60b25855..3d6eeb06a 100644 --- a/app/javascript/flavours/glitch/features/account/components/action_bar.js +++ b/app/javascript/flavours/glitch/features/account/components/action_bar.js @@ -52,6 +52,13 @@ export default class ActionBar extends React.PureComponent { }); } + isStatusesPageActive = (match, location) => { + if (!match) { + return false; + } + return !location.pathname.match(/\/(followers|following)\/?$/); + } + render () { const { account, intl } = this.props; @@ -136,7 +143,7 @@ export default class ActionBar extends React.PureComponent { </div> <div className='account__action-bar-links'> - <NavLink exact activeClassName='active' className='account__action-bar__tab' to={`/accounts/${account.get('id')}`}> + <NavLink isActive={this.isStatusesPageActive} activeClassName='active' className='account__action-bar__tab' to={`/accounts/${account.get('id')}`}> <FormattedMessage id='account.posts' defaultMessage='Posts' /> <strong><FormattedNumber value={account.get('statuses_count')} /></strong> </NavLink> |