Reactions page improvements
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
d60f187c98
commit
fc8bb22359
2 changed files with 3 additions and 5 deletions
|
@ -16,10 +16,8 @@ export default class ColumnBackButton extends React.PureComponent {
|
||||||
handleClick = () => {
|
handleClick = () => {
|
||||||
const { to } = this.props;
|
const { to } = this.props;
|
||||||
|
|
||||||
if (to) {
|
if (window.history && window.history.length === 1) {
|
||||||
this.context.router.history.push(to);
|
this.context.router.history.push(to ? to : '/');
|
||||||
} else if (window.history && window.history.length === 1) {
|
|
||||||
this.context.router.history.push('/');
|
|
||||||
} else {
|
} else {
|
||||||
this.context.router.history.goBack();
|
this.context.router.history.goBack();
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ class Reactions extends ImmutablePureComponent {
|
||||||
reactions.size > 0 && (
|
reactions.size > 0 && (
|
||||||
<div className='reaction__filter-bar'>
|
<div className='reaction__filter-bar'>
|
||||||
<NavLink to={`/@${username}/posts/${statusId}/reactions`} exact>All</NavLink>
|
<NavLink to={`/@${username}/posts/${statusId}/reactions`} exact>All</NavLink>
|
||||||
{reactions?.map(reaction => <NavLink to={`/@${username}/posts/${statusId}/reactions/${reaction.name}`}>{reaction.name} {reaction.count}</NavLink>)}
|
{reactions?.filter(reaction => reaction.count).map(reaction => <NavLink to={`/@${username}/posts/${statusId}/reactions/${reaction.name}`}>{reaction.name} {reaction.count}</NavLink>)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue