Reactions page improvements

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
public-report
marcin mikołajczak 2021-09-10 00:23:49 +02:00
rodzic d60f187c98
commit fc8bb22359
2 zmienionych plików z 3 dodań i 5 usunięć

Wyświetl plik

@ -16,10 +16,8 @@ export default class ColumnBackButton extends React.PureComponent {
handleClick = () => {
const { to } = this.props;
if (to) {
this.context.router.history.push(to);
} else if (window.history && window.history.length === 1) {
this.context.router.history.push('/');
if (window.history && window.history.length === 1) {
this.context.router.history.push(to ? to : '/');
} else {
this.context.router.history.goBack();
}

Wyświetl plik

@ -91,7 +91,7 @@ class Reactions extends ImmutablePureComponent {
reactions.size > 0 && (
<div className='reaction__filter-bar'>
<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>
)
}