mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-10-30 07:22:35 +01:00
Series index selector improvements
This commit is contained in:
parent
a63ca0f0e9
commit
2b63110323
@ -1,6 +1,5 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import createClientSideCollectionSelector from 'Store/Selectors/createClientSideCollectionSelector';
|
||||
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
|
||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
||||
import SeriesIndexOverviews from './SeriesIndexOverviews';
|
||||
@ -8,18 +7,16 @@ import SeriesIndexOverviews from './SeriesIndexOverviews';
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
(state) => state.seriesIndex.overviewOptions,
|
||||
createClientSideCollectionSelector('series', 'seriesIndex'),
|
||||
createUISettingsSelector(),
|
||||
createDimensionsSelector(),
|
||||
(overviewOptions, series, uiSettings, dimensions) => {
|
||||
(overviewOptions, uiSettings, dimensions) => {
|
||||
return {
|
||||
overviewOptions,
|
||||
showRelativeDates: uiSettings.showRelativeDates,
|
||||
shortDateFormat: uiSettings.shortDateFormat,
|
||||
longDateFormat: uiSettings.longDateFormat,
|
||||
timeFormat: uiSettings.timeFormat,
|
||||
isSmallScreen: dimensions.isSmallScreen,
|
||||
...series
|
||||
isSmallScreen: dimensions.isSmallScreen
|
||||
};
|
||||
}
|
||||
);
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import createClientSideCollectionSelector from 'Store/Selectors/createClientSideCollectionSelector';
|
||||
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
|
||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
||||
import SeriesIndexPosters from './SeriesIndexPosters';
|
||||
@ -8,17 +7,15 @@ import SeriesIndexPosters from './SeriesIndexPosters';
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
(state) => state.seriesIndex.posterOptions,
|
||||
createClientSideCollectionSelector('series', 'seriesIndex'),
|
||||
createUISettingsSelector(),
|
||||
createDimensionsSelector(),
|
||||
(posterOptions, series, uiSettings, dimensions) => {
|
||||
(posterOptions, uiSettings, dimensions) => {
|
||||
return {
|
||||
posterOptions,
|
||||
showRelativeDates: uiSettings.showRelativeDates,
|
||||
shortDateFormat: uiSettings.shortDateFormat,
|
||||
timeFormat: uiSettings.timeFormat,
|
||||
isSmallScreen: dimensions.isSmallScreen,
|
||||
...series
|
||||
isSmallScreen: dimensions.isSmallScreen
|
||||
};
|
||||
}
|
||||
);
|
||||
|
@ -320,6 +320,10 @@ class SeriesIndex extends Component {
|
||||
<div className={styles.contentBodyContainer}>
|
||||
<ViewComponent
|
||||
contentBody={contentBody}
|
||||
items={items}
|
||||
filters={filters}
|
||||
sortKey={sortKey}
|
||||
sortDirection={sortDirection}
|
||||
scrollTop={scrollTop}
|
||||
jumpToCharacter={jumpToCharacter}
|
||||
onRender={this.onRender}
|
||||
|
@ -1,18 +1,18 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import createClientSideCollectionSelector from 'Store/Selectors/createClientSideCollectionSelector';
|
||||
import { setSeriesSort } from 'Store/Actions/seriesIndexActions';
|
||||
import SeriesIndexTable from './SeriesIndexTable';
|
||||
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
(state) => state.app.dimensions,
|
||||
createClientSideCollectionSelector('series', 'seriesIndex'),
|
||||
(dimensions, series) => {
|
||||
(state) => state.seriesIndex.tableOptions,
|
||||
(state) => state.seriesIndex.columns,
|
||||
(dimensions, tableOptions, columns) => {
|
||||
return {
|
||||
isSmallScreen: dimensions.isSmallScreen,
|
||||
...series,
|
||||
showBanners: series.tableOptions.showBanners
|
||||
showBanners: tableOptions.showBanners,
|
||||
columns
|
||||
};
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user