mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-04-25 06:47:09 -04:00
Don't rerender all cells each scroll
This commit is contained in:
parent
108f6fe393
commit
466d4fba9e
10 changed files with 197 additions and 186 deletions
|
@ -1,13 +1,5 @@
|
||||||
$hoverScale: 1.05;
|
$hoverScale: 1.05;
|
||||||
|
|
||||||
.container {
|
|
||||||
&:hover {
|
|
||||||
.content {
|
|
||||||
background-color: $tableRowHoverBackgroundColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
|
|
@ -70,7 +70,6 @@ class SeriesIndexOverview extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
style,
|
|
||||||
id,
|
id,
|
||||||
title,
|
title,
|
||||||
overview,
|
overview,
|
||||||
|
@ -121,7 +120,7 @@ class SeriesIndexOverview extends Component {
|
||||||
const overviewHeight = contentHeight - titleRowHeight;
|
const overviewHeight = contentHeight - titleRowHeight;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container} style={style}>
|
<div className={styles.container}>
|
||||||
<div className={styles.content}>
|
<div className={styles.content}>
|
||||||
<div className={styles.poster}>
|
<div className={styles.poster}>
|
||||||
<div className={styles.posterContainer}>
|
<div className={styles.posterContainer}>
|
||||||
|
@ -242,7 +241,6 @@ class SeriesIndexOverview extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
SeriesIndexOverview.propTypes = {
|
SeriesIndexOverview.propTypes = {
|
||||||
style: PropTypes.object.isRequired,
|
|
||||||
id: PropTypes.number.isRequired,
|
id: PropTypes.number.isRequired,
|
||||||
title: PropTypes.string.isRequired,
|
title: PropTypes.string.isRequired,
|
||||||
overview: PropTypes.string.isRequired,
|
overview: PropTypes.string.isRequired,
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
.grid {
|
.grid {
|
||||||
flex: 1 0 auto;
|
flex: 1 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
&:hover {
|
||||||
|
.content {
|
||||||
|
background-color: $tableRowHoverBackgroundColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -185,8 +185,13 @@ class SeriesIndexOverviews extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SeriesIndexItemConnector
|
<div
|
||||||
|
className={styles.container}
|
||||||
key={key}
|
key={key}
|
||||||
|
style={style}
|
||||||
|
>
|
||||||
|
<SeriesIndexItemConnector
|
||||||
|
key={series.id}
|
||||||
component={SeriesIndexOverview}
|
component={SeriesIndexOverview}
|
||||||
sortKey={sortKey}
|
sortKey={sortKey}
|
||||||
posterWidth={posterWidth}
|
posterWidth={posterWidth}
|
||||||
|
@ -203,6 +208,7 @@ class SeriesIndexOverviews extends Component {
|
||||||
languageProfileId={series.languageProfileId}
|
languageProfileId={series.languageProfileId}
|
||||||
qualityProfileId={series.qualityProfileId}
|
qualityProfileId={series.qualityProfileId}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,6 +264,7 @@ class SeriesIndexOverviews extends Component {
|
||||||
overscanRowCount={2}
|
overscanRowCount={2}
|
||||||
cellRenderer={this.cellRenderer}
|
cellRenderer={this.cellRenderer}
|
||||||
onSectionRendered={this.onSectionRendered}
|
onSectionRendered={this.onSectionRendered}
|
||||||
|
isScrollingOptOut={true}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
$hoverScale: 1.05;
|
$hoverScale: 1.05;
|
||||||
|
|
||||||
.container {
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
transition: all 200ms ease-in;
|
transition: all 200ms ease-in;
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,6 @@ class SeriesIndexPoster extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
style,
|
|
||||||
id,
|
id,
|
||||||
title,
|
title,
|
||||||
monitored,
|
monitored,
|
||||||
|
@ -115,7 +114,6 @@ class SeriesIndexPoster extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container} style={style}>
|
|
||||||
<div className={styles.content}>
|
<div className={styles.content}>
|
||||||
<div className={styles.posterContainer}>
|
<div className={styles.posterContainer}>
|
||||||
<Label className={styles.controls}>
|
<Label className={styles.controls}>
|
||||||
|
@ -249,13 +247,11 @@ class SeriesIndexPoster extends Component {
|
||||||
onModalClose={this.onDeleteSeriesModalClose}
|
onModalClose={this.onDeleteSeriesModalClose}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SeriesIndexPoster.propTypes = {
|
SeriesIndexPoster.propTypes = {
|
||||||
style: PropTypes.object.isRequired,
|
|
||||||
id: PropTypes.number.isRequired,
|
id: PropTypes.number.isRequired,
|
||||||
title: PropTypes.string.isRequired,
|
title: PropTypes.string.isRequired,
|
||||||
monitored: PropTypes.bool.isRequired,
|
monitored: PropTypes.bool.isRequired,
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
.grid {
|
.grid {
|
||||||
flex: 1 0 auto;
|
flex: 1 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
|
@ -220,8 +220,13 @@ class SeriesIndexPosters extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SeriesIndexItemConnector
|
<div
|
||||||
|
className={styles.container}
|
||||||
key={key}
|
key={key}
|
||||||
|
style={style}
|
||||||
|
>
|
||||||
|
<SeriesIndexItemConnector
|
||||||
|
key={series.id}
|
||||||
component={SeriesIndexPoster}
|
component={SeriesIndexPoster}
|
||||||
sortKey={sortKey}
|
sortKey={sortKey}
|
||||||
posterWidth={posterWidth}
|
posterWidth={posterWidth}
|
||||||
|
@ -238,6 +243,7 @@ class SeriesIndexPosters extends Component {
|
||||||
languageProfileId={series.languageProfileId}
|
languageProfileId={series.languageProfileId}
|
||||||
qualityProfileId={series.qualityProfileId}
|
qualityProfileId={series.qualityProfileId}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,6 +303,7 @@ class SeriesIndexPosters extends Component {
|
||||||
overscanRowCount={2}
|
overscanRowCount={2}
|
||||||
cellRenderer={this.cellRenderer}
|
cellRenderer={this.cellRenderer}
|
||||||
onSectionRendered={this.onSectionRendered}
|
onSectionRendered={this.onSectionRendered}
|
||||||
|
isScrollingOptOut={true}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ import SpinnerIconButton from 'Components/Link/SpinnerIconButton';
|
||||||
import ProgressBar from 'Components/ProgressBar';
|
import ProgressBar from 'Components/ProgressBar';
|
||||||
import TagListConnector from 'Components/TagListConnector';
|
import TagListConnector from 'Components/TagListConnector';
|
||||||
import CheckInput from 'Components/Form/CheckInput';
|
import CheckInput from 'Components/Form/CheckInput';
|
||||||
import VirtualTableRow from 'Components/Table/VirtualTableRow';
|
|
||||||
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
|
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
|
||||||
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';
|
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';
|
||||||
import SeriesTitleLink from 'Series/SeriesTitleLink';
|
import SeriesTitleLink from 'Series/SeriesTitleLink';
|
||||||
|
@ -79,7 +78,6 @@ class SeriesIndexRow extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
style,
|
|
||||||
id,
|
id,
|
||||||
monitored,
|
monitored,
|
||||||
status,
|
status,
|
||||||
|
@ -126,7 +124,7 @@ class SeriesIndexRow extends Component {
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<VirtualTableRow style={style}>
|
<>
|
||||||
{
|
{
|
||||||
columns.map((column) => {
|
columns.map((column) => {
|
||||||
const {
|
const {
|
||||||
|
@ -494,13 +492,12 @@ class SeriesIndexRow extends Component {
|
||||||
seriesId={id}
|
seriesId={id}
|
||||||
onModalClose={this.onDeleteSeriesModalClose}
|
onModalClose={this.onDeleteSeriesModalClose}
|
||||||
/>
|
/>
|
||||||
</VirtualTableRow>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SeriesIndexRow.propTypes = {
|
SeriesIndexRow.propTypes = {
|
||||||
style: PropTypes.object.isRequired,
|
|
||||||
id: PropTypes.number.isRequired,
|
id: PropTypes.number.isRequired,
|
||||||
monitored: PropTypes.bool.isRequired,
|
monitored: PropTypes.bool.isRequired,
|
||||||
status: PropTypes.string.isRequired,
|
status: PropTypes.string.isRequired,
|
||||||
|
|
|
@ -3,6 +3,7 @@ import React, { Component } from 'react';
|
||||||
import getIndexOfFirstCharacter from 'Utilities/Array/getIndexOfFirstCharacter';
|
import getIndexOfFirstCharacter from 'Utilities/Array/getIndexOfFirstCharacter';
|
||||||
import { sortDirections } from 'Helpers/Props';
|
import { sortDirections } from 'Helpers/Props';
|
||||||
import VirtualTable from 'Components/Table/VirtualTable';
|
import VirtualTable from 'Components/Table/VirtualTable';
|
||||||
|
import VirtualTableRow from 'Components/Table/VirtualTableRow';
|
||||||
import SeriesIndexItemConnector from 'Series/Index/SeriesIndexItemConnector';
|
import SeriesIndexItemConnector from 'Series/Index/SeriesIndexItemConnector';
|
||||||
import SeriesIndexHeaderConnector from './SeriesIndexHeaderConnector';
|
import SeriesIndexHeaderConnector from './SeriesIndexHeaderConnector';
|
||||||
import SeriesIndexRow from './SeriesIndexRow';
|
import SeriesIndexRow from './SeriesIndexRow';
|
||||||
|
@ -50,16 +51,20 @@ class SeriesIndexTable extends Component {
|
||||||
const series = items[rowIndex];
|
const series = items[rowIndex];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SeriesIndexItemConnector
|
<VirtualTableRow
|
||||||
key={key}
|
key={key}
|
||||||
component={SeriesIndexRow}
|
|
||||||
style={style}
|
style={style}
|
||||||
|
>
|
||||||
|
<SeriesIndexItemConnector
|
||||||
|
key={series.id}
|
||||||
|
component={SeriesIndexRow}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
seriesId={series.id}
|
seriesId={series.id}
|
||||||
languageProfileId={series.languageProfileId}
|
languageProfileId={series.languageProfileId}
|
||||||
qualityProfileId={series.qualityProfileId}
|
qualityProfileId={series.qualityProfileId}
|
||||||
showBanners={showBanners}
|
showBanners={showBanners}
|
||||||
/>
|
/>
|
||||||
|
</VirtualTableRow>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,6 +113,7 @@ class SeriesIndexTable extends Component {
|
||||||
sortDirection={sortDirection}
|
sortDirection={sortDirection}
|
||||||
onRender={onRender}
|
onRender={onRender}
|
||||||
onScroll={onScroll}
|
onScroll={onScroll}
|
||||||
|
isScrollingOptOut={true}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue