Add load previous button to DiscussionList

This commit is contained in:
David Sevilla Martin 2021-05-10 16:58:19 -04:00
parent a27f540aab
commit 0035cefa14
No known key found for this signature in database
GPG Key ID: 82702C6B549FB3BD
2 changed files with 21 additions and 1 deletions

View File

@ -41,6 +41,18 @@ export default class DiscussionList extends Component {
return (
<div className={'DiscussionList' + (state.isSearchResults() ? ' DiscussionList--searchResults' : '')}>
{state.hasPrev() && (
<div className="DiscussionList-loadPrev">
{state.isLoadingPrev() ? (
<LoadingIndicator />
) : (
<Button className="Button" onclick={state.loadPrev.bind(state)}>
{app.translator.trans('core.forum.discussion_list.load_prev_button')}
</Button>
)}
</div>
)}
<ul className="DiscussionList-discussions">
{state.getPages().map((pg) => {
return [

View File

@ -7,8 +7,12 @@
list-style-type: none;
position: relative;
}
.DiscussionList-loadMore {
.DiscussionList-loadMore, .DiscussionList-loadPrev {
text-align: center;
}
.DiscussionList-loadMore {
margin-top: 10px;
.LoadingIndicator-container {
@ -16,6 +20,10 @@
}
}
.DiscussionList-loadPrev .LoadingIndicator-container {
height: 36px;
}
@media @phone {
.DiscussionList {
margin: 0 -15px;