Highlight home tab for public timelines, fixes #406
This commit is contained in:
parent
8c137b0c3c
commit
28e8ab9067
1 changed files with 6 additions and 1 deletions
|
@ -46,6 +46,11 @@ class TabsBar extends React.PureComponent {
|
||||||
this.node = ref;
|
this.node = ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isHomeActive = (match, location) => {
|
||||||
|
const { pathname } = location;
|
||||||
|
return pathname === '/' || pathname.startsWith('/timeline/');
|
||||||
|
}
|
||||||
|
|
||||||
getNavLinks() {
|
getNavLinks() {
|
||||||
const { intl: { formatMessage }, logo, account } = this.props;
|
const { intl: { formatMessage }, logo, account } = this.props;
|
||||||
let links = [];
|
let links = [];
|
||||||
|
@ -57,7 +62,7 @@ class TabsBar extends React.PureComponent {
|
||||||
</Link>);
|
</Link>);
|
||||||
}
|
}
|
||||||
links.push(
|
links.push(
|
||||||
<NavLink key='home' className='tabs-bar__link' exact to='/' data-preview-title-id='column.home'>
|
<NavLink key='home' className='tabs-bar__link' exact to='/' data-preview-title-id='column.home' isActive={this.isHomeActive}>
|
||||||
<Icon id='home' />
|
<Icon id='home' />
|
||||||
<span><FormattedMessage id='tabs_bar.home' defaultMessage='Home' /></span>
|
<span><FormattedMessage id='tabs_bar.home' defaultMessage='Home' /></span>
|
||||||
</NavLink>);
|
</NavLink>);
|
||||||
|
|
Loading…
Reference in a new issue