diff --git a/frontend/src/Author/Author.ts b/frontend/src/Author/Author.ts index c7f4907f2..0e57e34b0 100644 --- a/frontend/src/Author/Author.ts +++ b/frontend/src/Author/Author.ts @@ -1,5 +1,7 @@ import ModelBase from 'App/ModelBase'; +export type AuthorStatus = 'continuing' | 'ended'; + interface Author extends ModelBase { added: string; genres: string[]; @@ -10,6 +12,7 @@ interface Author extends ModelBase { metadataProfileId: number; rootFolderPath: string; sortName: string; + status: AuthorStatus; tags: number[]; authorName: string; isSaving?: boolean; diff --git a/frontend/src/Author/AuthorStatus.ts b/frontend/src/Author/AuthorStatus.ts new file mode 100644 index 000000000..a87fef995 --- /dev/null +++ b/frontend/src/Author/AuthorStatus.ts @@ -0,0 +1,21 @@ +import { AuthorStatus } from 'Author/Author'; +import { icons } from 'Helpers/Props'; +import translate from 'Utilities/String/translate'; + +export function getAuthorStatusDetails(status: AuthorStatus) { + let statusDetails = { + icon: icons.AUTHOR_CONTINUING, + title: translate('StatusEndedContinuing'), + message: translate('ContinuingMoreBooksAreExpected'), + }; + + if (status === 'ended') { + statusDetails = { + icon: icons.AUTHOR_ENDED, + title: translate('StatusEndedEnded'), + message: translate('ContinuingNoAdditionalBooksAreExpected'), + }; + } + + return statusDetails; +} diff --git a/frontend/src/Author/Details/AuthorDetailsHeader.js b/frontend/src/Author/Details/AuthorDetailsHeader.js index da6723258..88cfc2fed 100644 --- a/frontend/src/Author/Details/AuthorDetailsHeader.js +++ b/frontend/src/Author/Details/AuthorDetailsHeader.js @@ -2,6 +2,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import TextTruncate from 'react-text-truncate'; import AuthorPoster from 'Author/AuthorPoster'; +import { getAuthorStatusDetails } from 'Author/AuthorStatus'; import HeartRating from 'Components/HeartRating'; import Icon from 'Components/Icon'; import Label from 'Components/Label'; @@ -87,11 +88,11 @@ class AuthorDetailsHeader extends Component { titleWidth } = this.state; + const statusDetails = getAuthorStatusDetails(status); + const fanartUrl = getFanartUrl(images); const marqueeWidth = titleWidth - (isSmallScreen ? 85 : 160); - const continuing = status === 'continuing'; - let bookFilesCountMessage = translate('BookFilesCountMessage'); if (bookFileCount === 1) { @@ -236,16 +237,16 @@ class AuthorDetailsHeader extends Component { diff --git a/frontend/src/Author/Index/Table/AuthorStatusCell.js b/frontend/src/Author/Index/Table/AuthorStatusCell.js index 45187fd0a..d17f92c23 100644 --- a/frontend/src/Author/Index/Table/AuthorStatusCell.js +++ b/frontend/src/Author/Index/Table/AuthorStatusCell.js @@ -1,5 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; +import { getAuthorStatusDetails } from 'Author/AuthorStatus'; import Icon from 'Components/Icon'; import VirtualTableRowCell from 'Components/Table/Cells/TableRowCell'; import { icons } from 'Helpers/Props'; @@ -15,6 +16,8 @@ function AuthorStatusCell(props) { ...otherProps } = props; + const statusDetails = getAuthorStatusDetails(status); + return ( ); diff --git a/frontend/src/Bookshelf/BookshelfRow.js b/frontend/src/Bookshelf/BookshelfRow.js index c91acccf4..fd51b8628 100644 --- a/frontend/src/Bookshelf/BookshelfRow.js +++ b/frontend/src/Bookshelf/BookshelfRow.js @@ -1,12 +1,11 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import AuthorNameLink from 'Author/AuthorNameLink'; +import { getAuthorStatusDetails } from 'Author/AuthorStatus'; import Icon from 'Components/Icon'; import MonitorToggleButton from 'Components/MonitorToggleButton'; import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell'; import VirtualTableSelectCell from 'Components/Table/Cells/VirtualTableSelectCell'; -import { icons } from 'Helpers/Props'; -import translate from 'Utilities/String/translate'; import BookshelfBook from './BookshelfBook'; import styles from './BookshelfRow.css'; @@ -30,6 +29,8 @@ class BookshelfRow extends Component { onBookMonitoredPress } = this.props; + const statusDetails = getAuthorStatusDetails(status); + return ( <>