From f378f5203062afc77c6136a234ffb40f3483bae1 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 1 Oct 2019 04:57:27 +0200 Subject: [PATCH] [Glitch] Add refresh button to list of rebloggers/favouriters in web UI Port b7b91d359729c2edced18048a04e4032d6d61a4c to glitch-soc Signed-off-by: Thibaut Girka --- .../flavours/glitch/features/favourites/index.js | 9 +++++++++ app/javascript/flavours/glitch/features/reblogs/index.js | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/app/javascript/flavours/glitch/features/favourites/index.js b/app/javascript/flavours/glitch/features/favourites/index.js index da118899e9..953bf171f9 100644 --- a/app/javascript/flavours/glitch/features/favourites/index.js +++ b/app/javascript/flavours/glitch/features/favourites/index.js @@ -6,6 +6,7 @@ import LoadingIndicator from 'flavours/glitch/components/loading_indicator'; import { fetchFavourites } from 'flavours/glitch/actions/interactions'; import AccountContainer from 'flavours/glitch/containers/account_container'; import Column from 'flavours/glitch/features/ui/components/column'; +import Icon from 'flavours/glitch/components/icon'; import ColumnHeader from 'flavours/glitch/components/column_header'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; @@ -13,6 +14,7 @@ import ScrollableList from '../../components/scrollable_list'; const messages = defineMessages({ heading: { id: 'column.favourited_by', defaultMessage: 'Favourited by' }, + refresh: { id: 'refresh', defaultMessage: 'Refresh' }, }); const mapStateToProps = (state, props) => ({ @@ -51,6 +53,10 @@ class Favourites extends ImmutablePureComponent { this.column = c; } + handleRefresh = () => { + this.props.dispatch(fetchFavourites(this.props.params.statusId)); + } + render () { const { intl, accountIds, multiColumn } = this.props; @@ -72,6 +78,9 @@ class Favourites extends ImmutablePureComponent { onClick={this.handleHeaderClick} showBackButton multiColumn={multiColumn} + extraButton={( + + )} /> ({ @@ -51,6 +53,10 @@ class Reblogs extends ImmutablePureComponent { this.column = c; } + handleRefresh = () => { + this.props.dispatch(fetchReblogs(this.props.params.statusId)); + } + render () { const { intl, accountIds, multiColumn } = this.props; @@ -72,6 +78,9 @@ class Reblogs extends ImmutablePureComponent { onClick={this.handleHeaderClick} showBackButton multiColumn={multiColumn} + extraButton={( + + )} />