From 9884f6f282560ff2a0ea193e9306c6284cf8672c Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 18 Jan 2024 21:43:51 -0800 Subject: [PATCH] Fixed: Icons on full color calendar events Closes #6331 --- .../src/Calendar/Events/CalendarEvent.css | 4 + frontend/src/Calendar/Events/CalendarEvent.js | 18 +++-- .../Calendar/Events/CalendarEventGroup.css | 9 +++ .../Events/CalendarEventGroup.css.d.ts | 1 + .../src/Calendar/Events/CalendarEventGroup.js | 78 ++++++++++--------- frontend/src/Calendar/Legend/Legend.js | 38 ++++++--- .../src/Calendar/Legend/LegendIconItem.css | 4 + .../src/Calendar/Legend/LegendIconItem.js | 15 ++-- frontend/src/Components/Icon.css | 8 -- frontend/src/Components/Icon.js | 6 +- frontend/src/Helpers/Props/icons.js | 6 ++ frontend/src/Styles/Themes/dark.js | 2 + frontend/src/Styles/Themes/light.js | 2 + frontend/src/typings/UiSettings.ts | 1 + 14 files changed, 118 insertions(+), 74 deletions(-) diff --git a/frontend/src/Calendar/Events/CalendarEvent.css b/frontend/src/Calendar/Events/CalendarEvent.css index 0cf3900bf..679b4cc51 100644 --- a/frontend/src/Calendar/Events/CalendarEvent.css +++ b/frontend/src/Calendar/Events/CalendarEvent.css @@ -52,6 +52,10 @@ $fullColorGradient: rgba(244, 245, 246, 0.2); .statusContainer { display: flex; align-items: center; + + &:global(.fullColor) { + filter: var(--calendarFullColorFilter) + } } .statusIcon { diff --git a/frontend/src/Calendar/Events/CalendarEvent.js b/frontend/src/Calendar/Events/CalendarEvent.js index 122022773..1f9d59b2b 100644 --- a/frontend/src/Calendar/Events/CalendarEvent.js +++ b/frontend/src/Calendar/Events/CalendarEvent.js @@ -102,7 +102,12 @@ class CalendarEvent extends Component { {series.title} -
+
{ missingAbsoluteNumber ? : null @@ -150,7 +156,7 @@ class CalendarEvent extends Component { : null @@ -160,9 +166,8 @@ class CalendarEvent extends Component { episodeNumber === 1 && seasonNumber > 0 ? : null @@ -173,8 +178,8 @@ class CalendarEvent extends Component { finaleType ? : null @@ -187,7 +192,6 @@ class CalendarEvent extends Component { className={styles.statusIcon} name={icons.INFO} kind={kinds.PINK} - darken={fullColorEvents} title={translate('Special')} /> : null diff --git a/frontend/src/Calendar/Events/CalendarEventGroup.css b/frontend/src/Calendar/Events/CalendarEventGroup.css index 68a12851d..c52e0192d 100644 --- a/frontend/src/Calendar/Events/CalendarEventGroup.css +++ b/frontend/src/Calendar/Events/CalendarEventGroup.css @@ -50,6 +50,15 @@ margin-bottom: 5px; } +.statusContainer { + display: flex; + align-items: center; + + &:global(.fullColor) { + filter: var(--calendarFullColorFilter) + } +} + .statusIcon { margin-left: 3px; } diff --git a/frontend/src/Calendar/Events/CalendarEventGroup.css.d.ts b/frontend/src/Calendar/Events/CalendarEventGroup.css.d.ts index 94f0d11ce..c527feff1 100644 --- a/frontend/src/Calendar/Events/CalendarEventGroup.css.d.ts +++ b/frontend/src/Calendar/Events/CalendarEventGroup.css.d.ts @@ -16,6 +16,7 @@ interface CssExports { 'onAir': string; 'premiere': string; 'seriesTitle': string; + 'statusContainer': string; 'statusIcon': string; 'unaired': string; 'unmonitored': string; diff --git a/frontend/src/Calendar/Events/CalendarEventGroup.js b/frontend/src/Calendar/Events/CalendarEventGroup.js index ea54c8237..2130c11f9 100644 --- a/frontend/src/Calendar/Events/CalendarEventGroup.js +++ b/frontend/src/Calendar/Events/CalendarEventGroup.js @@ -145,45 +145,51 @@ class CalendarEventGroup extends Component { {series.title}
- { - isMissingAbsoluteNumber && - - } +
+ { + isMissingAbsoluteNumber && + + } - { - anyDownloading && - - } + { + anyDownloading && + + } - { - firstEpisode.episodeNumber === 1 && seasonNumber > 0 && - - } + { + firstEpisode.episodeNumber === 1 && seasonNumber > 0 && + + } - { - showFinaleIcon && - lastEpisode.finaleType ? - : null - } + { + showFinaleIcon && + lastEpisode.finaleType ? + : null + } +
diff --git a/frontend/src/Calendar/Legend/Legend.js b/frontend/src/Calendar/Legend/Legend.js index 5fc84234f..f6e970e8b 100644 --- a/frontend/src/Calendar/Legend/Legend.js +++ b/frontend/src/Calendar/Legend/Legend.js @@ -22,9 +22,20 @@ function Legend(props) { if (showFinaleIcon) { iconsToShow.push( + ); + + iconsToShow.push( + ); @@ -33,10 +44,10 @@ function Legend(props) { if (showSpecialIcon) { iconsToShow.push( ); @@ -45,9 +56,10 @@ function Legend(props) { if (showCutoffUnmetIcon) { iconsToShow.push( ); @@ -112,10 +124,10 @@ function Legend(props) {
@@ -129,6 +141,12 @@ function Legend(props) { {iconsToShow[2]}
} + { + iconsToShow.length > 3 && +
+ {iconsToShow[3]} +
+ }
); } diff --git a/frontend/src/Calendar/Legend/LegendIconItem.css b/frontend/src/Calendar/Legend/LegendIconItem.css index 01db0ba5a..c6c12027d 100644 --- a/frontend/src/Calendar/Legend/LegendIconItem.css +++ b/frontend/src/Calendar/Legend/LegendIconItem.css @@ -7,4 +7,8 @@ .icon { margin-right: 5px; + + &:global(.fullColorEvents) { + filter: var(--calendarFullColorFilter) + } } diff --git a/frontend/src/Calendar/Legend/LegendIconItem.js b/frontend/src/Calendar/Legend/LegendIconItem.js index 5ce5f725b..b6bdeeff7 100644 --- a/frontend/src/Calendar/Legend/LegendIconItem.js +++ b/frontend/src/Calendar/Legend/LegendIconItem.js @@ -1,3 +1,4 @@ +import classNames from 'classnames'; import PropTypes from 'prop-types'; import React from 'react'; import Icon from 'Components/Icon'; @@ -6,9 +7,9 @@ import styles from './LegendIconItem.css'; function LegendIconItem(props) { const { name, + fullColorEvents, icon, kind, - darken, tooltip } = props; @@ -18,9 +19,11 @@ function LegendIconItem(props) { title={tooltip} > @@ -31,14 +34,10 @@ function LegendIconItem(props) { LegendIconItem.propTypes = { name: PropTypes.string.isRequired, + fullColorEvents: PropTypes.bool.isRequired, icon: PropTypes.object.isRequired, kind: PropTypes.string.isRequired, - darken: PropTypes.bool.isRequired, tooltip: PropTypes.string.isRequired }; -LegendIconItem.defaultProps = { - darken: false -}; - export default LegendIconItem; diff --git a/frontend/src/Components/Icon.css b/frontend/src/Components/Icon.css index 69ffc40f5..51c09226b 100644 --- a/frontend/src/Components/Icon.css +++ b/frontend/src/Components/Icon.css @@ -12,18 +12,10 @@ .info { color: var(--infoColor); - - &:global(.darken) { - color: color(var(--infoColor) shade(30%)); - } } .pink { color: var(--pink); - - &:global(.darken) { - color: color(var(--pink) shade(30%)); - } } .success { diff --git a/frontend/src/Components/Icon.js b/frontend/src/Components/Icon.js index 90842b039..d200b8c08 100644 --- a/frontend/src/Components/Icon.js +++ b/frontend/src/Components/Icon.js @@ -18,7 +18,6 @@ class Icon extends PureComponent { kind, size, title, - darken, isSpinning, ...otherProps } = this.props; @@ -27,8 +26,7 @@ class Icon extends PureComponent {