Fixed: Icons on full color calendar events

Closes #6331
This commit is contained in:
Mark McDowall 2024-01-18 21:43:51 -08:00 committed by GitHub
parent e792db4d33
commit 9884f6f282
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 118 additions and 74 deletions

View File

@ -52,6 +52,10 @@ $fullColorGradient: rgba(244, 245, 246, 0.2);
.statusContainer { .statusContainer {
display: flex; display: flex;
align-items: center; align-items: center;
&:global(.fullColor) {
filter: var(--calendarFullColorFilter)
}
} }
.statusIcon { .statusIcon {

View File

@ -102,7 +102,12 @@ class CalendarEvent extends Component {
{series.title} {series.title}
</div> </div>
<div className={styles.statusContainer}> <div
className={classNames(
styles.statusContainer,
fullColorEvents && 'fullColor'
)}
>
{ {
missingAbsoluteNumber ? missingAbsoluteNumber ?
<Icon <Icon
@ -128,6 +133,7 @@ class CalendarEvent extends Component {
<span className={styles.statusIcon}> <span className={styles.statusIcon}>
<CalendarEventQueueDetails <CalendarEventQueueDetails
{...queueItem} {...queueItem}
fullColorEvents={fullColorEvents}
/> />
</span> : </span> :
null null
@ -150,7 +156,7 @@ class CalendarEvent extends Component {
<Icon <Icon
className={styles.statusIcon} className={styles.statusIcon}
name={icons.EPISODE_FILE} name={icons.EPISODE_FILE}
kind={fullColorEvents ? kinds.DEFAULT : kinds.WARNING} kind={kinds.WARNING}
title={translate('QualityCutoffNotMet')} title={translate('QualityCutoffNotMet')}
/> : /> :
null null
@ -160,9 +166,8 @@ class CalendarEvent extends Component {
episodeNumber === 1 && seasonNumber > 0 ? episodeNumber === 1 && seasonNumber > 0 ?
<Icon <Icon
className={styles.statusIcon} className={styles.statusIcon}
name={icons.INFO} name={icons.PREMIERE}
kind={kinds.INFO} kind={kinds.INFO}
darken={fullColorEvents}
title={seasonNumber === 1 ? translate('SeriesPremiere') : translate('SeasonPremiere')} title={seasonNumber === 1 ? translate('SeriesPremiere') : translate('SeasonPremiere')}
/> : /> :
null null
@ -173,8 +178,8 @@ class CalendarEvent extends Component {
finaleType ? finaleType ?
<Icon <Icon
className={styles.statusIcon} className={styles.statusIcon}
name={icons.INFO} name={finaleType === 'series' ? icons.FINALE_SERIES : icons.FINALE_SEASON}
kind={fullColorEvents ? kinds.DEFAULT : kinds.WARNING} kind={finaleType === 'series' ? kinds.DANGER : kinds.WARNING}
title={getFinaleTypeName(finaleType)} title={getFinaleTypeName(finaleType)}
/> : /> :
null null
@ -187,7 +192,6 @@ class CalendarEvent extends Component {
className={styles.statusIcon} className={styles.statusIcon}
name={icons.INFO} name={icons.INFO}
kind={kinds.PINK} kind={kinds.PINK}
darken={fullColorEvents}
title={translate('Special')} title={translate('Special')}
/> : /> :
null null

View File

@ -50,6 +50,15 @@
margin-bottom: 5px; margin-bottom: 5px;
} }
.statusContainer {
display: flex;
align-items: center;
&:global(.fullColor) {
filter: var(--calendarFullColorFilter)
}
}
.statusIcon { .statusIcon {
margin-left: 3px; margin-left: 3px;
} }

View File

@ -16,6 +16,7 @@ interface CssExports {
'onAir': string; 'onAir': string;
'premiere': string; 'premiere': string;
'seriesTitle': string; 'seriesTitle': string;
'statusContainer': string;
'statusIcon': string; 'statusIcon': string;
'unaired': string; 'unaired': string;
'unmonitored': string; 'unmonitored': string;

View File

@ -145,45 +145,51 @@ class CalendarEventGroup extends Component {
{series.title} {series.title}
</div> </div>
{ <div
isMissingAbsoluteNumber && className={classNames(
<Icon styles.statusContainer,
containerClassName={styles.statusIcon} fullColorEvents && 'fullColor'
name={icons.WARNING} )}
title={translate('EpisodeMissingAbsoluteNumber')} >
/> {
} isMissingAbsoluteNumber &&
<Icon
containerClassName={styles.statusIcon}
name={icons.WARNING}
title={translate('EpisodeMissingAbsoluteNumber')}
/>
}
{ {
anyDownloading && anyDownloading &&
<Icon <Icon
containerClassName={styles.statusIcon} containerClassName={styles.statusIcon}
name={icons.DOWNLOADING} name={icons.DOWNLOADING}
title={translate('AnEpisodeIsDownloading')} title={translate('AnEpisodeIsDownloading')}
/> />
} }
{ {
firstEpisode.episodeNumber === 1 && seasonNumber > 0 && firstEpisode.episodeNumber === 1 && seasonNumber > 0 &&
<Icon <Icon
containerClassName={styles.statusIcon} containerClassName={styles.statusIcon}
name={icons.INFO} name={icons.PREMIERE}
kind={kinds.INFO} kind={kinds.INFO}
darken={fullColorEvents} title={seasonNumber === 1 ? translate('SeriesPremiere') : translate('SeasonPremiere')}
title={seasonNumber === 1 ? translate('SeriesPremiere') : translate('SeasonPremiere')} />
/> }
}
{ {
showFinaleIcon && showFinaleIcon &&
lastEpisode.finaleType ? lastEpisode.finaleType ?
<Icon <Icon
containerClassName={styles.statusIcon} containerClassName={styles.statusIcon}
name={icons.INFO} name={lastEpisode.finaleType === 'series' ? icons.FINALE_SERIES : icons.FINALE_SEASON}
kind={fullColorEvents ? kinds.DEFAULT : kinds.WARNING} kind={lastEpisode.finaleType === 'series' ? kinds.DANGER : kinds.WARNING}
title={getFinaleTypeName(lastEpisode.finaleType)} title={getFinaleTypeName(lastEpisode.finaleType)}
/> : null /> : null
} }
</div>
</div> </div>
<div className={styles.airingInfo}> <div className={styles.airingInfo}>

View File

@ -22,9 +22,20 @@ function Legend(props) {
if (showFinaleIcon) { if (showFinaleIcon) {
iconsToShow.push( iconsToShow.push(
<LegendIconItem <LegendIconItem
name="Finale" name={translate('SeasonFinale')}
icon={icons.INFO} icon={icons.FINALE_SEASON}
kind={fullColorEvents ? kinds.DEFAULT : kinds.WARNING} kind={kinds.WARNING}
fullColorEvents={fullColorEvents}
tooltip={translate('CalendarLegendSeriesFinaleTooltip')}
/>
);
iconsToShow.push(
<LegendIconItem
name={translate('SeriesFinale')}
icon={icons.FINALE_SERIES}
kind={kinds.DANGER}
fullColorEvents={fullColorEvents}
tooltip={translate('CalendarLegendSeriesFinaleTooltip')} tooltip={translate('CalendarLegendSeriesFinaleTooltip')}
/> />
); );
@ -33,10 +44,10 @@ function Legend(props) {
if (showSpecialIcon) { if (showSpecialIcon) {
iconsToShow.push( iconsToShow.push(
<LegendIconItem <LegendIconItem
name="Special" name={translate('Special')}
icon={icons.INFO} icon={icons.INFO}
kind={kinds.PINK} kind={kinds.PINK}
darken={fullColorEvents} fullColorEvents={fullColorEvents}
tooltip={translate('SpecialEpisode')} tooltip={translate('SpecialEpisode')}
/> />
); );
@ -45,9 +56,10 @@ function Legend(props) {
if (showCutoffUnmetIcon) { if (showCutoffUnmetIcon) {
iconsToShow.push( iconsToShow.push(
<LegendIconItem <LegendIconItem
name="Cutoff Not Met" name={translate('Cutoff Not Met')}
icon={icons.EPISODE_FILE} icon={icons.EPISODE_FILE}
kind={fullColorEvents ? kinds.DEFAULT : kinds.WARNING} kind={kinds.WARNING}
fullColorEvents={fullColorEvents}
tooltip={translate('QualityCutoffNotMet')} tooltip={translate('QualityCutoffNotMet')}
/> />
); );
@ -112,10 +124,10 @@ function Legend(props) {
<div> <div>
<LegendIconItem <LegendIconItem
name="Premiere" name={translate('Premiere')}
icon={icons.INFO} icon={icons.PREMIERE}
kind={kinds.INFO} kind={kinds.INFO}
darken={true} fullColorEvents={fullColorEvents}
tooltip={translate('CalendarLegendSeriesPremiereTooltip')} tooltip={translate('CalendarLegendSeriesPremiereTooltip')}
/> />
@ -129,6 +141,12 @@ function Legend(props) {
{iconsToShow[2]} {iconsToShow[2]}
</div> </div>
} }
{
iconsToShow.length > 3 &&
<div>
{iconsToShow[3]}
</div>
}
</div> </div>
); );
} }

View File

@ -7,4 +7,8 @@
.icon { .icon {
margin-right: 5px; margin-right: 5px;
&:global(.fullColorEvents) {
filter: var(--calendarFullColorFilter)
}
} }

View File

@ -1,3 +1,4 @@
import classNames from 'classnames';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import Icon from 'Components/Icon'; import Icon from 'Components/Icon';
@ -6,9 +7,9 @@ import styles from './LegendIconItem.css';
function LegendIconItem(props) { function LegendIconItem(props) {
const { const {
name, name,
fullColorEvents,
icon, icon,
kind, kind,
darken,
tooltip tooltip
} = props; } = props;
@ -18,9 +19,11 @@ function LegendIconItem(props) {
title={tooltip} title={tooltip}
> >
<Icon <Icon
className={styles.icon} className={classNames(
styles.icon,
fullColorEvents && 'fullColorEvents'
)}
name={icon} name={icon}
darken={darken}
kind={kind} kind={kind}
/> />
@ -31,14 +34,10 @@ function LegendIconItem(props) {
LegendIconItem.propTypes = { LegendIconItem.propTypes = {
name: PropTypes.string.isRequired, name: PropTypes.string.isRequired,
fullColorEvents: PropTypes.bool.isRequired,
icon: PropTypes.object.isRequired, icon: PropTypes.object.isRequired,
kind: PropTypes.string.isRequired, kind: PropTypes.string.isRequired,
darken: PropTypes.bool.isRequired,
tooltip: PropTypes.string.isRequired tooltip: PropTypes.string.isRequired
}; };
LegendIconItem.defaultProps = {
darken: false
};
export default LegendIconItem; export default LegendIconItem;

View File

@ -12,18 +12,10 @@
.info { .info {
color: var(--infoColor); color: var(--infoColor);
&:global(.darken) {
color: color(var(--infoColor) shade(30%));
}
} }
.pink { .pink {
color: var(--pink); color: var(--pink);
&:global(.darken) {
color: color(var(--pink) shade(30%));
}
} }
.success { .success {

View File

@ -18,7 +18,6 @@ class Icon extends PureComponent {
kind, kind,
size, size,
title, title,
darken,
isSpinning, isSpinning,
...otherProps ...otherProps
} = this.props; } = this.props;
@ -27,8 +26,7 @@ class Icon extends PureComponent {
<FontAwesomeIcon <FontAwesomeIcon
className={classNames( className={classNames(
className, className,
styles[kind], styles[kind]
darken && 'darken'
)} )}
icon={name} icon={name}
spin={isSpinning} spin={isSpinning}
@ -61,7 +59,6 @@ Icon.propTypes = {
kind: PropTypes.string.isRequired, kind: PropTypes.string.isRequired,
size: PropTypes.number.isRequired, size: PropTypes.number.isRequired,
title: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), title: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
darken: PropTypes.bool.isRequired,
isSpinning: PropTypes.bool.isRequired, isSpinning: PropTypes.bool.isRequired,
fixedWidth: PropTypes.bool.isRequired fixedWidth: PropTypes.bool.isRequired
}; };
@ -69,7 +66,6 @@ Icon.propTypes = {
Icon.defaultProps = { Icon.defaultProps = {
kind: kinds.DEFAULT, kind: kinds.DEFAULT,
size: 14, size: 14,
darken: false,
isSpinning: false, isSpinning: false,
fixedWidth: false fixedWidth: false
}; };

View File

@ -41,6 +41,9 @@ import {
faChevronCircleUp as fasChevronCircleUp, faChevronCircleUp as fasChevronCircleUp,
faCircle as fasCircle, faCircle as fasCircle,
faCircleDown as fasCircleDown, faCircleDown as fasCircleDown,
faCirclePause as fasCirclePause,
faCirclePlay as fasCirclePlay,
faCircleStop as fasCircleStop,
faCloud as fasCloud, faCloud as fasCloud,
faCloudDownloadAlt as fasCloudDownloadAlt, faCloudDownloadAlt as fasCloudDownloadAlt,
faCog as fasCog, faCog as fasCog,
@ -149,6 +152,8 @@ export const FATAL = fasTimesCircle;
export const FILE = farFile; export const FILE = farFile;
export const FILE_MISSING = fasFileCircleQuestion; export const FILE_MISSING = fasFileCircleQuestion;
export const FILTER = fasFilter; export const FILTER = fasFilter;
export const FINALE_SEASON = fasCirclePause;
export const FINALE_SERIES = fasCircleStop;
export const FOOTNOTE = fasAsterisk; export const FOOTNOTE = fasAsterisk;
export const FOLDER = farFolder; export const FOLDER = farFolder;
export const FOLDER_OPEN = fasFolderOpen; export const FOLDER_OPEN = fasFolderOpen;
@ -180,6 +185,7 @@ export const PARENT = fasLevelUpAlt;
export const PARSE = fasCalculator; export const PARSE = fasCalculator;
export const PAUSED = fasPause; export const PAUSED = fasPause;
export const PENDING = farClock; export const PENDING = farClock;
export const PREMIERE = fasCirclePlay;
export const PROFILE = fasUser; export const PROFILE = fasUser;
export const POSTER = fasTh; export const POSTER = fasTh;
export const QUEUED = fasCloud; export const QUEUED = fasCloud;

View File

@ -213,6 +213,8 @@ module.exports = {
calendarTextDim: '#eee', calendarTextDim: '#eee',
calendarTextDimAlternate: '#fff', calendarTextDimAlternate: '#fff',
calendarFullColorFilter: 'grayscale(90%) contrast(200%) saturate(50%)',
// //
// Table // Table

View File

@ -215,6 +215,8 @@ module.exports = {
calendarTextDim: '#666', calendarTextDim: '#666',
calendarTextDimAlternate: '#242424', calendarTextDimAlternate: '#242424',
calendarFullColorFilter: 'brightness(30%)',
// //
// Table // Table

View File

@ -1,4 +1,5 @@
export interface UiSettings { export interface UiSettings {
theme: string;
showRelativeDates: boolean; showRelativeDates: boolean;
shortDateFormat: string; shortDateFormat: string;
longDateFormat: string; longDateFormat: string;