feat: display release dates for theatrical, digital, and physical release types (#1492)

* feat: display release dates for theatrical, digital, and physical release types

* fix(ui): use disc icon for physical release

* style: reformat to make new version of Prettier happy
This commit is contained in:
TheCatLady
2021-10-08 09:27:07 -04:00
committed by GitHub
parent 50ce198471
commit a4dca2356b
3 changed files with 87 additions and 30 deletions

View File

@@ -177,17 +177,12 @@ const TvDetails: React.FC<TvDetailsProps> = ({ tv }) => {
: 'US';
const seriesAttributes: React.ReactNode[] = [];
if (
data.contentRatings.results.length &&
data.contentRatings.results.find(
(r) => r.iso_3166_1 === region || data.contentRatings.results[0].rating
)
) {
const contentRating = data.contentRatings.results.find(
(r) => r.iso_3166_1 === region
)?.rating;
if (contentRating) {
seriesAttributes.push(
<span className="p-0.5 py-0 border rounded-md">
{data.contentRatings.results.find((r) => r.iso_3166_1 === region)
?.rating || data.contentRatings.results[0].rating}
</span>
<span className="p-0.5 py-0 border rounded-md">{contentRating}</span>
);
}