mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-26 22:56:23 -04:00
v3 UI
This commit is contained in:
committed by
Taloth Saldono
parent
99feff549d
commit
5894b4fd95
@@ -0,0 +1,14 @@
|
||||
.progress {
|
||||
composes: container from 'Components/ProgressBar.css';
|
||||
|
||||
border-radius: 0;
|
||||
background-color: #5b5b5b;
|
||||
color: $white;
|
||||
transition: width 200ms ease;
|
||||
}
|
||||
|
||||
.progressBar {
|
||||
composes: progressBar from 'Components/ProgressBar.css';
|
||||
|
||||
transition: width 200ms ease;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import getProgressBarKind from 'Utilities/Series/getProgressBarKind';
|
||||
import { sizes } from 'Helpers/Props';
|
||||
import ProgressBar from 'Components/ProgressBar';
|
||||
import styles from './SeriesIndexProgressBar.css';
|
||||
|
||||
function SeriesIndexProgressBar(props) {
|
||||
const {
|
||||
monitored,
|
||||
status,
|
||||
episodeCount,
|
||||
episodeFileCount,
|
||||
totalEpisodeCount,
|
||||
posterWidth,
|
||||
detailedProgressBar
|
||||
} = props;
|
||||
|
||||
const progress = episodeCount ? episodeFileCount / episodeCount * 100 : 100;
|
||||
const text = `${episodeFileCount} / ${episodeCount}`;
|
||||
|
||||
return (
|
||||
<ProgressBar
|
||||
className={styles.progressBar}
|
||||
containerClassName={styles.progress}
|
||||
progress={progress}
|
||||
kind={getProgressBarKind(status, monitored, progress)}
|
||||
size={detailedProgressBar ? sizes.MEDIUM : sizes.SMALL}
|
||||
showText={detailedProgressBar}
|
||||
text={text}
|
||||
title={`${episodeFileCount} / ${episodeCount} (Total: ${totalEpisodeCount})`}
|
||||
width={posterWidth}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
SeriesIndexProgressBar.propTypes = {
|
||||
monitored: PropTypes.bool.isRequired,
|
||||
status: PropTypes.string.isRequired,
|
||||
episodeCount: PropTypes.number.isRequired,
|
||||
episodeFileCount: PropTypes.number.isRequired,
|
||||
totalEpisodeCount: PropTypes.number.isRequired,
|
||||
posterWidth: PropTypes.number.isRequired,
|
||||
detailedProgressBar: PropTypes.bool.isRequired
|
||||
};
|
||||
|
||||
export default SeriesIndexProgressBar;
|
||||
Reference in New Issue
Block a user