From e9f88f40058a510da9d36feb57f5edf1d98908d9 Mon Sep 17 00:00:00 2001 From: Jakub Mendyk Date: Sun, 26 Aug 2018 16:39:37 +0200 Subject: [Glitch] Add messages informing that collections are empty Port 5129f6f2aa56afb21708aec552a798d062ccaff9 to glitch-soc Signed-off-by: Thibaut Girka --- .../flavours/glitch/features/reblogs/index.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'app/javascript/flavours/glitch/features/reblogs') diff --git a/app/javascript/flavours/glitch/features/reblogs/index.js b/app/javascript/flavours/glitch/features/reblogs/index.js index e007506b7..cb1dc5c29 100644 --- a/app/javascript/flavours/glitch/features/reblogs/index.js +++ b/app/javascript/flavours/glitch/features/reblogs/index.js @@ -4,12 +4,12 @@ import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import LoadingIndicator from 'flavours/glitch/components/loading_indicator'; import { fetchReblogs } from 'flavours/glitch/actions/interactions'; -import { ScrollContainer } from 'react-router-scroll-4'; import AccountContainer from 'flavours/glitch/containers/account_container'; import Column from 'flavours/glitch/features/ui/components/column'; import ColumnHeader from 'flavours/glitch/components/column_header'; -import { defineMessages, injectIntl } from 'react-intl'; +import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; +import ScrollableList from 'flavours/glitch/components/scrollable_list'; const messages = defineMessages({ heading: { id: 'column.reblogged_by', defaultMessage: 'Boosted by' }, @@ -64,6 +64,8 @@ export default class Reblogs extends ImmutablePureComponent { ); } + const emptyMessage = ; + return ( - -
- {accountIds.map(id => )} -
-
+ + {accountIds.map(id => + + )} +
); } -- cgit From 6db5669818cce459b9bb916665541b7b8f5d5155 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sat, 20 Jul 2019 16:07:55 +0200 Subject: Clean up redundant shouldUpdateScroll definitions --- app/javascript/flavours/glitch/features/blocks/index.js | 6 ------ app/javascript/flavours/glitch/features/community_timeline/index.js | 5 ----- app/javascript/flavours/glitch/features/favourites/index.js | 6 ------ app/javascript/flavours/glitch/features/follow_requests/index.js | 6 ------ app/javascript/flavours/glitch/features/followers/index.js | 6 ------ app/javascript/flavours/glitch/features/following/index.js | 1 - app/javascript/flavours/glitch/features/mutes/index.js | 6 ------ app/javascript/flavours/glitch/features/public_timeline/index.js | 4 ---- app/javascript/flavours/glitch/features/reblogs/index.js | 6 ------ 9 files changed, 46 deletions(-) (limited to 'app/javascript/flavours/glitch/features/reblogs') diff --git a/app/javascript/flavours/glitch/features/blocks/index.js b/app/javascript/flavours/glitch/features/blocks/index.js index 1a7206f80..2d0f10ae7 100644 --- a/app/javascript/flavours/glitch/features/blocks/index.js +++ b/app/javascript/flavours/glitch/features/blocks/index.js @@ -41,11 +41,6 @@ export default class Blocks extends ImmutablePureComponent { this.props.dispatch(expandBlocks()); }, 300, { leading: true }); - shouldUpdateScroll = (prevRouterProps, { location }) => { - if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false; - return !(location.state && location.state.mastodonModalOpen); - } - render () { const { intl, accountIds, hasMore } = this.props; @@ -66,7 +61,6 @@ export default class Blocks extends ImmutablePureComponent { scrollKey='blocks' onLoadMore={this.handleLoadMore} hasMore={hasMore} - shouldUpdateScroll={this.shouldUpdateScroll} emptyMessage={emptyMessage} > {accountIds.map(id => diff --git a/app/javascript/flavours/glitch/features/community_timeline/index.js b/app/javascript/flavours/glitch/features/community_timeline/index.js index 2c0fbff36..24126e5bc 100644 --- a/app/javascript/flavours/glitch/features/community_timeline/index.js +++ b/app/javascript/flavours/glitch/features/community_timeline/index.js @@ -99,10 +99,6 @@ export default class CommunityTimeline extends React.PureComponent { dispatch(expandCommunityTimeline({ maxId, onlyMedia })); } - shouldUpdateScroll = (prevRouterProps, { location }) => { - return !(location.state && location.state.mastodonModalOpen) - } - render () { const { intl, hasUnread, columnId, multiColumn, onlyMedia } = this.props; const pinned = !!columnId; @@ -125,7 +121,6 @@ export default class CommunityTimeline extends React.PureComponent { } diff --git a/app/javascript/flavours/glitch/features/favourites/index.js b/app/javascript/flavours/glitch/features/favourites/index.js index 16ce6ed10..81f0b24c4 100644 --- a/app/javascript/flavours/glitch/features/favourites/index.js +++ b/app/javascript/flavours/glitch/features/favourites/index.js @@ -40,11 +40,6 @@ export default class Favourites extends ImmutablePureComponent { } } - shouldUpdateScroll = (prevRouterProps, { location }) => { - if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false; - return !(location.state && location.state.mastodonModalOpen); - } - handleHeaderClick = () => { this.column.scrollTop(); } @@ -76,7 +71,6 @@ export default class Favourites extends ImmutablePureComponent { /> {accountIds.map(id => diff --git a/app/javascript/flavours/glitch/features/follow_requests/index.js b/app/javascript/flavours/glitch/features/follow_requests/index.js index eacf1e0ac..89340320e 100644 --- a/app/javascript/flavours/glitch/features/follow_requests/index.js +++ b/app/javascript/flavours/glitch/features/follow_requests/index.js @@ -41,11 +41,6 @@ export default class FollowRequests extends ImmutablePureComponent { this.props.dispatch(expandFollowRequests()); }, 300, { leading: true }); - shouldUpdateScroll = (prevRouterProps, { location }) => { - if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false; - return !(location.state && location.state.mastodonModalOpen); - } - render () { const { intl, accountIds, hasMore } = this.props; @@ -67,7 +62,6 @@ export default class FollowRequests extends ImmutablePureComponent { scrollKey='follow_requests' onLoadMore={this.handleLoadMore} hasMore={hasMore} - shouldUpdateScroll={this.shouldUpdateScroll} emptyMessage={emptyMessage} > {accountIds.map(id => diff --git a/app/javascript/flavours/glitch/features/followers/index.js b/app/javascript/flavours/glitch/features/followers/index.js index 704e0c92e..c57a2b1a2 100644 --- a/app/javascript/flavours/glitch/features/followers/index.js +++ b/app/javascript/flavours/glitch/features/followers/index.js @@ -64,11 +64,6 @@ export default class Followers extends ImmutablePureComponent { this.props.dispatch(expandFollowers(this.props.params.accountId)); }, 300, { leading: true }); - shouldUpdateScroll = (prevRouterProps, { location }) => { - if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false; - return !(location.state && location.state.mastodonModalOpen); - } - setRef = c => { this.column = c; } @@ -102,7 +97,6 @@ export default class Followers extends ImmutablePureComponent { scrollKey='followers' hasMore={hasMore} onLoadMore={this.handleLoadMore} - shouldUpdateScroll={this.shouldUpdateScroll} prepend={} alwaysPrepend emptyMessage={emptyMessage} diff --git a/app/javascript/flavours/glitch/features/following/index.js b/app/javascript/flavours/glitch/features/following/index.js index 46cc773e7..b61f83988 100644 --- a/app/javascript/flavours/glitch/features/following/index.js +++ b/app/javascript/flavours/glitch/features/following/index.js @@ -97,7 +97,6 @@ export default class Following extends ImmutablePureComponent { scrollKey='following' hasMore={hasMore} onLoadMore={this.handleLoadMore} - shouldUpdateScroll={this.shouldUpdateScroll} prepend={} alwaysPrepend emptyMessage={emptyMessage} diff --git a/app/javascript/flavours/glitch/features/mutes/index.js b/app/javascript/flavours/glitch/features/mutes/index.js index 35c15deec..e5b5bb46d 100644 --- a/app/javascript/flavours/glitch/features/mutes/index.js +++ b/app/javascript/flavours/glitch/features/mutes/index.js @@ -41,11 +41,6 @@ export default class Mutes extends ImmutablePureComponent { this.props.dispatch(expandMutes()); }, 300, { leading: true }); - shouldUpdateScroll = (prevRouterProps, { location }) => { - if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false; - return !(location.state && location.state.mastodonModalOpen); - } - render () { const { intl, accountIds, hasMore } = this.props; @@ -66,7 +61,6 @@ export default class Mutes extends ImmutablePureComponent { scrollKey='mutes' onLoadMore={this.handleLoadMore} hasMore={hasMore} - shouldUpdateScroll={this.shouldUpdateScroll} emptyMessage={emptyMessage} > {accountIds.map(id => diff --git a/app/javascript/flavours/glitch/features/public_timeline/index.js b/app/javascript/flavours/glitch/features/public_timeline/index.js index 7fe472202..e5f5171aa 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/index.js +++ b/app/javascript/flavours/glitch/features/public_timeline/index.js @@ -99,10 +99,6 @@ export default class PublicTimeline extends React.PureComponent { dispatch(expandPublicTimeline({ maxId, onlyMedia })); } - shouldUpdateScroll = (prevRouterProps, { location }) => { - return !(location.state && location.state.mastodonModalOpen) - } - render () { const { intl, columnId, hasUnread, multiColumn, onlyMedia } = this.props; const pinned = !!columnId; diff --git a/app/javascript/flavours/glitch/features/reblogs/index.js b/app/javascript/flavours/glitch/features/reblogs/index.js index cb1dc5c29..14f44a20a 100644 --- a/app/javascript/flavours/glitch/features/reblogs/index.js +++ b/app/javascript/flavours/glitch/features/reblogs/index.js @@ -40,11 +40,6 @@ export default class Reblogs extends ImmutablePureComponent { } } - shouldUpdateScroll = (prevRouterProps, { location }) => { - if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false; - return !(location.state && location.state.mastodonModalOpen); - } - handleHeaderClick = () => { this.column.scrollTop(); } @@ -77,7 +72,6 @@ export default class Reblogs extends ImmutablePureComponent { {accountIds.map(id => -- cgit