@@ -16,7 +16,7 @@ require('../../../../styles/components/image_manager.scss')
16
16
const SCROLL_THRESHOLD = 100
17
17
18
18
const DEFAULT_QUERY = {
19
- limit : 30 ,
19
+ limit : 50 ,
20
20
ordering : '-created_at'
21
21
}
22
22
@@ -44,10 +44,10 @@ class ImageManagerComponent extends React.Component {
44
44
}
45
45
46
46
loadMore ( ) {
47
- if ( this . props . images . count > this . state . limit ) {
47
+ if ( this . props . images . count > this . state . limit ) {
48
48
this . setState ( prevState => ( {
49
- limit : prevState . limit + 10
50
- } ) , this . props . listImages ( this . props . token , { limit : this . state . limit , ordering : '-created_at' } ) )
49
+ limit : prevState . limit + 25
50
+ } ) , this . props . listImages ( this . props . token , R . assoc ( 'q' , this . state . q , { limit : this . state . limit , ordering : '-created_at' } ) ) )
51
51
}
52
52
}
53
53
@@ -97,15 +97,15 @@ class ImageManagerComponent extends React.Component {
97
97
98
98
onDrop ( files ) {
99
99
files . forEach ( file => {
100
- this . props . createImage ( this . props . token , { img : file } )
100
+ this . props . createImage ( this . props . token , { img : file } )
101
101
} )
102
102
}
103
103
104
104
render ( ) {
105
105
106
106
const image = this . getImage ( )
107
107
108
- const images = this . props . images . ids . map ( id => {
108
+ const images = this . props . images . ids . map ( id => {
109
109
const image = this . props . entities . remote [ id ]
110
110
return (
111
111
< ImageThumb
@@ -147,13 +147,15 @@ class ImageManagerComponent extends React.Component {
147
147
activeClassName = 'c-image-manager__images--active' >
148
148
< div
149
149
className = 'c-image-manager__images__container'
150
- ref = { ( node ) => { this . images = node } } > { images } </ div >
150
+ ref = { ( node ) => { this . images = node } } > { images }
151
+ </ div >
152
+ { this . props . images . isLoading && < h2 style = { { position :'relative' , top : '-8px' , width :'100%' , textAlign :'center' } } > Loading...</ h2 > }
151
153
</ Dropzone >
152
154
{ ! this . props . many ?
153
155
< div className = 'c-image-manager__active' >
154
156
{ image ? imagePanel : null }
155
157
</ div > : null }
156
-
158
+
157
159
</ div >
158
160
< div className = 'c-image-manager__footer' >
159
161
< div className = 'c-image-manger__footer__selected' />
0 commit comments