@@ -7,7 +7,6 @@ import {formatBytes} from "../../../utils/Tools";
7
7
import { performCopyFile , performMoveFile } from "../../../utils/API/API" ;
8
8
import { toast } from "react-toastify" ;
9
9
import * as PropTypes from "prop-types" ;
10
- import handleViewport from 'react-in-viewport' ;
11
10
import MediaWidget , { isMedia } from "../../Base/MediaWidget/MediaWidget" ;
12
11
import { PROP_ITEM } from "../../../utils/RclonePropTypes" ;
13
12
import ErrorBoundary from "../../../ErrorHandling/ErrorBoundary" ;
@@ -154,24 +153,17 @@ class FileComponent extends React.Component {
154
153
</ div >
155
154
)
156
155
} else {
157
- if ( inViewport ) {
158
- element = connectDragSource (
159
- < tr className = "pointer-cursor fadeIn" >
160
- < td onClick = { ( e ) => clickHandler ( e , item ) } >
161
- < FileIcon IsDir = { IsDir } MimeType = { MimeType } /> { " " } { Name }
162
- </ td >
163
- < td > { Size === - 1 ? "-" : formatBytes ( Size , 2 ) } </ td >
164
- < td className = "d-none d-md-table-cell" > { modTime . toLocaleDateString ( ) } </ td >
165
- < td > < FileActions downloadHandle = { downloadHandle } linkShareHandle = { linkShareHandle }
166
- deleteHandle = { deleteHandle } item = { item } /> </ td >
167
- </ tr >
168
- )
169
- } else {
170
- // not in view, render an empty div
171
- element = ( < tr className = { "pointer-cursor" } style = { { height : "60px" } } >
172
-
173
- </ tr > )
174
- }
156
+ element = connectDragSource (
157
+ < tr className = "pointer-cursor fadeIn" >
158
+ < td onClick = { ( e ) => clickHandler ( e , item ) } >
159
+ < FileIcon IsDir = { IsDir } MimeType = { MimeType } /> { " " } { Name }
160
+ </ td >
161
+ < td > { Size === - 1 ? "-" : formatBytes ( Size , 2 ) } </ td >
162
+ < td className = "d-none d-md-table-cell" > { modTime . toLocaleDateString ( ) } </ td >
163
+ < td > < FileActions downloadHandle = { downloadHandle } linkShareHandle = { linkShareHandle }
164
+ deleteHandle = { deleteHandle } item = { item } /> </ td >
165
+ </ tr >
166
+ )
175
167
}
176
168
return < ErrorBoundary >
177
169
{ element }
@@ -237,9 +229,4 @@ FileComponent.propTypes = {
237
229
238
230
} ;
239
231
240
- /**
241
- * Handles view port to check if the current item is visible on the screen.
242
- */
243
- const MyViewPort = handleViewport ( FileComponent , { rootMargin : '-1.0px' } ) ;
244
-
245
- export default DragSource ( ItemTypes . FILECOMPONENT , fileComponentSource , collect ) ( MyViewPort ) ;
232
+ export default DragSource ( ItemTypes . FILECOMPONENT , fileComponentSource , collect ) ( FileComponent ) ;
0 commit comments