parent
3b00112447
commit
5d1d44e09e
@ -1,3 +0,0 @@
|
|||||||
.genres {
|
|
||||||
margin-right: 15px;
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
// This file is automatically generated.
|
|
||||||
// Please do not change this file!
|
|
||||||
interface CssExports {
|
|
||||||
'genres': string;
|
|
||||||
}
|
|
||||||
export const cssExports: CssExports;
|
|
||||||
export default cssExports;
|
|
@ -1,53 +0,0 @@
|
|||||||
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 './SeriesGenres.css';
|
|
||||||
|
|
||||||
function SeriesGenres({ 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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
SeriesGenres.propTypes = {
|
|
||||||
genres: PropTypes.arrayOf(PropTypes.string).isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default SeriesGenres;
|
|
@ -0,0 +1,38 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import Label from 'Components/Label';
|
||||||
|
import Tooltip from 'Components/Tooltip/Tooltip';
|
||||||
|
import { kinds, sizes, tooltipPositions } from 'Helpers/Props';
|
||||||
|
|
||||||
|
interface SeriesGenresProps {
|
||||||
|
className?: string;
|
||||||
|
genres: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
function SeriesGenres({ className, genres }: SeriesGenresProps) {
|
||||||
|
const [firstGenre, ...otherGenres] = genres;
|
||||||
|
|
||||||
|
if (otherGenres.length) {
|
||||||
|
return (
|
||||||
|
<Tooltip
|
||||||
|
anchor={<span className={className}>{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={className}>{firstGenre}</span>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SeriesGenres;
|
Loading…
Reference in new issue