1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-21 22:05:43 -04:00

Refactor Movie index to use react-window

This commit is contained in:
Robin Dadswell
2023-03-12 19:03:34 +00:00
committed by Qstick
parent 68832a136e
commit e0b91c6406
95 changed files with 3347 additions and 4922 deletions
@@ -18,6 +18,8 @@ class ImportMovie extends Component {
constructor(props, context) {
super(props, context);
this.scrollerRef = React.createRef();
this.state = {
allSelected: false,
allUnselected: false,
@@ -27,13 +29,6 @@ class ImportMovie extends Component {
};
}
//
// Control
setScrollerRef = (ref) => {
this.setState({ scroller: ref });
};
//
// Listeners
@@ -88,16 +83,12 @@ class ImportMovie extends Component {
const {
allSelected,
allUnselected,
selectedState,
scroller
selectedState
} = this.state;
return (
<PageContent title={translate('ImportMovies')}>
<PageContentBody
registerScroller={this.setScrollerRef}
onScroll={this.onScroll}
>
<PageContentBody ref={this.scrollerRef} >
{
rootFoldersFetching ? <LoadingIndicator /> : null
}
@@ -126,14 +117,14 @@ class ImportMovie extends Component {
!rootFoldersFetching &&
rootFoldersPopulated &&
!!unmappedFolders.length &&
scroller ?
this.scrollerRef.current ?
<ImportMovieTableConnector
rootFolderId={rootFolderId}
unmappedFolders={unmappedFolders}
allSelected={allSelected}
allUnselected={allUnselected}
selectedState={selectedState}
scroller={scroller}
scroller={this.scrollerRef.current}
onSelectAllChange={this.onSelectAllChange}
onSelectedChange={this.onSelectedChange}
onRemoveSelectedStateItem={this.onRemoveSelectedStateItem}