You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
2.3 KiB
110 lines
2.3 KiB
6 years ago
|
import PropTypes from 'prop-types';
|
||
|
import React from 'react';
|
||
|
import { icons, kinds } from 'Helpers/Props';
|
||
|
import LegendItem from './LegendItem';
|
||
|
import LegendIconItem from './LegendIconItem';
|
||
|
import styles from './Legend.css';
|
||
|
|
||
|
function Legend(props) {
|
||
|
const {
|
||
|
showFinaleIcon,
|
||
|
showSpecialIcon,
|
||
|
showCutoffUnmetIcon,
|
||
|
colorImpairedMode
|
||
|
} = props;
|
||
|
|
||
|
const iconsToShow = [];
|
||
|
if (showFinaleIcon) {
|
||
|
iconsToShow.push(
|
||
|
<LegendIconItem
|
||
|
name="Finale"
|
||
|
icon={icons.INFO}
|
||
|
kind={kinds.WARNING}
|
||
|
tooltip="Series or season finale"
|
||
|
/>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
if (showSpecialIcon) {
|
||
|
iconsToShow.push(
|
||
|
<LegendIconItem
|
||
|
name="Special"
|
||
|
icon={icons.INFO}
|
||
|
kind={kinds.PINK}
|
||
|
tooltip="Special episode"
|
||
|
/>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
if (showCutoffUnmetIcon) {
|
||
|
iconsToShow.push(
|
||
|
<LegendIconItem
|
||
|
name="Cutoff Not Met"
|
||
|
icon={icons.MOVIE_FILE}
|
||
|
kind={kinds.WARNING}
|
||
|
tooltip="Quality or language cutoff has not been met"
|
||
|
/>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
return (
|
||
|
<div className={styles.legend}>
|
||
|
<div>
|
||
|
<LegendItem
|
||
|
status="unaired"
|
||
|
tooltip="Episode hasn't aired yet"
|
||
|
colorImpairedMode={colorImpairedMode}
|
||
|
/>
|
||
|
|
||
|
<LegendItem
|
||
|
status="unmonitored"
|
||
|
tooltip="Episode is unmonitored"
|
||
|
colorImpairedMode={colorImpairedMode}
|
||
|
/>
|
||
|
</div>
|
||
|
|
||
|
<div>
|
||
|
<LegendItem
|
||
|
status="downloading"
|
||
|
tooltip="Episode is currently downloading"
|
||
|
colorImpairedMode={colorImpairedMode}
|
||
|
/>
|
||
|
|
||
|
<LegendItem
|
||
|
status="downloaded"
|
||
|
tooltip="Episode was downloaded and sorted"
|
||
|
colorImpairedMode={colorImpairedMode}
|
||
|
/>
|
||
|
</div>
|
||
|
|
||
|
<div>
|
||
|
<LegendIconItem
|
||
|
name="Premiere"
|
||
|
icon={icons.INFO}
|
||
|
kind={kinds.INFO}
|
||
|
tooltip="Series or season premiere"
|
||
|
/>
|
||
|
|
||
|
{iconsToShow[0]}
|
||
|
</div>
|
||
|
|
||
|
{
|
||
|
iconsToShow.length > 1 &&
|
||
|
<div>
|
||
|
{iconsToShow[1]}
|
||
|
{iconsToShow[2]}
|
||
|
</div>
|
||
|
}
|
||
|
</div>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
Legend.propTypes = {
|
||
|
showFinaleIcon: PropTypes.bool.isRequired,
|
||
|
showSpecialIcon: PropTypes.bool.isRequired,
|
||
|
showCutoffUnmetIcon: PropTypes.bool.isRequired,
|
||
|
colorImpairedMode: PropTypes.bool.isRequired
|
||
|
};
|
||
|
|
||
|
export default Legend;
|