From 6b81df7296ab14e0a27d07f8aa6f0995c01919e0 Mon Sep 17 00:00:00 2001 From: Jeffrey Drakos Date: Wed, 18 Nov 2020 13:14:48 -0800 Subject: [PATCH] updating selected day style --- src/CalendarDay.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/CalendarDay.js b/src/CalendarDay.js index e0973c3..a22a0ff 100644 --- a/src/CalendarDay.js +++ b/src/CalendarDay.js @@ -211,11 +211,24 @@ class CalendarDay extends Component { ]; } if (this.state.selected) { - dateNameStyle = [styles.dateName, this.props.highlightDateNameStyle]; - dateNumberStyle = [ - styles.dateNumber, - this.props.highlightDateNumberStyle - ]; + // This is a very poorly coded fix. But need to update this calendar soon. So keeping it verbose and clear + if (this.props.highlightDateNameStyle) { + dateNameStyle = [styles.dateName, this.props.highlightDateNameStyle]; + } else { + dateNameStyle = [styles.dateName]; + } + + if (this.props.highlightDateNumberStyle) { + dateNumberStyle = [ + styles.dateNumber, + ...this.props.highlightDateNumberStyle + ]; + } else { + dateNumberStyle = [ + styles.dateNumber + ]; + } + } }