]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Prepend account header even when status list is empty
authorThibaut Girka <thib@sitedethib.com>
Tue, 13 Nov 2018 14:32:29 +0000 (15:32 +0100)
committerThibG <thib@sitedethib.com>
Tue, 13 Nov 2018 14:54:04 +0000 (15:54 +0100)
Partially port 90b64c006998ec3bae365007781c61e8a79eeeef

app/javascript/flavours/glitch/components/scrollable_list.js
app/javascript/flavours/glitch/components/status_list.js

index 3a6893b017972bfbd06d6dc3f780437c2f3299fa..a05d49829de187adfe49d981641479c5edf8899f 100644 (file)
@@ -27,6 +27,7 @@ export default class ScrollableList extends PureComponent {
     showLoading: PropTypes.bool,
     hasMore: PropTypes.bool,
     prepend: PropTypes.node,
+    alwaysPrepend: PropTypes.bool,
     emptyMessage: PropTypes.node,
     children: PropTypes.node,
   };
@@ -159,7 +160,7 @@ export default class ScrollableList extends PureComponent {
   }
 
   render () {
-    const { children, scrollKey, trackScroll, shouldUpdateScroll, showLoading, isLoading, hasMore, prepend, emptyMessage, onLoadMore } = this.props;
+    const { children, scrollKey, trackScroll, shouldUpdateScroll, showLoading, isLoading, hasMore, prepend, alwaysPrepend, emptyMessage, onLoadMore } = this.props;
     const { fullscreen } = this.state;
     const childrenCount = React.Children.count(children);
 
@@ -203,8 +204,12 @@ export default class ScrollableList extends PureComponent {
       );
     } else {
       scrollableArea = (
-        <div className='empty-column-indicator' ref={this.setRef}>
-          {emptyMessage}
+        <div className={classNames('scrollable', { fullscreen })} ref={this.setRef} style={{ flex: '1 1 auto', display: 'flex', flexDirection: 'column' }}>
+          {alwaysPrepend && prepend}
+
+          <div className='empty-column-indicator'>
+            {emptyMessage}
+          </div>
         </div>
       );
     }
index d13bd72f6f9edd6adbf5333c606cf4b130207ccf..68cd608b9114d1c9bcd47a4c4fdbbf9f2b05e746 100644 (file)
@@ -23,6 +23,7 @@ export default class StatusList extends ImmutablePureComponent {
     isPartial: PropTypes.bool,
     hasMore: PropTypes.bool,
     prepend: PropTypes.node,
+    alwaysPrepend: PropTypes.bool,
     emptyMessage: PropTypes.node,
     timelineId: PropTypes.string,
   };
This page took 0.032815 seconds and 3 git commands to generate.