mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-24 11:38:07 +01:00
[Glitch] Make account media gallery more consistent with account timeline
Display “load more” more consistently, add a loading indicator on first load.
This commit is contained in:
parent
5f581d7c3c
commit
2d097c10d0
1 changed files with 10 additions and 4 deletions
|
@ -107,8 +107,8 @@ export default class AccountGallery extends ImmutablePureComponent {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isLoading && medias.size > 0 && hasMore) {
|
if (hasMore) {
|
||||||
loadOlder = <LoadMore onClick={this.handleLoadOlder} />;
|
loadOlder = <LoadMore visible={!isLoading} onClick={this.handleLoadOlder} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -116,10 +116,10 @@ export default class AccountGallery extends ImmutablePureComponent {
|
||||||
<ColumnBackButton />
|
<ColumnBackButton />
|
||||||
|
|
||||||
<ScrollContainer scrollKey='account_gallery' shouldUpdateScroll={this.shouldUpdateScroll}>
|
<ScrollContainer scrollKey='account_gallery' shouldUpdateScroll={this.shouldUpdateScroll}>
|
||||||
<div className='scrollable' onScroll={this.handleScroll}>
|
<div className='scrollable scrollable--flex' onScroll={this.handleScroll}>
|
||||||
<HeaderContainer accountId={this.props.params.accountId} />
|
<HeaderContainer accountId={this.props.params.accountId} />
|
||||||
|
|
||||||
<div className='account-gallery__container'>
|
<div role='feed' className='account-gallery__container'>
|
||||||
{medias.map((media, index) => media === null ? (
|
{medias.map((media, index) => media === null ? (
|
||||||
<LoadMoreMedia
|
<LoadMoreMedia
|
||||||
key={'more:' + medias.getIn(index + 1, 'id')}
|
key={'more:' + medias.getIn(index + 1, 'id')}
|
||||||
|
@ -134,6 +134,12 @@ export default class AccountGallery extends ImmutablePureComponent {
|
||||||
))}
|
))}
|
||||||
{loadOlder}
|
{loadOlder}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{isLoading && medias.size === 0 && (
|
||||||
|
<div className='scrollable__append'>
|
||||||
|
<LoadingIndicator />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</ScrollContainer>
|
</ScrollContainer>
|
||||||
</Column>
|
</Column>
|
||||||
|
|
Loading…
Reference in a new issue