From e604f03228fc1dc95cf12ad79764a5de9dd2853d Mon Sep 17 00:00:00 2001 From: Hashan Jay Date: Tue, 13 Oct 2020 14:02:31 +0530 Subject: [PATCH 1/4] Add marked text styles support --- src/CalendarDay.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/CalendarDay.js b/src/CalendarDay.js index fc46f71..dafb62e 100644 --- a/src/CalendarDay.js +++ b/src/CalendarDay.js @@ -348,6 +348,19 @@ class CalendarDay extends Component { ); } + //Marked Text Styles + getMarkedTextStyles() { + if (!this.props.markedDates || this.props.markedDates.length === 0) { + return null; + } + const marking = this.state.marking; + if(marking.textStyle){ + return marking.textStyle; + }else{ + return null; + } + } + render() { // Defaults for disabled state const { @@ -460,7 +473,7 @@ class CalendarDay extends Component { > {showDayName && ( {date.format("ddd").toUpperCase()} @@ -471,7 +484,8 @@ class CalendarDay extends Component { From a19ea47161912a2a026cdeffbb92f2165dc02619 Mon Sep 17 00:00:00 2001 From: Hashan Jay Date: Tue, 13 Oct 2020 15:19:47 +0530 Subject: [PATCH 2/4] replace dot with heart --- src/CalendarDay.js | 44 ++++++++++++++++++++++---------------------- src/img/heart.png | Bin 0 -> 387 bytes 2 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 src/img/heart.png diff --git a/src/CalendarDay.js b/src/CalendarDay.js index dafb62e..72d4244 100644 --- a/src/CalendarDay.js +++ b/src/CalendarDay.js @@ -6,7 +6,7 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; import moment from "moment"; -import { Text, View, Animated, Easing, LayoutAnimation, TouchableOpacity } from "react-native"; +import { Text, View, Animated, Easing, LayoutAnimation, TouchableOpacity, Image } from "react-native"; import styles from "./Calendar.style.js"; class CalendarDay extends Component { @@ -288,32 +288,32 @@ class CalendarDay extends Component { } renderDots(marking) { - const baseDotStyle = [styles.dot, styles.visibleDot]; - const markedDatesStyle = this.props.markedDatesStyle || {}; - const formattedDate = this.props.date.format('YYYY-MM-DD'); - let validDots = ; // default empty view for no dots case + // const baseDotStyle = [styles.dot, styles.visibleDot]; + // const markedDatesStyle = this.props.markedDatesStyle || {}; + // const formattedDate = this.props.date.format('YYYY-MM-DD'); + // let validDots = ; // default empty view for no dots case // Filter dots and process only those which have color property - validDots = marking.dots - .filter(d => (d && d.color)) - .map((dot, index) => { - const selectedColor = dot.selectedColor || dot.selectedDotColor; // selectedDotColor deprecated - const backgroundColor = this.state.selected && selectedColor ? selectedColor : dot.color; - return ( - - ); - }); + // validDots = marking.dots + // .filter(d => (d && d.color)) + // .map((dot, index) => { + // const selectedColor = dot.selectedColor || dot.selectedDotColor; // selectedDotColor deprecated + // const backgroundColor = this.state.selected && selectedColor ? selectedColor : dot.color; + // return ( + // + // ); + // }); return ( - {validDots} + ); } diff --git a/src/img/heart.png b/src/img/heart.png new file mode 100644 index 0000000000000000000000000000000000000000..f3f6e75e55e9963fe532655513dbf2e43511b619 GIT binary patch literal 387 zcmeAS@N?(olHy`uVBq!ia0vp^{2(?58;~rMGjRk`jKx9jP7LeL$-D$|EK(yp(|mmy zw18|52FCVG1{RPKAeI7R1_q`DOmGqY1bjyWYn@)*f_Z(U-bf`Xa}E2LHge9@16)1-KjaVulDo3l(Z0m zb>iknZ$(^j{iDn$lw#Z;WX)>N#CP;%pj_I@-ydh1UMSRvEMVpF+;fKSXq<+jQ`i;e>ANO0>Vr4d6`obck>GeIey7dhxFg#uT KT-G@yGywoORfi@3 literal 0 HcmV?d00001 From 51714b00b5fc13889488a0ee1dcffc92504a9e0d Mon Sep 17 00:00:00 2001 From: Hashan Jay Date: Tue, 13 Oct 2020 15:42:38 +0530 Subject: [PATCH 3/4] styles update for heart image --- src/Calendar.style.js | 5 +++-- src/CalendarDay.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Calendar.style.js b/src/Calendar.style.js index d6dc1bd..cea61f3 100644 --- a/src/Calendar.style.js +++ b/src/Calendar.style.js @@ -63,7 +63,7 @@ export default StyleSheet.create({ dot: { width: 6, height: 6, - marginTop: 1, + marginTop: 0, borderRadius: 5, opacity: 0 }, @@ -71,7 +71,8 @@ export default StyleSheet.create({ // CALENDAR DOTS dotsContainer: { flexDirection: 'row', - justifyContent: 'center' + justifyContent: 'center', + height: 10 }, visibleDot: { opacity: 1, diff --git a/src/CalendarDay.js b/src/CalendarDay.js index 72d4244..b4f4970 100644 --- a/src/CalendarDay.js +++ b/src/CalendarDay.js @@ -313,7 +313,7 @@ class CalendarDay extends Component { return ( - + ); } From d5ef03f20a24ca245dfea83617a5a839916bdfb0 Mon Sep 17 00:00:00 2001 From: Hashan Jayakody Date: Wed, 11 Nov 2020 14:50:52 +0530 Subject: [PATCH 4/4] Update CalendarDay.js Remove heart svg display --- src/CalendarDay.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/CalendarDay.js b/src/CalendarDay.js index b4f4970..a0e213a 100644 --- a/src/CalendarDay.js +++ b/src/CalendarDay.js @@ -312,9 +312,10 @@ class CalendarDay extends Component { // }); return ( - - - + null +// +// +// ); }