From 466d4fba9e17f6356edb3d24fa7ffffffdba7fe5 Mon Sep 17 00:00:00 2001 From: ta264 Date: Sun, 5 Jan 2020 21:45:01 +0000 Subject: [PATCH] Don't rerender all cells each scroll --- .../Index/Overview/SeriesIndexOverview.css | 8 - .../Index/Overview/SeriesIndexOverview.js | 4 +- .../Index/Overview/SeriesIndexOverviews.css | 8 + .../Index/Overview/SeriesIndexOverviews.js | 39 +-- .../Index/Posters/SeriesIndexPoster.css | 4 - .../Series/Index/Posters/SeriesIndexPoster.js | 248 +++++++++--------- .../Index/Posters/SeriesIndexPosters.css | 4 + .../Index/Posters/SeriesIndexPosters.js | 39 +-- .../src/Series/Index/Table/SeriesIndexRow.js | 7 +- .../Series/Index/Table/SeriesIndexTable.js | 22 +- 10 files changed, 197 insertions(+), 186 deletions(-) diff --git a/frontend/src/Series/Index/Overview/SeriesIndexOverview.css b/frontend/src/Series/Index/Overview/SeriesIndexOverview.css index 054319ebc..92afae849 100644 --- a/frontend/src/Series/Index/Overview/SeriesIndexOverview.css +++ b/frontend/src/Series/Index/Overview/SeriesIndexOverview.css @@ -1,13 +1,5 @@ $hoverScale: 1.05; -.container { - &:hover { - .content { - background-color: $tableRowHoverBackgroundColor; - } - } -} - .content { display: flex; flex-grow: 1; diff --git a/frontend/src/Series/Index/Overview/SeriesIndexOverview.js b/frontend/src/Series/Index/Overview/SeriesIndexOverview.js index 8f742a616..fbf02feba 100644 --- a/frontend/src/Series/Index/Overview/SeriesIndexOverview.js +++ b/frontend/src/Series/Index/Overview/SeriesIndexOverview.js @@ -70,7 +70,6 @@ class SeriesIndexOverview extends Component { render() { const { - style, id, title, overview, @@ -121,7 +120,7 @@ class SeriesIndexOverview extends Component { const overviewHeight = contentHeight - titleRowHeight; return ( -
+
@@ -242,7 +241,6 @@ class SeriesIndexOverview extends Component { } SeriesIndexOverview.propTypes = { - style: PropTypes.object.isRequired, id: PropTypes.number.isRequired, title: PropTypes.string.isRequired, overview: PropTypes.string.isRequired, diff --git a/frontend/src/Series/Index/Overview/SeriesIndexOverviews.css b/frontend/src/Series/Index/Overview/SeriesIndexOverviews.css index 9c6520fb5..5f8ca5baf 100644 --- a/frontend/src/Series/Index/Overview/SeriesIndexOverviews.css +++ b/frontend/src/Series/Index/Overview/SeriesIndexOverviews.css @@ -1,3 +1,11 @@ .grid { flex: 1 0 auto; } + +.container { + &:hover { + .content { + background-color: $tableRowHoverBackgroundColor; + } + } +} diff --git a/frontend/src/Series/Index/Overview/SeriesIndexOverviews.js b/frontend/src/Series/Index/Overview/SeriesIndexOverviews.js index 5202c5b1c..c66ed0c5e 100644 --- a/frontend/src/Series/Index/Overview/SeriesIndexOverviews.js +++ b/frontend/src/Series/Index/Overview/SeriesIndexOverviews.js @@ -185,24 +185,30 @@ class SeriesIndexOverviews extends Component { } return ( - + > + +
); } @@ -258,6 +264,7 @@ class SeriesIndexOverviews extends Component { overscanRowCount={2} cellRenderer={this.cellRenderer} onSectionRendered={this.onSectionRendered} + isScrollingOptOut={true} /> ); } diff --git a/frontend/src/Series/Index/Posters/SeriesIndexPoster.css b/frontend/src/Series/Index/Posters/SeriesIndexPoster.css index 3318e8d09..a99527037 100644 --- a/frontend/src/Series/Index/Posters/SeriesIndexPoster.css +++ b/frontend/src/Series/Index/Posters/SeriesIndexPoster.css @@ -1,9 +1,5 @@ $hoverScale: 1.05; -.container { - padding: 10px; -} - .content { transition: all 200ms ease-in; diff --git a/frontend/src/Series/Index/Posters/SeriesIndexPoster.js b/frontend/src/Series/Index/Posters/SeriesIndexPoster.js index 4e4238cc7..2e1ec3d1b 100644 --- a/frontend/src/Series/Index/Posters/SeriesIndexPoster.js +++ b/frontend/src/Series/Index/Posters/SeriesIndexPoster.js @@ -67,7 +67,6 @@ class SeriesIndexPoster extends Component { render() { const { - style, id, title, monitored, @@ -115,147 +114,144 @@ class SeriesIndexPoster extends Component { }; return ( -
-
-
- +
+
+
); } } SeriesIndexPoster.propTypes = { - style: PropTypes.object.isRequired, id: PropTypes.number.isRequired, title: PropTypes.string.isRequired, monitored: PropTypes.bool.isRequired, diff --git a/frontend/src/Series/Index/Posters/SeriesIndexPosters.css b/frontend/src/Series/Index/Posters/SeriesIndexPosters.css index 9c6520fb5..d80f951a0 100644 --- a/frontend/src/Series/Index/Posters/SeriesIndexPosters.css +++ b/frontend/src/Series/Index/Posters/SeriesIndexPosters.css @@ -1,3 +1,7 @@ .grid { flex: 1 0 auto; } + +.container { + padding: 10px; +} diff --git a/frontend/src/Series/Index/Posters/SeriesIndexPosters.js b/frontend/src/Series/Index/Posters/SeriesIndexPosters.js index e1ec8c459..2d55094c7 100644 --- a/frontend/src/Series/Index/Posters/SeriesIndexPosters.js +++ b/frontend/src/Series/Index/Posters/SeriesIndexPosters.js @@ -220,24 +220,30 @@ class SeriesIndexPosters extends Component { } return ( - + > + +
); } @@ -297,6 +303,7 @@ class SeriesIndexPosters extends Component { overscanRowCount={2} cellRenderer={this.cellRenderer} onSectionRendered={this.onSectionRendered} + isScrollingOptOut={true} /> ); } diff --git a/frontend/src/Series/Index/Table/SeriesIndexRow.js b/frontend/src/Series/Index/Table/SeriesIndexRow.js index 3ed4dd078..e6161ec9f 100644 --- a/frontend/src/Series/Index/Table/SeriesIndexRow.js +++ b/frontend/src/Series/Index/Table/SeriesIndexRow.js @@ -12,7 +12,6 @@ import SpinnerIconButton from 'Components/Link/SpinnerIconButton'; import ProgressBar from 'Components/ProgressBar'; import TagListConnector from 'Components/TagListConnector'; import CheckInput from 'Components/Form/CheckInput'; -import VirtualTableRow from 'Components/Table/VirtualTableRow'; import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell'; import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector'; import SeriesTitleLink from 'Series/SeriesTitleLink'; @@ -79,7 +78,6 @@ class SeriesIndexRow extends Component { render() { const { - style, id, monitored, status, @@ -126,7 +124,7 @@ class SeriesIndexRow extends Component { } = this.state; return ( - + <> { columns.map((column) => { const { @@ -494,13 +492,12 @@ class SeriesIndexRow extends Component { seriesId={id} onModalClose={this.onDeleteSeriesModalClose} /> - + ); } } SeriesIndexRow.propTypes = { - style: PropTypes.object.isRequired, id: PropTypes.number.isRequired, monitored: PropTypes.bool.isRequired, status: PropTypes.string.isRequired, diff --git a/frontend/src/Series/Index/Table/SeriesIndexTable.js b/frontend/src/Series/Index/Table/SeriesIndexTable.js index b3a9a2e5a..b07909e7f 100644 --- a/frontend/src/Series/Index/Table/SeriesIndexTable.js +++ b/frontend/src/Series/Index/Table/SeriesIndexTable.js @@ -3,6 +3,7 @@ import React, { Component } from 'react'; import getIndexOfFirstCharacter from 'Utilities/Array/getIndexOfFirstCharacter'; import { sortDirections } from 'Helpers/Props'; import VirtualTable from 'Components/Table/VirtualTable'; +import VirtualTableRow from 'Components/Table/VirtualTableRow'; import SeriesIndexItemConnector from 'Series/Index/SeriesIndexItemConnector'; import SeriesIndexHeaderConnector from './SeriesIndexHeaderConnector'; import SeriesIndexRow from './SeriesIndexRow'; @@ -50,16 +51,20 @@ class SeriesIndexTable extends Component { const series = items[rowIndex]; return ( - + > + + ); } @@ -108,6 +113,7 @@ class SeriesIndexTable extends Component { sortDirection={sortDirection} onRender={onRender} onScroll={onScroll} + isScrollingOptOut={true} /> ); }