|
|
@ -105,6 +105,7 @@ class AuthorIndexPosters extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
this._isInitialized = false;
|
|
|
|
this._isInitialized = false;
|
|
|
|
this._grid = null;
|
|
|
|
this._grid = null;
|
|
|
|
|
|
|
|
this._padding = props.isSmallScreen ? columnPaddingSmallScreen : columnPadding;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps, prevState) {
|
|
|
|
componentDidUpdate(prevProps, prevState) {
|
|
|
@ -112,7 +113,8 @@ class AuthorIndexPosters extends Component {
|
|
|
|
items,
|
|
|
|
items,
|
|
|
|
sortKey,
|
|
|
|
sortKey,
|
|
|
|
posterOptions,
|
|
|
|
posterOptions,
|
|
|
|
jumpToCharacter
|
|
|
|
jumpToCharacter,
|
|
|
|
|
|
|
|
isSmallScreen
|
|
|
|
} = this.props;
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
const {
|
|
|
@ -124,7 +126,7 @@ class AuthorIndexPosters extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
if (prevProps.sortKey !== sortKey ||
|
|
|
|
if (prevProps.sortKey !== sortKey ||
|
|
|
|
prevProps.posterOptions !== posterOptions) {
|
|
|
|
prevProps.posterOptions !== posterOptions) {
|
|
|
|
this.calculateGrid();
|
|
|
|
this.calculateGrid(width, isSmallScreen);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (this._grid &&
|
|
|
|
if (this._grid &&
|
|
|
@ -164,10 +166,9 @@ class AuthorIndexPosters extends Component {
|
|
|
|
posterOptions
|
|
|
|
posterOptions
|
|
|
|
} = this.props;
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
const padding = isSmallScreen ? columnPaddingSmallScreen : columnPadding;
|
|
|
|
|
|
|
|
const columnWidth = calculateColumnWidth(width, posterOptions.size, isSmallScreen);
|
|
|
|
const columnWidth = calculateColumnWidth(width, posterOptions.size, isSmallScreen);
|
|
|
|
const columnCount = Math.max(Math.floor(width / columnWidth), 1);
|
|
|
|
const columnCount = Math.max(Math.floor(width / columnWidth), 1);
|
|
|
|
const posterWidth = columnWidth - padding;
|
|
|
|
const posterWidth = columnWidth - this._padding * 2;
|
|
|
|
const posterHeight = calculatePosterHeight(posterWidth);
|
|
|
|
const posterHeight = calculatePosterHeight(posterWidth);
|
|
|
|
const rowHeight = calculateRowHeight(posterHeight, sortKey, isSmallScreen, posterOptions);
|
|
|
|
const rowHeight = calculateRowHeight(posterHeight, sortKey, isSmallScreen, posterOptions);
|
|
|
|
|
|
|
|
|
|
|
@ -214,7 +215,10 @@ class AuthorIndexPosters extends Component {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
key={key}
|
|
|
|
key={key}
|
|
|
|
style={style}
|
|
|
|
style={{
|
|
|
|
|
|
|
|
...style,
|
|
|
|
|
|
|
|
padding: this._padding
|
|
|
|
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<AuthorIndexItemConnector
|
|
|
|
<AuthorIndexItemConnector
|
|
|
|
key={author.id}
|
|
|
|
key={author.id}
|
|
|
@ -229,6 +233,7 @@ class AuthorIndexPosters extends Component {
|
|
|
|
showRelativeDates={showRelativeDates}
|
|
|
|
showRelativeDates={showRelativeDates}
|
|
|
|
shortDateFormat={shortDateFormat}
|
|
|
|
shortDateFormat={shortDateFormat}
|
|
|
|
timeFormat={timeFormat}
|
|
|
|
timeFormat={timeFormat}
|
|
|
|
|
|
|
|
style={style}
|
|
|
|
authorId={author.id}
|
|
|
|
authorId={author.id}
|
|
|
|
qualityProfileId={author.qualityProfileId}
|
|
|
|
qualityProfileId={author.qualityProfileId}
|
|
|
|
metadataProfileId={author.metadataProfileId}
|
|
|
|
metadataProfileId={author.metadataProfileId}
|
|
|
@ -249,9 +254,9 @@ class AuthorIndexPosters extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
|
|
|
|
scroller,
|
|
|
|
items,
|
|
|
|
items,
|
|
|
|
isSmallScreen,
|
|
|
|
isSmallScreen
|
|
|
|
scroller
|
|
|
|
|
|
|
|
} = this.props;
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|