mirror of
https://github.com/flarum/framework.git
synced 2024-12-18 11:03:52 +08:00
Add load previous button to DiscussionList
This commit is contained in:
parent
a27f540aab
commit
0035cefa14
|
@ -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 [
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user