mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-11 15:47:09 -07:00
New: Artist genres on artist details page
Closes #2507 Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
parent
efb9013bad
commit
10c2f014bd
5 changed files with 66 additions and 1 deletions
|
@ -36,6 +36,7 @@ import InteractiveImportModal from '../../InteractiveImport/InteractiveImportMod
|
||||||
import ArtistAlternateTitles from './ArtistAlternateTitles';
|
import ArtistAlternateTitles from './ArtistAlternateTitles';
|
||||||
import ArtistDetailsLinks from './ArtistDetailsLinks';
|
import ArtistDetailsLinks from './ArtistDetailsLinks';
|
||||||
import ArtistDetailsSeasonConnector from './ArtistDetailsSeasonConnector';
|
import ArtistDetailsSeasonConnector from './ArtistDetailsSeasonConnector';
|
||||||
|
import ArtistGenres from './ArtistGenres';
|
||||||
import ArtistTagsConnector from './ArtistTagsConnector';
|
import ArtistTagsConnector from './ArtistTagsConnector';
|
||||||
import styles from './ArtistDetails.css';
|
import styles from './ArtistDetails.css';
|
||||||
|
|
||||||
|
@ -187,6 +188,7 @@ class ArtistDetails extends Component {
|
||||||
statistics,
|
statistics,
|
||||||
qualityProfileId,
|
qualityProfileId,
|
||||||
monitored,
|
monitored,
|
||||||
|
genres,
|
||||||
albumTypes,
|
albumTypes,
|
||||||
status,
|
status,
|
||||||
overview,
|
overview,
|
||||||
|
@ -431,6 +433,8 @@ class ArtistDetails extends Component {
|
||||||
rating={ratings.value}
|
rating={ratings.value}
|
||||||
iconSize={20}
|
iconSize={20}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<ArtistGenres genres={genres} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -695,6 +699,7 @@ ArtistDetails.propTypes = {
|
||||||
monitored: PropTypes.bool.isRequired,
|
monitored: PropTypes.bool.isRequired,
|
||||||
artistType: PropTypes.string,
|
artistType: PropTypes.string,
|
||||||
albumTypes: PropTypes.arrayOf(PropTypes.string),
|
albumTypes: PropTypes.arrayOf(PropTypes.string),
|
||||||
|
genres: PropTypes.arrayOf(PropTypes.string),
|
||||||
status: PropTypes.string.isRequired,
|
status: PropTypes.string.isRequired,
|
||||||
overview: PropTypes.string.isRequired,
|
overview: PropTypes.string.isRequired,
|
||||||
links: PropTypes.arrayOf(PropTypes.object).isRequired,
|
links: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
|
|
3
frontend/src/Artist/Details/ArtistGenres.css
Normal file
3
frontend/src/Artist/Details/ArtistGenres.css
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
.genres {
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
53
frontend/src/Artist/Details/ArtistGenres.js
Normal file
53
frontend/src/Artist/Details/ArtistGenres.js
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import React from 'react';
|
||||||
|
import Label from 'Components/Label';
|
||||||
|
import Tooltip from 'Components/Tooltip/Tooltip';
|
||||||
|
import { kinds, sizes, tooltipPositions } from 'Helpers/Props';
|
||||||
|
import styles from './ArtistGenres.css';
|
||||||
|
|
||||||
|
function ArtistGenres({ genres }) {
|
||||||
|
const [firstGenre, ...otherGenres] = genres;
|
||||||
|
|
||||||
|
if (otherGenres.length) {
|
||||||
|
return (
|
||||||
|
<Tooltip
|
||||||
|
anchor={
|
||||||
|
<span className={styles.genres}>
|
||||||
|
{firstGenre}
|
||||||
|
</span>
|
||||||
|
}
|
||||||
|
tooltip={
|
||||||
|
<div>
|
||||||
|
{
|
||||||
|
otherGenres.map((tag) => {
|
||||||
|
return (
|
||||||
|
<Label
|
||||||
|
key={tag}
|
||||||
|
kind={kinds.INFO}
|
||||||
|
size={sizes.LARGE}
|
||||||
|
>
|
||||||
|
{tag}
|
||||||
|
</Label>
|
||||||
|
);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
kind={kinds.INVERSE}
|
||||||
|
position={tooltipPositions.TOP}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<span className={styles.genres}>
|
||||||
|
{firstGenre}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
ArtistGenres.propTypes = {
|
||||||
|
genres: PropTypes.arrayOf(PropTypes.string).isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ArtistGenres;
|
|
@ -2,3 +2,7 @@
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
color: var(--themeRed);
|
color: var(--themeRed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.rating {
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import styles from './HeartRating.css';
|
||||||
|
|
||||||
function HeartRating({ rating, iconSize }) {
|
function HeartRating({ rating, iconSize }) {
|
||||||
return (
|
return (
|
||||||
<span>
|
<span className={styles.rating}>
|
||||||
<Icon
|
<Icon
|
||||||
className={styles.heart}
|
className={styles.heart}
|
||||||
name={icons.HEART}
|
name={icons.HEART}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue