From ceed1ebe5b308a95f9c167c93d3bc0976937fb58 Mon Sep 17 00:00:00 2001 From: Jakub Mendyk Date: Wed, 29 Aug 2018 01:19:58 +0200 Subject: [PATCH] Fix followers/follows layout issues from #8418 (#8505) * Add alwaysShowScrollbar prop to ScrollableList * Fix followers/follows layout issues from #8418 --- app/javascript/mastodon/components/scrollable_list.js | 9 ++++++--- app/javascript/mastodon/features/followers/index.js | 5 +++-- app/javascript/mastodon/features/following/index.js | 5 +++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/javascript/mastodon/components/scrollable_list.js b/app/javascript/mastodon/components/scrollable_list.js index 4b433f32c38..5c888650c37 100644 --- a/app/javascript/mastodon/components/scrollable_list.js +++ b/app/javascript/mastodon/components/scrollable_list.js @@ -26,6 +26,7 @@ export default class ScrollableList extends PureComponent { hasMore: PropTypes.bool, prepend: PropTypes.node, alwaysPrepend: PropTypes.bool, + alwaysShowScrollbar: PropTypes.bool, emptyMessage: PropTypes.node, children: PropTypes.node, }; @@ -141,7 +142,7 @@ export default class ScrollableList extends PureComponent { } render () { - const { children, scrollKey, trackScroll, shouldUpdateScroll, isLoading, hasMore, prepend, alwaysPrepend, emptyMessage, onLoadMore } = this.props; + const { children, scrollKey, trackScroll, shouldUpdateScroll, isLoading, hasMore, prepend, alwaysPrepend, alwaysShowScrollbar, emptyMessage, onLoadMore } = this.props; const { fullscreen } = this.state; const childrenCount = React.Children.count(children); @@ -172,11 +173,13 @@ export default class ScrollableList extends PureComponent { ); } else { + const scrollable = alwaysShowScrollbar; + scrollableArea = ( -
+
{alwaysPrepend && prepend} -
+
{emptyMessage}
diff --git a/app/javascript/mastodon/features/followers/index.js b/app/javascript/mastodon/features/followers/index.js index 5eb05367ef1..97d59cc4ac5 100644 --- a/app/javascript/mastodon/features/followers/index.js +++ b/app/javascript/mastodon/features/followers/index.js @@ -66,13 +66,14 @@ export default class Followers extends ImmutablePureComponent { - - } + alwaysPrepend + alwaysShowScrollbar emptyMessage={emptyMessage} > {accountIds.map(id => diff --git a/app/javascript/mastodon/features/following/index.js b/app/javascript/mastodon/features/following/index.js index 95e786882ad..17bc7ec6ed9 100644 --- a/app/javascript/mastodon/features/following/index.js +++ b/app/javascript/mastodon/features/following/index.js @@ -66,13 +66,14 @@ export default class Following extends ImmutablePureComponent { - - } + alwaysPrepend + alwaysShowScrollbar emptyMessage={emptyMessage} > {accountIds.map(id =>