From 1db686d3e6f3a5cd1d1fd214c9f9343369678b3d Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Mon, 8 Mar 2021 16:19:11 -0700 Subject: [PATCH 01/21] calendAR --- client/components/CalendAr.tsx | 136 ++++++++++++++++++++++++++++ client/components/Navigator.tsx | 4 +- client/components/screens/index.tsx | 3 +- 3 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 client/components/CalendAr.tsx diff --git a/client/components/CalendAr.tsx b/client/components/CalendAr.tsx new file mode 100644 index 0000000..cad6a1f --- /dev/null +++ b/client/components/CalendAr.tsx @@ -0,0 +1,136 @@ +import React from "react"; +import { View, Text } from "react-native"; + +import { Colours, Styles } from "../styles"; + +// DEFINE VARIABLES +// Colours ranging from light yellow --> dark yellow +const yellow = ["#FFFFB7", "#FFF192", "#FFEA61", "#FFDD3C", "#FFD400"]; +// Calendar initiation +const months = [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", +]; +const weekDays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; +const nDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + +// Define these big boi types +type CalendarState = { + months: string + weekDays: string + ndays: number + activeDate: Date + year: Date + month: Date + firstDay: Date + maxDays: Date +} + +// Time for a big boi class +class CalendAr extends React.Component<{}, CalendarState> { + state={ + activeDate:new Date() + } + + generateMatrix() { + var matrix = [] + matrix[0] = this.weekDays; + } + + // Initiate all calendar variables + var year = this.state.activeDate.getFullYear(); + var month = this.state.activeDate.getMonth(); + var firstDay = new Date(year, month, 1).getDay(); + var maxDays = this.nDays[month]; + if (month == 1) { + if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) { + maxDays += 1; + } + } + + var i = 1; + for(var row = 1; row < 7; row ++) { + matrix[row] = []; + for (var col = 0; col < 7; col++) { + matrix[row][col] = -1; + if (row == 1 && col >= firstDay) { + matrix[row][col] = i++; + } else if (row > 1 && i <= maxDays) { + matrix[row][col] = i++; + } + } + } + + render() { + var matrix = this.generateMatrix(); + return ( + + CalendAr + + ); + } +} + +export default class App extends React.Component { + render() { + return ; + } +} + +const styles = StyleSheet.create({ + calendarBox: { + marginTop: Platform.OS == "ios" ? "5%" : "10%", + // marginHorizontal: Platform.isPad == true ? "5%" : null, + flex: 2, + }, + divider: { + borderColor: Colours.yellow, + }, + infoBox: { + flex: 1, + marginHorizontal: "10%", + marginVertical: "3%", + borderWidth: 1, + borderRadius: 20, + borderColor: Colours.yellow, + alignItems: "center", + }, + infoHeaderBox: { + backgroundColor: Colours.yellow, + width: "100%", + padding: "5%", + borderTopEndRadius: 20, + borderTopStartRadius: 20, + }, + infoTextBox: { + flex: 1, + marginVertical: "5%", + }, + infoHeaderText: { + color: Colours.medBlue, + textAlign: "center", + fontSize: 20, + }, + infoText: { + color: Colours.yellow, + }, + text: { + color: Colours.yellow, + fontSize: 18, + }, + today: { + fontSize: 20, + color: Colours.yellow, + fontWeight: "bold", + }, +}); diff --git a/client/components/Navigator.tsx b/client/components/Navigator.tsx index a2265ce..86f334d 100644 --- a/client/components/Navigator.tsx +++ b/client/components/Navigator.tsx @@ -39,6 +39,7 @@ import { Home, Friends, Calender, + CalendAr, AddFriends, User, LogWater, @@ -48,7 +49,8 @@ import { } from "./screens"; const screens = [ - // Uncomment this when making reminder function + // Uncomment this when making functions + { name: "CalendAr", component: CalendAr, disable: true }, // { name: "Reminder", component: Reminder, disable: false }, { name: "Start", component: Start, disable: true }, { name: "SignIn", component: SignIn, disable: false }, diff --git a/client/components/screens/index.tsx b/client/components/screens/index.tsx index 8206833..73cd904 100644 --- a/client/components/screens/index.tsx +++ b/client/components/screens/index.tsx @@ -1,7 +1,8 @@ -export { default as Calender } from "./CalenderScreen"; export { default as Home } from "./HomeScreen"; export { default as SignIn } from "./SignInScreen"; export { default as User } from "./UserScreen"; +export { default as Calender } from "./CalenderScreen"; +export { default as CalendAr } from "../CalendAr"; export { default as Reminder } from "./register/ReminderScreen"; export { default as Register } from "./register/RegisterScreen"; From 5effe07e9c5bae45f8c9946b9945145152b2ee8b Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Tue, 9 Mar 2021 00:36:06 -0700 Subject: [PATCH 02/21] imported the calendAr library --- client/components/CalendAr.tsx | 134 ++++++++++++--------------------- client/package.json | 2 +- client/yarn.lock | 8 +- package.json | 5 ++ yarn.lock | 44 +++++++++++ 5 files changed, 104 insertions(+), 89 deletions(-) create mode 100644 package.json diff --git a/client/components/CalendAr.tsx b/client/components/CalendAr.tsx index cad6a1f..4290142 100644 --- a/client/components/CalendAr.tsx +++ b/client/components/CalendAr.tsx @@ -1,92 +1,58 @@ import React from "react"; -import { View, Text } from "react-native"; +import { View, Text, StyleSheet, Platform } from "react-native"; +import { Calendar, CalendarList, Agenda } from "react-native-calendars"; import { Colours, Styles } from "../styles"; -// DEFINE VARIABLES -// Colours ranging from light yellow --> dark yellow -const yellow = ["#FFFFB7", "#FFF192", "#FFEA61", "#FFDD3C", "#FFD400"]; -// Calendar initiation -const months = [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December", -]; -const weekDays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; -const nDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - -// Define these big boi types -type CalendarState = { - months: string - weekDays: string - ndays: number - activeDate: Date - year: Date - month: Date - firstDay: Date - maxDays: Date -} - -// Time for a big boi class -class CalendAr extends React.Component<{}, CalendarState> { - state={ - activeDate:new Date() - } - - generateMatrix() { - var matrix = [] - matrix[0] = this.weekDays; - } - - // Initiate all calendar variables - var year = this.state.activeDate.getFullYear(); - var month = this.state.activeDate.getMonth(); - var firstDay = new Date(year, month, 1).getDay(); - var maxDays = this.nDays[month]; - if (month == 1) { - if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) { - maxDays += 1; - } - } - - var i = 1; - for(var row = 1; row < 7; row ++) { - matrix[row] = []; - for (var col = 0; col < 7; col++) { - matrix[row][col] = -1; - if (row == 1 && col >= firstDay) { - matrix[row][col] = i++; - } else if (row > 1 && i <= maxDays) { - matrix[row][col] = i++; - } - } - } - - render() { - var matrix = this.generateMatrix(); - return ( - - CalendAr - - ); - } +export default function CalendAr() { + return ( + { + console.log("selected day", day); + }} + // Handler which gets executed on day long press. Default = undefined + onDayLongPress={(day) => { + console.log("selected day", day); + }} + // Month format in calendar title. Formatting values: http://arshaw.com/xdate/#Formatting + monthFormat={"yyyy MM"} + // Handler which gets executed when visible month changes in calendar. Default = undefined + onMonthChange={(month) => { + console.log("month changed", month); + }} + // Hide month navigation arrows. Default = false + hideArrows={true} + // Replace default arrows with custom ones (direction can be 'left' or 'right') + hideExtraDays={true} + // If hideArrows=false and hideExtraDays=false do not switch month when tapping on greyed out + // day from another month that is visible in calendar page. Default = false + disableMonthChange={true} + // If firstDay=1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday. + firstDay={1} + // Hide day names. Default = false + hideDayNames={true} + // Show week numbers to the left. Default = false + showWeekNumbers={true} + // Handler which gets executed when press arrow icon left. It receive a callback can go back month + onPressArrowLeft={(subtractMonth) => subtractMonth()} + // Handler which gets executed when press arrow icon right. It receive a callback can go next month + onPressArrowRight={(addMonth) => addMonth()} + // Disable left arrow. Default = false + disableArrowLeft={true} + // Disable right arrow. Default = false + disableArrowRight={true} + // Enable the option to swipe between months. Default = false + enableSwipeMonths={true} + /> + ); } - -export default class App extends React.Component { - render() { - return ; - } -} - const styles = StyleSheet.create({ calendarBox: { marginTop: Platform.OS == "ios" ? "5%" : "10%", diff --git a/client/package.json b/client/package.json index b945d8c..ab00897 100644 --- a/client/package.json +++ b/client/package.json @@ -24,7 +24,7 @@ "react-dom": "16.13.1", "react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz", "react-native-calendar-picker": "^7.0.9", - "react-native-calendars": "^1.1247.0", + "react-native-calendars": "^1.1254.0", "react-native-elements": "^3.2.0", "react-native-gesture-handler": "~1.8.0", "react-native-progress-circle": "^2.1.0", diff --git a/client/yarn.lock b/client/yarn.lock index 695be76..f04ad86 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -5875,10 +5875,10 @@ react-native-calendar-picker@^7.0.9: prop-types "^15.6.0" recyclerlistview "^3.0.0" -react-native-calendars@^1.1247.0: - version "1.1249.0" - resolved "https://registry.yarnpkg.com/react-native-calendars/-/react-native-calendars-1.1249.0.tgz#e94deb0e77186b4fc15b11d18a7eeece452d331b" - integrity sha512-DJqF8OJ4C4btkltJOzGS27FdWBVczkQmBHRYVaKuy3qUvoZ6/l/pdSQuTPNJHN/WCCCy9Uc+bXPsws2BAHh6Kg== +react-native-calendars@^1.1254.0: + version "1.1254.0" + resolved "https://registry.yarnpkg.com/react-native-calendars/-/react-native-calendars-1.1254.0.tgz#49dfb880c6588188a49ba15ecfb56cace2d3b3fe" + integrity sha512-6nnrOdpgyJrnu5BpUq+jfKFtLvBEy+csgmQQJ5XQvvIoeoI110TwPfDlQ2U6dUF9wjcge3Sg0UcnimlFXNj8Zg== dependencies: hoist-non-react-statics "^3.3.1" immutable "^4.0.0-rc.12" diff --git a/package.json b/package.json new file mode 100644 index 0000000..87d7791 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@types/react-native-calendars": "^1.505.0" + } +} diff --git a/yarn.lock b/yarn.lock index fb57ccd..d96c037 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,3 +2,47 @@ # yarn lockfile v1 +"@types/prop-types@*": + version "15.7.3" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" + integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== + +"@types/react-native-calendars@^1.505.0": + version "1.505.0" + resolved "https://registry.yarnpkg.com/@types/react-native-calendars/-/react-native-calendars-1.505.0.tgz#ee60af5cd131a6b6423eec75fa069949778b21f4" + integrity sha512-2Th/n4AG000Yas9IgfOAyobrrvL4lrXcHEMrNwMd9toe+Q4oiPe1wrhh3T6uqQ+n+771Kuq9/sQv3NLBcZUOxg== + dependencies: + "@types/react" "*" + "@types/react-native" "*" + "@types/xdate" "*" + +"@types/react-native@*": + version "0.63.51" + resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.63.51.tgz#2fc45ab934801770cdbbcdc6ae5cd85c0e2a2a02" + integrity sha512-lpJdBF7T/nZigbequu7p4NptZmTUKq8R7vRADkk00H8DR5igspL10B1F58MvNTu8o/TyqzPISyWoRARqaIy+mw== + dependencies: + "@types/react" "*" + +"@types/react@*": + version "17.0.3" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.3.tgz#ba6e215368501ac3826951eef2904574c262cc79" + integrity sha512-wYOUxIgs2HZZ0ACNiIayItyluADNbONl7kt8lkLjVK8IitMH5QMyAh75Fwhmo37r1m7L2JaFj03sIfxBVDvRAg== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + +"@types/scheduler@*": + version "0.16.1" + resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" + integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA== + +"@types/xdate@*": + version "0.8.31" + resolved "https://registry.yarnpkg.com/@types/xdate/-/xdate-0.8.31.tgz#7bec14a47c9bb30715d507f32bc82ab163149574" + integrity sha512-iZYRKKK8UZXoepNh2kwK6TPITMj/dwdv0NzNi9DFMt2foGkU7h+ncaCpGsdD2fp/CXMs9dxPAzV9uddFy7c4QA== + +csstype@^3.0.2: + version "3.0.7" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.7.tgz#2a5fb75e1015e84dd15692f71e89a1450290950b" + integrity sha512-KxnUB0ZMlnUWCsx2Z8MUsr6qV6ja1w9ArPErJaJaF8a5SOWoHLIszeCTKGRGRgtLgYrs1E8CHkNSP1VZTTPc9g== From dc521025dbb8b8346a487fb06e4b2519e1eaef83 Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Tue, 9 Mar 2021 01:58:40 -0700 Subject: [PATCH 03/21] calendAR Co-authored-by: Charles Ancheta --- client/components/CalendAr.tsx | 178 ++++++++++--------- client/components/Navigator.tsx | 5 +- client/components/screens/CalenderScreen.tsx | 61 +------ test.js | 33 ++++ 4 files changed, 132 insertions(+), 145 deletions(-) create mode 100644 test.js diff --git a/client/components/CalendAr.tsx b/client/components/CalendAr.tsx index 4290142..498a597 100644 --- a/client/components/CalendAr.tsx +++ b/client/components/CalendAr.tsx @@ -1,102 +1,108 @@ import React from "react"; import { View, Text, StyleSheet, Platform } from "react-native"; -import { Calendar, CalendarList, Agenda } from "react-native-calendars"; +import { Calendar } from "react-native-calendars"; import { Colours, Styles } from "../styles"; +const yellow = ["#FFFFB7", "#FFF192", "#FFEA61", "#FFDD3C", "#FFD400"]; + +const dateToYMD = (date: Date) => date.toISOString().slice(0, 10); + +const increaseDate = (date: Date) => new Date(new Date(date).setDate(date.getDate() + 1)); + +const createDateRange = (start: Date, end: Date) => { + const dateArr: Date[] = []; + for (let startCp = increaseDate(start); startCp < end; startCp = increaseDate(startCp)) { + dateArr.push(new Date(startCp)); + } + return dateArr; +}; + +interface MarkedDate { + [k: string]: { + startingDay?: boolean; + endingDay?: boolean; + selected?: boolean; + color: string; + textColor: string; + }; +} + +const createMarkedDates = (start: Date, end: Date) => { + const startStr = dateToYMD(start); + const endStr = dateToYMD(end); + const selectedStr = createDateRange(start, end).map((d) => dateToYMD(d)); + const markedDates: MarkedDate = { + [startStr]: { startingDay: true, color: yellow[0], textColor: Colours.darkBlue }, + }; + selectedStr.forEach((dateStr) => { + markedDates[dateStr] = { selected: true, color: yellow[0], textColor: Colours.darkBlue }; + }); + markedDates[endStr] = { endingDay: true, color: yellow[0], textColor: Colours.darkBlue }; + + return markedDates; +}; + export default function CalendAr() { return ( - { - console.log("selected day", day); - }} - // Handler which gets executed on day long press. Default = undefined - onDayLongPress={(day) => { - console.log("selected day", day); - }} - // Month format in calendar title. Formatting values: http://arshaw.com/xdate/#Formatting - monthFormat={"yyyy MM"} - // Handler which gets executed when visible month changes in calendar. Default = undefined - onMonthChange={(month) => { - console.log("month changed", month); - }} - // Hide month navigation arrows. Default = false - hideArrows={true} - // Replace default arrows with custom ones (direction can be 'left' or 'right') - hideExtraDays={true} - // If hideArrows=false and hideExtraDays=false do not switch month when tapping on greyed out - // day from another month that is visible in calendar page. Default = false - disableMonthChange={true} - // If firstDay=1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday. - firstDay={1} - // Hide day names. Default = false - hideDayNames={true} - // Show week numbers to the left. Default = false - showWeekNumbers={true} - // Handler which gets executed when press arrow icon left. It receive a callback can go back month - onPressArrowLeft={(subtractMonth) => subtractMonth()} - // Handler which gets executed when press arrow icon right. It receive a callback can go next month - onPressArrowRight={(addMonth) => addMonth()} - // Disable left arrow. Default = false - disableArrowLeft={true} - // Disable right arrow. Default = false - disableArrowRight={true} - // Enable the option to swipe between months. Default = false - enableSwipeMonths={true} - /> + + { + console.log("selected day", day); + }} + onMonthChange={(month) => { + console.log("month changed", month); + }} + monthFormat={"MMMM yyyy"} + // hideExtraDays={true} + firstDay={1} + onPressArrowLeft={(subtractMonth) => subtractMonth()} + onPressArrowRight={(addMonth) => addMonth()} + enableSwipeMonths={true} + // STREAKS + markingType={"period"} + markedDates={createMarkedDates(new Date("2021-03-08"), new Date("2021-03-29"))} + // STYLING + style={{ borderWidth: 1, borderColor: Colours.yellow, borderRadius: 20 }} + theme={{ + // backgroundColor: Colours.medBlue, + calendarBackground: Colours.medBlue, + textSectionTitleColor: Colours.yellow, + selectedDayBackgroundColor: Colours.medBlue, + selectedDayTextColor: Colours.yellow, + todayTextColor: Colours.yellow, + dayTextColor: Colours.yellow, + textDisabledColor: "#d9e1e8", + // dotColor: "#00adf5", + // selectedDotColor: "#ffffff", + arrowColor: Colours.yellow, + monthTextColor: Colours.yellow, + indicatorColor: "blue", + textDayFontFamily: Platform.OS == "ios" ? "Avenir-Light" : "sans-serif-light", + textMonthFontFamily: Platform.OS == "ios" ? "Avenir-Light" : "sans-serif-light", + textDayHeaderFontFamily: Platform.OS == "ios" ? "Avenir-Light" : "sans-serif-light", + // textDayFontWeight: "300", + textMonthFontWeight: "bold", + textDayHeaderFontWeight: "300", + textDayFontSize: 16, + textMonthFontSize: 16, + textDayHeaderFontSize: 14, + }} + /> + ); } + const styles = StyleSheet.create({ calendarBox: { marginTop: Platform.OS == "ios" ? "5%" : "10%", // marginHorizontal: Platform.isPad == true ? "5%" : null, + justifyContent: "center", + alignContent: "center", flex: 2, }, - divider: { - borderColor: Colours.yellow, - }, - infoBox: { - flex: 1, - marginHorizontal: "10%", - marginVertical: "3%", - borderWidth: 1, - borderRadius: 20, - borderColor: Colours.yellow, - alignItems: "center", - }, - infoHeaderBox: { - backgroundColor: Colours.yellow, - width: "100%", - padding: "5%", - borderTopEndRadius: 20, - borderTopStartRadius: 20, - }, - infoTextBox: { - flex: 1, - marginVertical: "5%", - }, - infoHeaderText: { - color: Colours.medBlue, - textAlign: "center", - fontSize: 20, - }, - infoText: { - color: Colours.yellow, - }, - text: { - color: Colours.yellow, - fontSize: 18, - }, - today: { - fontSize: 20, - color: Colours.yellow, - fontWeight: "bold", - }, }); diff --git a/client/components/Navigator.tsx b/client/components/Navigator.tsx index 86f334d..3ed5cde 100644 --- a/client/components/Navigator.tsx +++ b/client/components/Navigator.tsx @@ -50,7 +50,8 @@ import { const screens = [ // Uncomment this when making functions - { name: "CalendAr", component: CalendAr, disable: true }, + { name: "Calender", component: Calender, disable: true }, + // { name: "CalendAr", component: CalendAr, disable: true }, // { name: "Reminder", component: Reminder, disable: false }, { name: "Start", component: Start, disable: true }, { name: "SignIn", component: SignIn, disable: false }, @@ -61,7 +62,7 @@ const screens = [ { name: "Home", component: Home, disable: true }, { name: "Friends", component: Friends, disable: true }, { name: "Litreboards", component: Litreboards, disable: true }, - { name: "Calender", component: Calender, disable: true }, + // { name: "Calender", component: Calender, disable: true }, { name: "AddFriends", component: AddFriends, disable: true }, { name: "User", component: User, disable: true }, { name: "LogWater", component: LogWater, disable: true }, diff --git a/client/components/screens/CalenderScreen.tsx b/client/components/screens/CalenderScreen.tsx index f6d2cc5..1dfd129 100644 --- a/client/components/screens/CalenderScreen.tsx +++ b/client/components/screens/CalenderScreen.tsx @@ -1,7 +1,6 @@ import React, { useEffect, useState } from "react"; import { Text, StyleSheet, View, Platform } from "react-native"; -import CalendarPicker, { CustomDateStyle } from "react-native-calendar-picker"; -import moment from "moment"; +import CalendAr from "../CalendAr"; import { Colours, Styles } from "../../styles"; @@ -10,68 +9,16 @@ import SafeGradient from "../SafeGradient"; import ScreenProps from "./ScreenProps"; -const yellow = ["#FFFFB7", "#FFF192", "#FFEA61", "#FFDD3C", "#FFD400"]; - -function getGradient(arr: T[], day: number) { - return arr[Math.floor(day / 6)]; -} - -const today = moment(); - export default function CalendarScreen({ navigation }: ScreenProps) { - const [date, setDate] = useState(moment()); - const [dateStyles, setDateStyles] = useState([]); - - useEffect(() => { - let day = today.clone().startOf("month"); - let endOf = today.clone().endOf("month"); - let sameMonth = true; - console.log({ day, endOf, sameMonth }); - while (sameMonth) { - let newDay = day.clone(); - setDateStyles((dateStyles) => [ - ...dateStyles, - { - date: newDay, - style: { - // Not sure if it's better with background or text? - // backgroundColor: getGradient(yellow, newDay.day()), - }, - textStyle: { color: getGradient(yellow, newDay.day()) }, // white text on yellow background not good :( - }, - ]); - sameMonth = day.add(1, "day").isSameOrBefore(endOf, "day"); - console.log({ day, endOf, sameMonth }); - } - }, []); - return ( - setDate(date)} - startFromMonday={true} - // TODAY - todayTextStyle={styles.today} - todayBackgroundColor={"transparent"} - // SELECTED - selectedDayStyle={{ - borderWidth: 1, - borderColor: Colours.yellow, - }} - selectedDayTextColor={Colours.yellow} - // GENERAL - textStyle={{ ...Styles.body, ...styles.text }} - monthTitleStyle={Styles.title} - yearTitleStyle={Styles.title} - dayLabelsWrapper={styles.divider} - customDatesStyles={dateStyles} - /> + - {date.toString().slice(0, 15)} + {/* {date.toString().slice(0, 15)} */} @@ -79,7 +26,7 @@ export default function CalendarScreen({ navigation }: ScreenProps) { On this day you drank x{/*water*/} litres of water! - {Number(date?.toString().slice(8, 10)) > 15 + {/* {Number(date?.toString().slice(8, 10)) > 15 */} ? "You reached your goal! Way to go! " + String.fromCodePoint(0x1f929) : "You did not reach your goal " + String.fromCodePoint(0x1f614)} diff --git a/test.js b/test.js new file mode 100644 index 0000000..072a866 --- /dev/null +++ b/test.js @@ -0,0 +1,33 @@ +"use strict"; +const yellow = ["#FFFFB7", "#FFF192", "#FFEA61", "#FFDD3C", "#FFD400"]; +const Colours = { darkBlue: "colour" }; +const dateToYMD = (date) => date.toISOString().slice(0, 10); +const increaseDate = (date) => new Date(date.setDate(date.getDate() + 1)); +const createDateRange = (start, end) => { + const dateArr = []; + for ( + let startCp = increaseDate(new Date(start)); + startCp < end; + startCp = increaseDate(startCp) + ) { + dateArr.push(new Date(startCp)); + } + return dateArr; +}; +const createMarkedDates = (start, end) => { + const startStr = dateToYMD(start); + const endStr = dateToYMD(end); + const selectedStr = createDateRange(start, end).map((d) => dateToYMD(d)); + const markedDates = { + [startStr]: { startingDay: true, color: yellow[4], textColor: Colours.darkBlue }, + }; + selectedStr.forEach((dateStr) => { + markedDates[dateStr] = { selected: true, color: yellow[4], textColor: Colours.darkBlue }; + }); + markedDates[endStr] = { endingDay: true, color: yellow[4], textColor: Colours.darkBlue }; + return markedDates; +}; + +let date = new Date(); +let in14days = new Date(new Date(date).setDate(date.getDate() + 14)); +console.log(createMarkedDates(date, in14days)); From e74d4195047c10a5e5ca4ae85b92d33e3de5cc9e Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Tue, 9 Mar 2021 02:06:58 -0700 Subject: [PATCH 04/21] selected --- client/components/CalendAr.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/components/CalendAr.tsx b/client/components/CalendAr.tsx index 498a597..6d16bb6 100644 --- a/client/components/CalendAr.tsx +++ b/client/components/CalendAr.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useState } from "react"; import { View, Text, StyleSheet, Platform } from "react-native"; import { Calendar } from "react-native-calendars"; @@ -44,6 +44,7 @@ const createMarkedDates = (start: Date, end: Date) => { }; export default function CalendAr() { + const [selected, setSelected] = useState(""); return ( { + setSelected(day.dateString); console.log("selected day", day); }} onMonthChange={(month) => { @@ -67,10 +69,10 @@ export default function CalendAr() { markingType={"period"} markedDates={createMarkedDates(new Date("2021-03-08"), new Date("2021-03-29"))} // STYLING - style={{ borderWidth: 1, borderColor: Colours.yellow, borderRadius: 20 }} + // style={{ borderWidth: 1, borderColor: Colours.yellow, borderRadius: 20 }} theme={{ // backgroundColor: Colours.medBlue, - calendarBackground: Colours.medBlue, + calendarBackground: "transparent", textSectionTitleColor: Colours.yellow, selectedDayBackgroundColor: Colours.medBlue, selectedDayTextColor: Colours.yellow, From f8b4daaec2a1386383bda099915abf500a8b93a5 Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Tue, 9 Mar 2021 14:43:34 -0700 Subject: [PATCH 05/21] goodbye navigator weirdness --- client/components/Navigator.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/components/Navigator.tsx b/client/components/Navigator.tsx index 3ed5cde..0dc70ef 100644 --- a/client/components/Navigator.tsx +++ b/client/components/Navigator.tsx @@ -50,7 +50,7 @@ import { const screens = [ // Uncomment this when making functions - { name: "Calender", component: Calender, disable: true }, + // { name: "Calender", component: Calender, disable: true }, // { name: "CalendAr", component: CalendAr, disable: true }, // { name: "Reminder", component: Reminder, disable: false }, { name: "Start", component: Start, disable: true }, @@ -62,7 +62,7 @@ const screens = [ { name: "Home", component: Home, disable: true }, { name: "Friends", component: Friends, disable: true }, { name: "Litreboards", component: Litreboards, disable: true }, - // { name: "Calender", component: Calender, disable: true }, + { name: "Calender", component: Calender, disable: true }, { name: "AddFriends", component: AddFriends, disable: true }, { name: "User", component: User, disable: true }, { name: "LogWater", component: LogWater, disable: true }, From 1edd7408d5fc7809bbe2bc904cf80857c406f116 Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Tue, 9 Mar 2021 14:43:40 -0700 Subject: [PATCH 06/21] i think its done styling --- client/components/CalendAr.tsx | 44 +++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/client/components/CalendAr.tsx b/client/components/CalendAr.tsx index 6d16bb6..4711d7a 100644 --- a/client/components/CalendAr.tsx +++ b/client/components/CalendAr.tsx @@ -5,6 +5,20 @@ import { Calendar } from "react-native-calendars"; import { Colours, Styles } from "../styles"; const yellow = ["#FFFFB7", "#FFF192", "#FFEA61", "#FFDD3C", "#FFD400"]; +const months = [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", +]; const dateToYMD = (date: Date) => date.toISOString().slice(0, 10); @@ -43,8 +57,14 @@ const createMarkedDates = (start: Date, end: Date) => { return markedDates; }; -export default function CalendAr() { - const [selected, setSelected] = useState(""); +interface CalendArProps { + // selected: string; + // day: Date; + // month: Date; +} + +export default function CalendAr({}: CalendArProps) { + const [selectedDay, setSelectedDay] = useState(""); return ( { - setSelected(day.dateString); - console.log("selected day", day); + setSelectedDay(months[day.month - 1] + " " + day.day + ", " + day.year); + + console.log(selectedDay); }} onMonthChange={(month) => { - console.log("month changed", month); + // Grab the month data or something + // console.log("month changed", month); }} monthFormat={"MMMM yyyy"} // hideExtraDays={true} @@ -69,12 +91,18 @@ export default function CalendAr() { markingType={"period"} markedDates={createMarkedDates(new Date("2021-03-08"), new Date("2021-03-29"))} // STYLING - // style={{ borderWidth: 1, borderColor: Colours.yellow, borderRadius: 20 }} + style={{ + width: Platform.isPad == true ? "80%" : "100%", + borderWidth: Platform.isPad == true ? 1 : 0, + borderColor: Colours.yellow, + borderRadius: 20, + height: "100%", + alignSelf: "center", + }} theme={{ - // backgroundColor: Colours.medBlue, calendarBackground: "transparent", textSectionTitleColor: Colours.yellow, - selectedDayBackgroundColor: Colours.medBlue, + selectedDayBackgroundColor: "#ff7171", selectedDayTextColor: Colours.yellow, todayTextColor: Colours.yellow, dayTextColor: Colours.yellow, From 644aed48cdef1e53db824b529b611e854feb4911 Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Tue, 9 Mar 2021 14:43:59 -0700 Subject: [PATCH 07/21] implemented the calendar component in screen. pls fix variables --- client/components/screens/CalenderScreen.tsx | 68 +++++++++----------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/client/components/screens/CalenderScreen.tsx b/client/components/screens/CalenderScreen.tsx index 1dfd129..42bb4f2 100644 --- a/client/components/screens/CalenderScreen.tsx +++ b/client/components/screens/CalenderScreen.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from "react"; -import { Text, StyleSheet, View, Platform } from "react-native"; +import { Text, StyleSheet, View, Platform, ScrollView } from "react-native"; import CalendAr from "../CalendAr"; import { Colours, Styles } from "../../styles"; @@ -12,48 +12,49 @@ import ScreenProps from "./ScreenProps"; export default function CalendarScreen({ navigation }: ScreenProps) { return ( - - - - - - - {/* {date.toString().slice(0, 15)} */} - + + + - - - On this day you drank x{/*water*/} litres of water! - - - {/* {Number(date?.toString().slice(8, 10)) > 15 */} - ? "You reached your goal! Way to go! " + String.fromCodePoint(0x1f929) - : "You did not reach your goal " + String.fromCodePoint(0x1f614)} - + + + + selectedDay + {/* Like rn, the calendar component returns a string :/ */} + + + + + On this day you drank x{/*water*/} litres of water! + + + {Number(1234567890?.toString().slice(8, 10)) > 15 + ? "You reached your goal! Way to go! " + String.fromCodePoint(0x1f929) + : "You did not reach your goal " + String.fromCodePoint(0x1f614)} + + - + ); } const styles = StyleSheet.create({ + // CONTAINERS calendarBox: { - marginTop: Platform.OS == "ios" ? "5%" : "10%", - // marginHorizontal: Platform.isPad == true ? "5%" : null, flex: 2, - }, - divider: { - borderColor: Colours.yellow, + // borderWidth: 1, }, infoBox: { flex: 1, - marginHorizontal: "10%", - marginVertical: "3%", + alignSelf: "center", + marginVertical: "5%", + width: Platform.isPad == true ? "60%" : "80%", + alignItems: "center", borderWidth: 1, borderRadius: 20, borderColor: Colours.yellow, - alignItems: "center", }, infoHeaderBox: { backgroundColor: Colours.yellow, @@ -61,11 +62,13 @@ const styles = StyleSheet.create({ padding: "5%", borderTopEndRadius: 20, borderTopStartRadius: 20, + flex: 1, }, infoTextBox: { - flex: 1, + flex: 2, marginVertical: "5%", }, + // TEXT infoHeaderText: { color: Colours.medBlue, textAlign: "center", @@ -74,13 +77,4 @@ const styles = StyleSheet.create({ infoText: { color: Colours.yellow, }, - text: { - color: Colours.yellow, - fontSize: 18, - }, - today: { - fontSize: 20, - color: Colours.yellow, - fontWeight: "bold", - }, }); From 7213f7f57df11107a9a4811e3498805153cd2064 Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Tue, 9 Mar 2021 21:56:36 -0700 Subject: [PATCH 08/21] idk what i even did!!!! --- client/components/CalendAr.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/components/CalendAr.tsx b/client/components/CalendAr.tsx index 4711d7a..9668bcd 100644 --- a/client/components/CalendAr.tsx +++ b/client/components/CalendAr.tsx @@ -58,7 +58,7 @@ const createMarkedDates = (start: Date, end: Date) => { }; interface CalendArProps { - // selected: string; + // props: string; // day: Date; // month: Date; } @@ -74,7 +74,6 @@ export default function CalendAr({}: CalendArProps) { // maxDate={"2012-05-30"} onDayPress={(day) => { setSelectedDay(months[day.month - 1] + " " + day.day + ", " + day.year); - console.log(selectedDay); }} onMonthChange={(month) => { From 8e0acbaf8b96f0a3f38f49a0b3ca5ce342b4e7ca Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Wed, 10 Mar 2021 23:20:02 -0700 Subject: [PATCH 09/21] pretty graphs --- client/components/LogChart.tsx | 46 +++ client/components/Navigator.tsx | 4 +- client/components/TipsModal.tsx | 16 +- client/components/screens/index.tsx | 4 +- client/package.json | 4 +- client/yarn.lock | 493 +++++++++++++++++++++++++--- 6 files changed, 512 insertions(+), 55 deletions(-) create mode 100644 client/components/LogChart.tsx diff --git a/client/components/LogChart.tsx b/client/components/LogChart.tsx new file mode 100644 index 0000000..2d4a675 --- /dev/null +++ b/client/components/LogChart.tsx @@ -0,0 +1,46 @@ +import React, { useState } from "react"; +import { View, Text, StyleSheet, Platform } from "react-native"; +import { VictoryScatter, VictoryChart, VictoryTheme } from "victory-native"; + +import { Colours, Styles } from "../styles"; + +const yellow = ["#FFFFB7", "#FFF192", "#FFEA61", "#FFDD3C", "#FFD400"]; +const months = [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", +]; +const data = [ + { quarter: 1, earnings: 13000 }, + { quarter: 2, earnings: 16500 }, + { quarter: 3, earnings: 14250 }, + { quarter: 4, earnings: 19000 }, +]; + +export default function LogChart() { + return ( + + + + + + ); +} + +const styles = StyleSheet.create({ + graphBox: { + marginTop: Platform.OS == "ios" ? "5%" : "10%", + justifyContent: "center", + alignContent: "center", + flex: 1, + }, +}); diff --git a/client/components/Navigator.tsx b/client/components/Navigator.tsx index 0dc70ef..c973dd0 100644 --- a/client/components/Navigator.tsx +++ b/client/components/Navigator.tsx @@ -39,7 +39,7 @@ import { Home, Friends, Calender, - CalendAr, + LogChart, AddFriends, User, LogWater, @@ -51,7 +51,7 @@ import { const screens = [ // Uncomment this when making functions // { name: "Calender", component: Calender, disable: true }, - // { name: "CalendAr", component: CalendAr, disable: true }, + { name: "LogChart", component: LogChart, disable: true }, // { name: "Reminder", component: Reminder, disable: false }, { name: "Start", component: Start, disable: true }, { name: "SignIn", component: SignIn, disable: false }, diff --git a/client/components/TipsModal.tsx b/client/components/TipsModal.tsx index 2111606..aed5d3b 100644 --- a/client/components/TipsModal.tsx +++ b/client/components/TipsModal.tsx @@ -13,14 +13,14 @@ const tips = [ "Don't pee on anyone, or else they're going to be pissed.", // THESE ARE ACTUAL HEALTH TIPS LOL - // "Water composes 75% of the human brain!", - // "Water helps regulate your body temperature", - // "Water makes up 75% of your muscles", - // "Using a straw makes you drink faster! Invest in a reusable straw to reduce waste.", - // "Spice up your water by adding fresh fruit, vegetables, or herbs. Try cucumers + mint!", - // "If you have a headache, it might be from dehydration. Try drinking water!", - // "Drinking water leads to healthier skin. Get that glow on!", - // "Drinking water helps you lose weight.", + "Water composes 75% of the human brain!", + "Water helps regulate your body temperature", + "Water makes up 75% of your muscles", + "Using a straw makes you drink faster! Invest in a reusable straw to reduce waste.", + "Spice up your water by adding fresh fruit, vegetables, or herbs. Try cucumers + mint!", + "If you have a headache, it might be from dehydration. Try drinking water!", + "Drinking water leads to healthier skin. Get that glow on!", + "Drinking water helps you lose weight.", ]; const rand = () => Math.floor(Math.random() * tips.length); diff --git a/client/components/screens/index.tsx b/client/components/screens/index.tsx index 73cd904..ae8cbcb 100644 --- a/client/components/screens/index.tsx +++ b/client/components/screens/index.tsx @@ -2,7 +2,6 @@ export { default as Home } from "./HomeScreen"; export { default as SignIn } from "./SignInScreen"; export { default as User } from "./UserScreen"; export { default as Calender } from "./CalenderScreen"; -export { default as CalendAr } from "../CalendAr"; export { default as Reminder } from "./register/ReminderScreen"; export { default as Register } from "./register/RegisterScreen"; @@ -17,3 +16,6 @@ export { default as WaterLog } from "./log/WaterLogScreen"; export { default as AddFriends } from "./friends/AddFriendsScreen"; export { default as Friends } from "./friends/FriendsScreen"; export { default as Litreboards } from "./friends/LitreboardsScreen"; + +// DELETE THIS AFTER +export { default as LogChart } from "../LogChart"; diff --git a/client/package.json b/client/package.json index ab00897..b83a5c2 100644 --- a/client/package.json +++ b/client/package.json @@ -23,7 +23,6 @@ "react": "16.13.1", "react-dom": "16.13.1", "react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz", - "react-native-calendar-picker": "^7.0.9", "react-native-calendars": "^1.1254.0", "react-native-elements": "^3.2.0", "react-native-gesture-handler": "~1.8.0", @@ -36,7 +35,8 @@ "react-native-web": "~0.13.12", "react-native-windows": "^0.63.20", "react-navigation": "^4.4.3", - "react-navigation-stack": "^2.10.2" + "react-navigation-stack": "^2.10.2", + "victory-native": "^35.3.1" }, "devDependencies": { "@babel/core": "~7.9.0", diff --git a/client/yarn.lock b/client/yarn.lock index f04ad86..3e2da95 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -2964,6 +2964,92 @@ csstype@^3.0.2: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.6.tgz#865d0b5833d7d8d40f4e5b8a6d76aea3de4725ef" integrity sha512-+ZAmfyWMT7TiIlzdqJgjMb7S4f1beorDbWbsocyK4RaiqA5RTX3K14bnBWmmA9QEM0gRdsjyyrEmcyga8Zsxmw== +d3-array@^1.2.0: + version "1.2.4" + resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-1.2.4.tgz#635ce4d5eea759f6f605863dbcfc30edc737f71f" + integrity sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw== + +d3-array@^2.4.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-2.11.0.tgz#5ed6a2869bc7d471aec8df9ff6ed9fef798facc4" + integrity sha512-26clcwmHQEdsLv34oNKq5Ia9tQ26Y/4HqS3dQzF42QBUqymZJ+9PORcN1G52bt37NsL2ABoX4lvyYZc+A9Y0zw== + dependencies: + internmap "^1.0.0" + +d3-collection@1: + version "1.0.7" + resolved "https://registry.yarnpkg.com/d3-collection/-/d3-collection-1.0.7.tgz#349bd2aa9977db071091c13144d5e4f16b5b310e" + integrity sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A== + +d3-color@1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-1.4.1.tgz#c52002bf8846ada4424d55d97982fef26eb3bc8a" + integrity sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q== + +d3-ease@^1.0.0: + version "1.0.7" + resolved "https://registry.yarnpkg.com/d3-ease/-/d3-ease-1.0.7.tgz#9a834890ef8b8ae8c558b2fe55bd57f5993b85e2" + integrity sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ== + +d3-format@1: + version "1.4.5" + resolved "https://registry.yarnpkg.com/d3-format/-/d3-format-1.4.5.tgz#374f2ba1320e3717eb74a9356c67daee17a7edb4" + integrity sha512-J0piedu6Z8iB6TbIGfZgDzfXxUFN3qQRMofy2oPdXzQibYGqPB/9iMcxr/TGalU+2RsyDO+U4f33id8tbnSRMQ== + +d3-interpolate@1, d3-interpolate@^1.1.1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/d3-interpolate/-/d3-interpolate-1.4.0.tgz#526e79e2d80daa383f9e0c1c1c7dcc0f0583e987" + integrity sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA== + dependencies: + d3-color "1" + +d3-path@1: + version "1.0.9" + resolved "https://registry.yarnpkg.com/d3-path/-/d3-path-1.0.9.tgz#48c050bb1fe8c262493a8caf5524e3e9591701cf" + integrity sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg== + +d3-scale@^1.0.0: + version "1.0.7" + resolved "https://registry.yarnpkg.com/d3-scale/-/d3-scale-1.0.7.tgz#fa90324b3ea8a776422bd0472afab0b252a0945d" + integrity sha512-KvU92czp2/qse5tUfGms6Kjig0AhHOwkzXG0+PqIJB3ke0WUv088AHMZI0OssO9NCkXt4RP8yju9rpH8aGB7Lw== + dependencies: + d3-array "^1.2.0" + d3-collection "1" + d3-color "1" + d3-format "1" + d3-interpolate "1" + d3-time "1" + d3-time-format "2" + +d3-shape@^1.0.0, d3-shape@^1.2.0: + version "1.3.7" + resolved "https://registry.yarnpkg.com/d3-shape/-/d3-shape-1.3.7.tgz#df63801be07bc986bc54f63789b4fe502992b5d7" + integrity sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw== + dependencies: + d3-path "1" + +d3-time-format@2: + version "2.3.0" + resolved "https://registry.yarnpkg.com/d3-time-format/-/d3-time-format-2.3.0.tgz#107bdc028667788a8924ba040faf1fbccd5a7850" + integrity sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ== + dependencies: + d3-time "1" + +d3-time@1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/d3-time/-/d3-time-1.1.0.tgz#b1e19d307dae9c900b7e5b25ffc5dcc249a8a0f1" + integrity sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA== + +d3-timer@^1.0.0: + version "1.0.10" + resolved "https://registry.yarnpkg.com/d3-timer/-/d3-timer-1.0.10.tgz#dfe76b8a91748831b13b6d9c793ffbd508dd9de5" + integrity sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw== + +d3-voronoi@^1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/d3-voronoi/-/d3-voronoi-1.1.4.tgz#dd3c78d7653d2bb359284ae478645d95944c8297" + integrity sha512-dArJ32hchFsrQ8uMiTBLq256MpnZjeuBtdHpaDlYuQyjU0CVzCJl/BVW+SkszaAeH95D/8gxqAhgx0ouAWAfRg== + dayjs@^1.8.15: version "1.10.4" resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.4.tgz#8e544a9b8683f61783f570980a8a80eaf54ab1e2" @@ -3067,6 +3153,18 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" +delaunator@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/delaunator/-/delaunator-4.0.1.tgz#3d779687f57919a7a418f8ab947d3bddb6846957" + integrity sha512-WNPWi1IRKZfCt/qIDMfERkDp93+iZEmOxN2yy4Jg+Xhv8SLk2UTqqbe1sfiipn0and9QrE914/ihdx82Y/Giag== + +delaunay-find@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/delaunay-find/-/delaunay-find-0.0.5.tgz#5fb37e6509da934881b4b16c08898ac89862c097" + integrity sha512-7yAJ/wmKWj3SgqjtkGqT/RCwI0HWAo5YnHMoF5nYXD8cdci+YSo23iPmgrZUNOpDxRWN91PqxUvMMr2lKpjr+w== + dependencies: + delaunator "^4.0.0" + denodeify@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/denodeify/-/denodeify-1.2.1.tgz#3a36287f5034e699e7577901052c2e6c94251631" @@ -3620,7 +3718,7 @@ fbjs@1.0.0, fbjs@^1.0.0: setimmediate "^1.0.5" ua-parser-js "^0.7.18" -fbjs@^0.8.4, fbjs@^0.8.9: +fbjs@^0.8.4: version "0.8.17" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90= @@ -4071,6 +4169,11 @@ inquirer@^3.0.6: strip-ansi "^4.0.0" through "^2.3.6" +internmap@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/internmap/-/internmap-1.0.0.tgz#3c6bf0944b0eae457698000412108752bbfddb56" + integrity sha512-SdoDWwNOTE2n4JWUsLn4KXZGuZPjPF9yyOGc8bnfWnBQh7BD/l80rzSznKc/r4Y0aQ7z3RTk9X+tV4tHBpu+dA== + interpret@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" @@ -4521,6 +4624,11 @@ json-stable-stringify@^1.0.1: dependencies: jsonify "~0.0.0" +json-stringify-safe@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" @@ -4675,11 +4783,6 @@ lodash._reinterpolate@^3.0.0: resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= -lodash.debounce@4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" - integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= - lodash.frompairs@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/lodash.frompairs/-/lodash.frompairs-4.0.1.tgz#bc4e5207fa2757c136e573614e9664506b2b1bd2" @@ -5262,11 +5365,6 @@ node-fetch@^2.2.0, node-fetch@^2.6.0: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== -node-git-hooks@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/node-git-hooks/-/node-git-hooks-1.0.5.tgz#2af86746576514016b6f4b8349a8ef161c690043" - integrity sha512-05rULsJy8z2OvXTQFZv9fN20uo186EYgJYQjkL1OjnXj53QivOAGUzZilZ/MX8OmPRaN+deJBtlvMRydpdfnqA== - node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -5779,14 +5877,7 @@ promise@^8.0.3: dependencies: asap "~2.0.6" -prop-types@15.5.8: - version "15.5.8" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.8.tgz#6b7b2e141083be38c8595aa51fc55775c7199394" - integrity sha1-a3suFBCDvjjIWVqlH8VXdccZk5Q= - dependencies: - fbjs "^0.8.9" - -prop-types@^15.5.10, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -5856,6 +5947,11 @@ react-dom@16.13.1: prop-types "^15.6.2" scheduler "^0.19.1" +react-fast-compare@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-2.0.4.tgz#e84b4d455b0fec113e0402c329352715196f81f9" + integrity sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw== + react-is@^16.12.0, react-is@^16.13.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" @@ -5866,15 +5962,6 @@ react-is@^17.0.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.1.tgz#5b3531bd76a645a4c9fb6e693ed36419e3301339" integrity sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA== -react-native-calendar-picker@^7.0.9: - version "7.0.9" - resolved "https://registry.yarnpkg.com/react-native-calendar-picker/-/react-native-calendar-picker-7.0.9.tgz#eec808e8e84f1c6b27d7e82bb573935533098f73" - integrity sha512-6CXsCu/dZVEPdFxw/1PNPqPU/MP123OFoWr1EgVYotb3UofFCCDol475vqghRqTBrr90H8lASmmCFjOuTITljQ== - dependencies: - node-git-hooks "^1.0.1" - prop-types "^15.6.0" - recyclerlistview "^3.0.0" - react-native-calendars@^1.1254.0: version "1.1254.0" resolved "https://registry.yarnpkg.com/react-native-calendars/-/react-native-calendars-1.1254.0.tgz#49dfb880c6588188a49ba15ecfb56cace2d3b3fe" @@ -6110,15 +6197,6 @@ rechoir@^0.6.2: dependencies: resolve "^1.1.6" -recyclerlistview@^3.0.0: - version "3.0.5" - resolved "https://registry.yarnpkg.com/recyclerlistview/-/recyclerlistview-3.0.5.tgz#50bf5bcaa401d56bb6bb264354083f4d424408eb" - integrity sha512-JVHz13u520faEsbVqFrJOMuJjc4mJlOXODe5QdqAJHdl5/IpyYeo83uiHrpzxyLb8QtJ0889JMlDik+Z1Ed0QQ== - dependencies: - lodash.debounce "4.0.8" - prop-types "15.5.8" - ts-object-utils "0.0.5" - regenerate-unicode-properties@^8.2.0: version "8.2.0" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz#e5de7111d655e7ba60c057dbe9ff37c87e65cdec" @@ -6904,11 +6982,6 @@ toidentifier@1.0.0: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== -ts-object-utils@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/ts-object-utils/-/ts-object-utils-0.0.5.tgz#95361cdecd7e52167cfc5e634c76345e90a26077" - integrity sha1-lTYc3s1+UhZ8/F5jTHY0XpCiYHc= - type-fest@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1" @@ -7162,6 +7235,342 @@ vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= +victory-area@^35.3.3, victory-area@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-area/-/victory-area-35.4.11.tgz#482d69455574e20ba8b1b7e2b2d79166ae8c3d1e" + integrity sha512-5HHJhSe8sRUfvfGIC6U9UsbL9mkWCtbCCBjLFLkCb0STmLcaVd2hsahX7TqEIxvsRKgflGwRfd6MPKi64LYJrg== + dependencies: + d3-shape "^1.2.0" + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory-axis@^35.3.3, victory-axis@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-axis/-/victory-axis-35.4.11.tgz#07d9fbcf0b4aaf3479313f26de60308060e046e2" + integrity sha512-qrBWFXGCg3Nip0zZZxqjkPcrYSuIO44agXymNpLYey3XsNPSiQ/iwx6pcF6E34uENaB0wfDomQZgXIdGr8H6Qw== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory-bar@^35.3.3, victory-bar@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-bar/-/victory-bar-35.4.11.tgz#402cf0571656f808e22a135c23fcb11a4098e441" + integrity sha512-/btO14sBFJjhqqi2f+MJ2nol4U272QanRPT6yAd9NGtIEeNXsxbjo6pD6se/fzX3BLMjeTP8Euif1xS0bmMjUA== + dependencies: + d3-shape "^1.2.0" + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory-box-plot@^35.3.3, victory-box-plot@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-box-plot/-/victory-box-plot-35.4.11.tgz#80e573bd1fd66f131f86a12271458b0d46bfad5f" + integrity sha512-k4fQH66A6I48ELoIk61c37+RhlhqU0OU5m6vvQ7VzTUJEQCYyA5v6FGMG4me2N+nIE11kNtE4Yoc2aWd5zHnIA== + dependencies: + d3-array "^1.2.0" + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory-brush-container@^35.3.3, victory-brush-container@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-brush-container/-/victory-brush-container-35.4.11.tgz#ec37ab020412e6ef94a76c471b25d776e3dcd9c2" + integrity sha512-eG1i58ddXRhCv4tibT+1p55aJs7f1RE4QyaAuYRNoIGtOAHc4tC5uImrU667N+q4KSUYreuKwC7r8sHxobGJNg== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.8" + react-fast-compare "^2.0.0" + victory-core "^35.4.11" + +victory-brush-line@^35.3.3, victory-brush-line@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-brush-line/-/victory-brush-line-35.4.11.tgz#d8d236b1c5333ceec19c4522a07bf5295d36e8f7" + integrity sha512-1jzHO1be2ciHnAg3BEg1GHxzAWwwHMFPvTwcygkeaGBKGo8WZdABRYa/6JVCK3mAKyx+E4ubsPcNhaCzrSlOFg== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.8" + react-fast-compare "^2.0.0" + victory-core "^35.4.11" + +victory-candlestick@^35.3.3, victory-candlestick@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-candlestick/-/victory-candlestick-35.4.11.tgz#a5a3ded0b6bce8cf8f80f4aa4a02c6f0ca4e888a" + integrity sha512-Xf1ICFFmBhlk8P/hV7KkYP0xi6+00PlqfWYu3eglW1FhkIB9smIIRgFDwOqDWauUVb+eTGgr+hWc8EgVDwO2pg== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory-chart@^35.3.3, victory-chart@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-chart/-/victory-chart-35.4.11.tgz#604de7a357741769972e6a3c084004d4a4846695" + integrity sha512-LPdoVX8LVzmHjE6mQQMWNFfqy8WnuN5UnBiWiKhQB1HNiCwL2JPWsSqaDIdV8flGBKSZzKDgsLmMABxGjwfBcg== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.8" + react-fast-compare "^2.0.0" + victory-axis "^35.4.11" + victory-core "^35.4.11" + victory-polar-axis "^35.4.11" + victory-shared-events "^35.4.11" + +victory-core@^35.3.3, victory-core@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-core/-/victory-core-35.4.11.tgz#61d6ee1e5f99655905a213e83b63cab1ac02a663" + integrity sha512-vXcX9pgZqUN7FLFn1Z2SfzBBBu3PyyN46kfKaNjcJbVnhdxtnmN8MfYtXx3eJGIJlv0FsTrPY8fpBYQpYHho4w== + dependencies: + d3-ease "^1.0.0" + d3-interpolate "^1.1.1" + d3-scale "^1.0.0" + d3-shape "^1.2.0" + d3-timer "^1.0.0" + lodash "^4.17.19" + prop-types "^15.5.8" + react-fast-compare "^2.0.0" + +victory-create-container@^35.3.3, victory-create-container@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-create-container/-/victory-create-container-35.4.11.tgz#b013e02133f53568d22031e0ad61dd8aada6ad7e" + integrity sha512-v0CHqIvxupH76hBAcBe6nSwhqKOdnF7A94sLB0MCByeLI6ayWQ/PWRegjzYwYak2LjHvd9PvyChQkQhVstLGZw== + dependencies: + lodash "^4.17.19" + victory-brush-container "^35.4.11" + victory-core "^35.4.11" + victory-cursor-container "^35.4.11" + victory-selection-container "^35.4.11" + victory-voronoi-container "^35.4.11" + victory-zoom-container "^35.4.11" + +victory-cursor-container@^35.3.3, victory-cursor-container@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-cursor-container/-/victory-cursor-container-35.4.11.tgz#e250c7d7faf8a92aa53813ab9b9cea179bae11a8" + integrity sha512-UUKzKUUAaiSqMgVQbY5Z/X4vwRMi3m6WVIhT+1NIv8q9SrLBY5qXb21WcuF2u5rKeq1hcyioC7ZiGG3j9ZkgOQ== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory-errorbar@^35.3.3, victory-errorbar@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-errorbar/-/victory-errorbar-35.4.11.tgz#af4858861eaa3fbdb734054945064231742d1e82" + integrity sha512-2QU1qVk4q73jHNw+a7MyjnWsnU7dhOhaBI/uMrlgd3cUY29xsKeLSlRw/yuHGQ7Ovn4WN7mMXBSULIWMcv76vg== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory-group@^35.3.3, victory-group@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-group/-/victory-group-35.4.11.tgz#f5742fade75a6bbea977643b4dc8613612411918" + integrity sha512-pqb4n77MvopvCrLY8twjoFk6ariJD8nFG08uTLA83Phqo28J2TfWZBGzGES4/uLL/FIms4h7gtGcq5qgwlaLTQ== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.8" + react-fast-compare "^2.0.0" + victory-core "^35.4.11" + victory-shared-events "^35.4.11" + +victory-histogram@^35.3.3, victory-histogram@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-histogram/-/victory-histogram-35.4.11.tgz#45c530df94ce4f968ecded6676345ca4fc9bb635" + integrity sha512-y9vsUJfsQK3vvDNozXz39LCes59xYcyXZmExe6uB/pr+2lr0PtM8FAQAD2u0Vdc35h1ObTGuqqhdj7gXc9nezw== + dependencies: + d3-array "^2.4.0" + d3-scale "^1.0.0" + lodash "^4.17.19" + prop-types "^15.5.8" + react-fast-compare "^2.0.0" + victory-bar "^35.4.11" + victory-core "^35.4.11" + +victory-legend@^35.3.3, victory-legend@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-legend/-/victory-legend-35.4.11.tgz#8d004e22e4d02f9e658f921b756839c98d9d1061" + integrity sha512-3E5DKYrkrqtC1YeqNHixRpfXYHo9qumBjLnfaP6IF/06R5sn5o5LdYHT0yz8ATXDL0AxZqRM2q6Au9Mwvcq2xg== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory-line@^35.3.3, victory-line@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-line/-/victory-line-35.4.11.tgz#67a9d26e0c06d125ac65a293c345410f2cca91ef" + integrity sha512-LmkvY1wMvXhBYvnafaZbSS7JiOgGEJ0+qy3HuTtT66THOKBuxAo0T66BsURFTN7LpFvjBz2QRehrtJ/KWfOz9A== + dependencies: + d3-shape "^1.2.0" + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory-native@^35.3.1: + version "35.3.1" + resolved "https://registry.yarnpkg.com/victory-native/-/victory-native-35.3.1.tgz#cd3e22d4d0745ab9c2a53c7ba35fef980ba14adc" + integrity sha512-VyBDZ0G8k9mcbT5H5ONpx8uxlozYb9QYKmTf0z98elvAxgSC33+rQ5jaEg9JbJ4IpG+ppXZmMXmaZ5qYKUXuwg== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.10" + react-fast-compare "^2.0.0" + victory "^35.3.3" + victory-area "^35.3.3" + victory-axis "^35.3.3" + victory-bar "^35.3.3" + victory-box-plot "^35.3.3" + victory-brush-container "^35.3.3" + victory-brush-line "^35.3.3" + victory-candlestick "^35.3.3" + victory-chart "^35.3.3" + victory-core "^35.3.3" + victory-create-container "^35.3.3" + victory-cursor-container "^35.3.3" + victory-errorbar "^35.3.3" + victory-group "^35.3.3" + victory-histogram "^35.3.3" + victory-legend "^35.3.3" + victory-line "^35.3.3" + victory-pie "^35.3.3" + victory-polar-axis "^35.3.3" + victory-scatter "^35.3.3" + victory-selection-container "^35.3.3" + victory-shared-events "^35.3.3" + victory-stack "^35.3.3" + victory-tooltip "^35.3.3" + victory-voronoi "^35.3.3" + victory-voronoi-container "^35.3.3" + victory-zoom-container "^35.3.3" + +victory-pie@^35.3.3, victory-pie@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-pie/-/victory-pie-35.4.11.tgz#228b7d17c9e172122f93bc79cacfd144b24a32b6" + integrity sha512-AAfm3oUQRTOMfMMWQh5spMq0YdnY+DU9V8NbU/TBmBmgvVwWcZQOZqHlYb4rd21HL26VwcHeRe+EfXdLLV7vHg== + dependencies: + d3-shape "^1.0.0" + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory-polar-axis@^35.3.3, victory-polar-axis@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-polar-axis/-/victory-polar-axis-35.4.11.tgz#e2fdd84d45abc318ba29e452382635094f88dbab" + integrity sha512-yLrZ/PfcCRvw98zUBPB+LK9EoiYLBjellnILI3nAT5vCvKg1AnmBdF0lLuz0tM9jfcFdCL+1o2IO+r+OHKWTnw== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory-scatter@^35.3.3, victory-scatter@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-scatter/-/victory-scatter-35.4.11.tgz#ad60e4c08f0ddd6699ab95f94279bf678d626eeb" + integrity sha512-IKcYa9tYwO2OIn12AotySRzpQ+tWAy71i/sdckw3lh3FBWDk6Zq+PVlICYDgKLuTsV2bUDQixYZGDQ5lcNIcmw== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory-selection-container@^35.3.3, victory-selection-container@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-selection-container/-/victory-selection-container-35.4.11.tgz#205b249d4685882b96e7c8646f9edc30179e9308" + integrity sha512-+yuUd+Clt+BFD+moFgPCuU1pbiJrHwzncovUEnfKO668HKgEr1HbR67sd2ZDLVULhfG1JRwGnbzWAYnQBcjEoA== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory-shared-events@^35.3.3, victory-shared-events@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-shared-events/-/victory-shared-events-35.4.11.tgz#28843d3c6d2165d15ee61ea5c70e0bc6a68c8229" + integrity sha512-OjoqLfIHX82iThVbZmytMDddzIKLTkIhfB2+qptGA7/2VKInmdQXi5IUjp904YJZls7oLLRMwXsGEwKKvZLLBw== + dependencies: + json-stringify-safe "^5.0.1" + lodash "^4.17.19" + prop-types "^15.5.8" + react-fast-compare "^2.0.0" + victory-core "^35.4.11" + +victory-stack@^35.3.3, victory-stack@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-stack/-/victory-stack-35.4.11.tgz#e7b2626313e7090566ba2e77ba673563d64e5af6" + integrity sha512-NVVe1CI+BsKinJEFIfinOFex3cESI/NbeVG6lSJmxHkmh56B3ICYJvXbgLSTS5WKcExbSe6bkB3mMJrEZf1+eA== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.8" + react-fast-compare "^2.0.0" + victory-core "^35.4.11" + victory-shared-events "^35.4.11" + +victory-tooltip@^35.3.3, victory-tooltip@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-tooltip/-/victory-tooltip-35.4.11.tgz#c4291b0517010f09bac7bda89d482ad690cf8f63" + integrity sha512-nyhENyuy5/7Swl3H/q9T9g04TniPyE6vNvN+xkJw+KIHL8FivajjY7xtZhcUoid6ZUKWjcaYI1wu/TUpX9uMCg== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory-voronoi-container@^35.3.3, victory-voronoi-container@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-voronoi-container/-/victory-voronoi-container-35.4.11.tgz#d7c03f997de8e0129fbab38dbdb1dbca83647217" + integrity sha512-3KL5pN46+S0N1GSnNaTILgSXrmW/8Y6WryWhxlv/dgcDGd9j9V5gNF1OVBjqPeCYyu1jlszXB+PxMcE1CaCYEQ== + dependencies: + delaunay-find "0.0.5" + lodash "^4.17.19" + prop-types "^15.5.8" + react-fast-compare "^2.0.0" + victory-core "^35.4.11" + victory-tooltip "^35.4.11" + +victory-voronoi@^35.3.3, victory-voronoi@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-voronoi/-/victory-voronoi-35.4.11.tgz#cca179d5f68bc381fceee0a59a34bd9e8d2400fe" + integrity sha512-mPx8UcwPqGHaCDOIbTVD3/wOqBnelZqc6r6ssJfb3FT977t0kSJBrFC6a5NVopumvlPGONA4iZRCMVOu6aiirg== + dependencies: + d3-voronoi "^1.1.2" + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory-zoom-container@^35.3.3, victory-zoom-container@^35.4.11: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory-zoom-container/-/victory-zoom-container-35.4.11.tgz#42851b23e8d266a1d8a811f6382212b6eaef2816" + integrity sha512-iCbBU2enQLAkFmOC2rqV1xh8voC+kgDoaxjlXsh39dkK7bjkzGHS7N4zFcIN31tJtulSzR1w3X/owjK3dTzHkQ== + dependencies: + lodash "^4.17.19" + prop-types "^15.5.8" + victory-core "^35.4.11" + +victory@^35.3.3: + version "35.4.11" + resolved "https://registry.yarnpkg.com/victory/-/victory-35.4.11.tgz#ced7fbd48df1cac6bfd46b38f8c602dfd512c311" + integrity sha512-sl+dwS6cMEBw0ibsUgzFjmmK7CIiha+0SzPVOC5vHkvAD/La+tiG/rGBFOCIiral1d0q+JxV+SBDJXq9jMgIPw== + dependencies: + victory-area "^35.4.11" + victory-axis "^35.4.11" + victory-bar "^35.4.11" + victory-box-plot "^35.4.11" + victory-brush-container "^35.4.11" + victory-brush-line "^35.4.11" + victory-candlestick "^35.4.11" + victory-chart "^35.4.11" + victory-core "^35.4.11" + victory-create-container "^35.4.11" + victory-cursor-container "^35.4.11" + victory-errorbar "^35.4.11" + victory-group "^35.4.11" + victory-histogram "^35.4.11" + victory-legend "^35.4.11" + victory-line "^35.4.11" + victory-pie "^35.4.11" + victory-polar-axis "^35.4.11" + victory-scatter "^35.4.11" + victory-selection-container "^35.4.11" + victory-shared-events "^35.4.11" + victory-stack "^35.4.11" + victory-tooltip "^35.4.11" + victory-voronoi "^35.4.11" + victory-voronoi-container "^35.4.11" + victory-zoom-container "^35.4.11" + vlq@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/vlq/-/vlq-1.0.1.tgz#c003f6e7c0b4c1edd623fd6ee50bbc0d6a1de468" From 848714c272147d512c2f6b1fdeac0e3458fddea7 Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Thu, 11 Mar 2021 01:11:35 -0700 Subject: [PATCH 10/21] the heck --- client/components/LogChart.tsx | 103 +++++++++++++++++++++++++-------- 1 file changed, 80 insertions(+), 23 deletions(-) diff --git a/client/components/LogChart.tsx b/client/components/LogChart.tsx index 2d4a675..e558809 100644 --- a/client/components/LogChart.tsx +++ b/client/components/LogChart.tsx @@ -1,36 +1,92 @@ import React, { useState } from "react"; -import { View, Text, StyleSheet, Platform } from "react-native"; -import { VictoryScatter, VictoryChart, VictoryTheme } from "victory-native"; +import { View, Text, StyleSheet, Platform, Dimensions } from "react-native"; +import { + VictoryScatter, + VictoryLine, + VictoryChart, + VictoryTheme, + VictoryZoomContainer, + VictoryArea, + VictoryAxis, +} from "victory-native"; import { Colours, Styles } from "../styles"; const yellow = ["#FFFFB7", "#FFF192", "#FFEA61", "#FFDD3C", "#FFD400"]; -const months = [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December", -]; +const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; const data = [ - { quarter: 1, earnings: 13000 }, - { quarter: 2, earnings: 16500 }, - { quarter: 3, earnings: 14250 }, - { quarter: 4, earnings: 19000 }, + { month: 1, volume: 0 }, + { month: 2, volume: 3 }, + { month: 3, volume: 2.5 }, + { month: 4, volume: 1 }, + { month: 5, volume: 2 }, + { month: 6, volume: 3 }, + { month: 7, volume: 2.5 }, + { month: 8, volume: 1 }, ]; export default function LogChart() { return ( - - + } + > + + data.volume} + /> + {/* Y AXIS */} + (tick == 1 ? Colours.errorRed : Colours.lightBlue) }, + ticks: { stroke: "grey", size: 5 }, + tickLabels: { ...Styles.body }, + // tickLabels: { fontSize: 14, padding: 5 }, + }} + maxDomain={{ x: 31 }} + /> + {/* X AXIS */} + (tick == 1 ? Colours.errorRed : Colours.lightBlue) }, + ticks: { stroke: "grey", size: 5 }, + tickLabels: { ...Styles.body }, + // tickLabels: { fontSize: 14, padding: 5 }, + }} + // scale={{ x: "time" }} + minDomain={{ x: 0 }} + maxDomain={{ x: 31 }} + tickFormat={(month) => months[month - 1]} + /> ); @@ -38,9 +94,10 @@ export default function LogChart() { const styles = StyleSheet.create({ graphBox: { - marginTop: Platform.OS == "ios" ? "5%" : "10%", + // marginTop: Platform.OS == "ios" ? "5%" : "10%", justifyContent: "center", alignContent: "center", flex: 1, + backgroundColor: Colours.medBlue, }, }); From 69f8b8901e749d2ed31bcff0e7f430dd9de1b451 Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Thu, 11 Mar 2021 01:28:31 -0700 Subject: [PATCH 11/21] SCROLLING WORKS LMAO ITS JUST ZOOMDOMAIN OMG --- client/components/LogChart.tsx | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/client/components/LogChart.tsx b/client/components/LogChart.tsx index e558809..7844534 100644 --- a/client/components/LogChart.tsx +++ b/client/components/LogChart.tsx @@ -8,6 +8,7 @@ import { VictoryZoomContainer, VictoryArea, VictoryAxis, + VictoryClipContainer, } from "victory-native"; import { Colours, Styles } from "../styles"; @@ -30,21 +31,32 @@ export default function LogChart() { } + maxDomain={{ x: 100, y: 5 }} + containerComponent={ + + } > (tick == 1 ? Colours.errorRed : Colours.lightBlue) }, ticks: { stroke: "grey", size: 5 }, tickLabels: { ...Styles.body }, - // tickLabels: { fontSize: 14, padding: 5 }, }} - maxDomain={{ x: 31 }} + maxDomain={{ x: 12 }} /> {/* X AXIS */} (tick == 1 ? Colours.errorRed : Colours.lightBlue) }, ticks: { stroke: "grey", size: 5 }, tickLabels: { ...Styles.body }, - // tickLabels: { fontSize: 14, padding: 5 }, }} - // scale={{ x: "time" }} minDomain={{ x: 0 }} maxDomain={{ x: 31 }} tickFormat={(month) => months[month - 1]} @@ -98,6 +107,7 @@ const styles = StyleSheet.create({ justifyContent: "center", alignContent: "center", flex: 1, + // COMMENT OUT LATER backgroundColor: Colours.medBlue, }, }); From 920843144ef49cbc917264902f4d29bdb1641744 Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Sat, 20 Mar 2021 14:22:14 -0600 Subject: [PATCH 12/21] poop blobs yeet --- 500.html | 458 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 458 insertions(+) create mode 100644 500.html diff --git a/500.html b/500.html new file mode 100644 index 0000000..1ab078f --- /dev/null +++ b/500.html @@ -0,0 +1,458 @@ + + + + We're sorry, but something went wrong (500) + + + + + + + +
+

We're sorry, but we're just too thyck.

+ + + + +
+ + + + + + From 3d966c06a985ed3c60ea469cba183d3fa3783023 Mon Sep 17 00:00:00 2001 From: Charles Ancheta <55412395+cbebe@users.noreply.github.com> Date: Sat, 20 Mar 2021 14:28:04 -0600 Subject: [PATCH 13/21] ignore config --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 559944b..4156db2 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,6 @@ dist .env users.json + +# config +config.ts From f79d783d30305310a759eae62d802e7486250611 Mon Sep 17 00:00:00 2001 From: Charles Ancheta <55412395+cbebe@users.noreply.github.com> Date: Sat, 20 Mar 2021 15:06:07 -0600 Subject: [PATCH 14/21] remove 500 page --- 500.html | 458 ------------------------------------------------------- 1 file changed, 458 deletions(-) delete mode 100644 500.html diff --git a/500.html b/500.html deleted file mode 100644 index 1ab078f..0000000 --- a/500.html +++ /dev/null @@ -1,458 +0,0 @@ - - - - We're sorry, but something went wrong (500) - - - - - - - -
-

We're sorry, but we're just too thyck.

- - - - -
- - - - - - From 0d930bf82360b29e4b9eac173b39070281ed72ff Mon Sep 17 00:00:00 2001 From: Will Chorkawy Date: Sat, 20 Mar 2021 16:52:00 -0600 Subject: [PATCH 15/21] temporary logChart screen --- client/components/LogChart.tsx | 10 ++++++++-- client/components/Navigator.tsx | 4 +--- client/components/screens/CalenderScreen.tsx | 7 +++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/client/components/LogChart.tsx b/client/components/LogChart.tsx index 7844534..a4198f4 100644 --- a/client/components/LogChart.tsx +++ b/client/components/LogChart.tsx @@ -10,6 +10,8 @@ import { VictoryAxis, VictoryClipContainer, } from "victory-native"; +import { TouchableOpacity } from "react-native-gesture-handler"; +import ScreenProps from "./screens/ScreenProps"; import { Colours, Styles } from "../styles"; @@ -26,11 +28,12 @@ const data = [ { month: 8, volume: 1 }, ]; -export default function LogChart() { +export default function LogChart({ navigation }: ScreenProps) { return ( months[month - 1]} /> + navigation.navigate("Calender")}> + calender screen + ); } diff --git a/client/components/Navigator.tsx b/client/components/Navigator.tsx index c973dd0..6f24611 100644 --- a/client/components/Navigator.tsx +++ b/client/components/Navigator.tsx @@ -50,9 +50,6 @@ import { const screens = [ // Uncomment this when making functions - // { name: "Calender", component: Calender, disable: true }, - { name: "LogChart", component: LogChart, disable: true }, - // { name: "Reminder", component: Reminder, disable: false }, { name: "Start", component: Start, disable: true }, { name: "SignIn", component: SignIn, disable: false }, { name: "Register", component: Register, disable: false }, @@ -68,6 +65,7 @@ const screens = [ { name: "LogWater", component: LogWater, disable: true }, { name: "WaterLog", component: WaterLog, disable: true }, { name: "AddCupModal", component: AddCupModal, disable: false }, + { name: "LogChart", component: LogChart, disable: true }, ]; export default function Navigator() { diff --git a/client/components/screens/CalenderScreen.tsx b/client/components/screens/CalenderScreen.tsx index 42bb4f2..1b44b2b 100644 --- a/client/components/screens/CalenderScreen.tsx +++ b/client/components/screens/CalenderScreen.tsx @@ -8,6 +8,8 @@ import BottomNavbar from "../BottomNavbar"; import SafeGradient from "../SafeGradient"; import ScreenProps from "./ScreenProps"; +import { TouchableOpacity } from "react-native-gesture-handler"; +import LogChart from "../LogChart"; export default function CalendarScreen({ navigation }: ScreenProps) { return ( @@ -34,6 +36,11 @@ export default function CalendarScreen({ navigation }: ScreenProps) {
+ navigation.navigate("LogChart")} + > + Log chart +
From 37b85a4c5bf99f30b82372ed63346bc71f36b354 Mon Sep 17 00:00:00 2001 From: Will Chorkawy Date: Sat, 20 Mar 2021 17:36:00 -0600 Subject: [PATCH 16/21] more tips --- client/components/TipsModal.tsx | 18 +----------------- client/components/tips.ts | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 client/components/tips.ts diff --git a/client/components/TipsModal.tsx b/client/components/TipsModal.tsx index aed5d3b..40983cc 100644 --- a/client/components/TipsModal.tsx +++ b/client/components/TipsModal.tsx @@ -4,24 +4,8 @@ import { TouchableOpacity } from "react-native-gesture-handler"; import { TipsIcon, TransparentBackground } from "../assets/index"; import { Colours, Styles } from "../styles"; +import { tips } from "./tips"; -const tips = [ - "If you see a bathroom in a dream - DON'T USE IT!", - "When you smell pee in the streets, you can tell that urine the wrong neighbourhood.", - "Why can't you hear a pterodactyl pee? Because they're extinct.", - 'Wife: "I just got stung by a jellyfish. quick, pee on it!"\nHusband: *peeing on jellyfish* "This is for stinging my wife." ', - "Don't pee on anyone, or else they're going to be pissed.", - - // THESE ARE ACTUAL HEALTH TIPS LOL - "Water composes 75% of the human brain!", - "Water helps regulate your body temperature", - "Water makes up 75% of your muscles", - "Using a straw makes you drink faster! Invest in a reusable straw to reduce waste.", - "Spice up your water by adding fresh fruit, vegetables, or herbs. Try cucumers + mint!", - "If you have a headache, it might be from dehydration. Try drinking water!", - "Drinking water leads to healthier skin. Get that glow on!", - "Drinking water helps you lose weight.", -]; const rand = () => Math.floor(Math.random() * tips.length); export default function TipsModal() { diff --git a/client/components/tips.ts b/client/components/tips.ts new file mode 100644 index 0000000..6183ea5 --- /dev/null +++ b/client/components/tips.ts @@ -0,0 +1,27 @@ +export const tips = [ + "If you see a bathroom in a dream - DON'T USE IT!", + "When you smell pee in the streets, you can tell that urine the wrong neighbourhood.", + "Why can't you hear a pterodactyl pee? Because they're extinct.", + 'Wife: "I just got stung by a jellyfish. quick, pee on it!"\nHusband: *peeing on jellyfish* "This is for stinging my wife." ', + "Don't pee on anyone, or else they're going to be pissed.", + "Cucumbers are 95% water but water is 0% cucumber", + "Happiness is like peeing your pants - I haven't experienced it since I was 8 " + String.fromCodePoint(0x1f60e), + "Drinking water is important for all athletes. Don't believe me? Google \"Water sports\" to find out more!" + String.fromCodePoint(0x1F926), + "\"Waterboarding at Guantanamo Bay\" isn't the family friendly vacation I thought it was " + String.fromCodePoint(0x1f926), + "" + String.fromCodePoint(0x1f4a6), + "The average person loses 500 mL of water a day from crying", + // THESE ARE ACTUAL HEALTH TIPS LOL + "Water composes 75% of the human brain!", + "Water helps regulate your body temperature", + "Water makes up 75% of your muscles", + // reeeeeee + //"Using a straw makes you drink faster! Invest in a reusable straw to reduce waste.", + "Spice up your water by adding fresh fruit, vegetables, or herbs. Try cucumers + mint!", + "If you have a headache, it might be from dehydration. Try drinking water!", + "Drinking water leads to healthier skin. Get that glow on!", + "Drinking water helps you lose weight.", + "For most people, about 20% of their water intake is from food", + "Not all water has to be drinken. Look to water rich foods such as cucumber (95% water)", + "Drinking too much water can also be harmful, it is called overhydration" + ] + From 587e840aa9a0e074c84578f692660b5f61d7d928 Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Sat, 20 Mar 2021 23:10:43 -0600 Subject: [PATCH 17/21] wjat Co-authored-by: William Chorkawy --- client/components/LogChart.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/components/LogChart.tsx b/client/components/LogChart.tsx index 7844534..d295db6 100644 --- a/client/components/LogChart.tsx +++ b/client/components/LogChart.tsx @@ -15,6 +15,8 @@ import { Colours, Styles } from "../styles"; const yellow = ["#FFFFB7", "#FFF192", "#FFEA61", "#FFDD3C", "#FFD400"]; const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + +// Replace this data with stuff from the database const data = [ { month: 1, volume: 0 }, { month: 2, volume: 3 }, From 484f908c6380d4cbcf159eb5d0b92fe9efae4563 Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Sat, 20 Mar 2021 23:14:59 -0600 Subject: [PATCH 18/21] what the heck --- client/components/LogChart.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/components/LogChart.tsx b/client/components/LogChart.tsx index 7844534..f50b556 100644 --- a/client/components/LogChart.tsx +++ b/client/components/LogChart.tsx @@ -30,7 +30,8 @@ export default function LogChart() { return ( Date: Sun, 21 Mar 2021 00:12:45 -0600 Subject: [PATCH 19/21] put pretty graph into calendar screen Co-authored-by: William Chorkawy --- client/components/CalendAr.tsx | 20 ++++++------ client/components/LogChart.tsx | 33 +++++++++++++------- client/components/screens/CalenderScreen.tsx | 12 +++---- 3 files changed, 38 insertions(+), 27 deletions(-) diff --git a/client/components/CalendAr.tsx b/client/components/CalendAr.tsx index 9668bcd..d950b70 100644 --- a/client/components/CalendAr.tsx +++ b/client/components/CalendAr.tsx @@ -1,6 +1,6 @@ import React, { useState } from "react"; import { View, Text, StyleSheet, Platform } from "react-native"; -import { Calendar } from "react-native-calendars"; +import { Calendar, DateObject } from "react-native-calendars"; import { Colours, Styles } from "../styles"; @@ -58,13 +58,18 @@ const createMarkedDates = (start: Date, end: Date) => { }; interface CalendArProps { - // props: string; - // day: Date; - // month: Date; + day: string; } -export default function CalendAr({}: CalendArProps) { +export default function CalendAr({ day }: CalendArProps) { const [selectedDay, setSelectedDay] = useState(""); + + function dayPressHandler(day: DateObject) { + setSelectedDay(months[day.month - 1] + " " + day.day + ", " + day.year); + console.log(selectedDay); + return selectedDay; + } + return ( { - setSelectedDay(months[day.month - 1] + " " + day.day + ", " + day.year); - console.log(selectedDay); - }} + onDayPress={(day) => dayPressHandler(day)} onMonthChange={(month) => { // Grab the month data or something // console.log("month changed", month); diff --git a/client/components/LogChart.tsx b/client/components/LogChart.tsx index 29ee710..6c298ce 100644 --- a/client/components/LogChart.tsx +++ b/client/components/LogChart.tsx @@ -10,8 +10,6 @@ import { VictoryAxis, VictoryClipContainer, } from "victory-native"; -import { TouchableOpacity } from "react-native-gesture-handler"; -import ScreenProps from "./screens/ScreenProps"; import { Colours, Styles } from "../styles"; @@ -30,12 +28,16 @@ const data = [ { month: 8, volume: 1 }, ]; -export default function LogChart({ navigation }: ScreenProps) { +export default function LogChart() { return ( + + Water Chart + Scroll to the side for more info + } > + {/* LINE INTERPOLATION BETWEEN DATA POINTS PLOT */} + + {/* DATA POINTS PLOT */} data.volume} /> + {/* Y AXIS */} (tick == 1 ? Colours.errorRed : Colours.lightBlue) }, ticks: { stroke: "grey", size: 5 }, tickLabels: { ...Styles.body }, }} maxDomain={{ x: 12 }} /> + {/* X AXIS */} months[month - 1]} /> - navigation.navigate("Calender")}> - calender screen - ); } const styles = StyleSheet.create({ graphBox: { - // marginTop: Platform.OS == "ios" ? "5%" : "10%", + marginTop: "5%", justifyContent: "center", alignContent: "center", flex: 1, - // COMMENT OUT LATER - backgroundColor: Colours.medBlue, + // borderWidth: 1, + }, + headerText: { + paddingLeft: "5%", + color: Colours.yellow, + }, + infoText: { + paddingLeft: "5%", + color: Colours.lightBlue, }, }); diff --git a/client/components/screens/CalenderScreen.tsx b/client/components/screens/CalenderScreen.tsx index 1b44b2b..966451a 100644 --- a/client/components/screens/CalenderScreen.tsx +++ b/client/components/screens/CalenderScreen.tsx @@ -1,6 +1,7 @@ import React, { useEffect, useState } from "react"; import { Text, StyleSheet, View, Platform, ScrollView } from "react-native"; import CalendAr from "../CalendAr"; +import LogChart from "../LogChart"; import { Colours, Styles } from "../../styles"; @@ -8,10 +9,10 @@ import BottomNavbar from "../BottomNavbar"; import SafeGradient from "../SafeGradient"; import ScreenProps from "./ScreenProps"; -import { TouchableOpacity } from "react-native-gesture-handler"; -import LogChart from "../LogChart"; export default function CalendarScreen({ navigation }: ScreenProps) { + const [selectedDay, setSelectedDay] = useState(""); + return ( @@ -22,6 +23,7 @@ export default function CalendarScreen({ navigation }: ScreenProps) { selectedDay + {selectedDay} {/* Like rn, the calendar component returns a string :/ */} @@ -36,11 +38,7 @@ export default function CalendarScreen({ navigation }: ScreenProps) { - navigation.navigate("LogChart")} - > - Log chart - + From 22682bd7eebb7577123d265f3d874d29dc522195 Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Sun, 21 Mar 2021 21:50:10 -0600 Subject: [PATCH 20/21] tips --- client/components/tips.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/components/tips.ts b/client/components/tips.ts index 6183ea5..8fb5391 100644 --- a/client/components/tips.ts +++ b/client/components/tips.ts @@ -8,14 +8,13 @@ export const tips = [ "Happiness is like peeing your pants - I haven't experienced it since I was 8 " + String.fromCodePoint(0x1f60e), "Drinking water is important for all athletes. Don't believe me? Google \"Water sports\" to find out more!" + String.fromCodePoint(0x1F926), "\"Waterboarding at Guantanamo Bay\" isn't the family friendly vacation I thought it was " + String.fromCodePoint(0x1f926), - "" + String.fromCodePoint(0x1f4a6), + String.fromCodePoint(0x1f4a6), "The average person loses 500 mL of water a day from crying", + // THESE ARE ACTUAL HEALTH TIPS LOL "Water composes 75% of the human brain!", "Water helps regulate your body temperature", "Water makes up 75% of your muscles", - // reeeeeee - //"Using a straw makes you drink faster! Invest in a reusable straw to reduce waste.", "Spice up your water by adding fresh fruit, vegetables, or herbs. Try cucumers + mint!", "If you have a headache, it might be from dehydration. Try drinking water!", "Drinking water leads to healthier skin. Get that glow on!", From 0d4c791d047f6313a8d16c80c7941d704a9f4ffe Mon Sep 17 00:00:00 2001 From: Annette Lau Date: Tue, 4 May 2021 00:03:37 -0600 Subject: [PATCH 21/21] peepeepoopoo (charles did the selected color) --- client/components/CalendAr.tsx | 87 +++++++++++++++++--- client/components/screens/CalenderScreen.tsx | 10 +-- 2 files changed, 77 insertions(+), 20 deletions(-) diff --git a/client/components/CalendAr.tsx b/client/components/CalendAr.tsx index d950b70..c7ec523 100644 --- a/client/components/CalendAr.tsx +++ b/client/components/CalendAr.tsx @@ -1,9 +1,21 @@ -import React, { useState } from "react"; +import React, { useState, useEffect } from "react"; import { View, Text, StyleSheet, Platform } from "react-native"; import { Calendar, DateObject } from "react-native-calendars"; +import { DayOfWeek } from "react-native-windows"; import { Colours, Styles } from "../styles"; +class EDate extends Date { + isGreaterThan(date: Date) { + return this.getTime() >= date.getTime(); + } + + // end > current date > start + inRangeOf(start: Date, end: Date) { + return new EDate(end).isGreaterThan(this) && this.isGreaterThan(start); + } +} + const yellow = ["#FFFFB7", "#FFF192", "#FFEA61", "#FFDD3C", "#FFD400"]; const months = [ "January", @@ -20,8 +32,26 @@ const months = [ "December", ]; +/** + * Converts a Date object to Year-Month-Day string. + * Ex. Mon May 03 2021 22:18:20 GMT-0600 => 2021-05-03 + * @param date + * @returns + */ const dateToYMD = (date: Date) => date.toISOString().slice(0, 10); +/** + * Converts a DateObject object to Month Day, Year string. + * @param day + * @returns + */ +const momentToMDY = (day: DateObject) => months[day.month - 1] + " " + day.day + ", " + day.year; + +const dateToMDY = (date: Date) => + months[date.getMonth()] + " " + date.getDate() + ", " + date.getFullYear(); + +const momentToDate = (day: DateObject) => new Date(day.year, day.month - 1, day.day); + const increaseDate = (date: Date) => new Date(new Date(date).setDate(date.getDate() + 1)); const createDateRange = (start: Date, end: Date) => { @@ -37,39 +67,65 @@ interface MarkedDate { startingDay?: boolean; endingDay?: boolean; selected?: boolean; - color: string; - textColor: string; + selectedColor?: string; + color?: string; + textColor?: string; }; } -const createMarkedDates = (start: Date, end: Date) => { +const createMarkedDates = (start: Date, end: Date, selected: Date) => { const startStr = dateToYMD(start); const endStr = dateToYMD(end); const selectedStr = createDateRange(start, end).map((d) => dateToYMD(d)); const markedDates: MarkedDate = { - [startStr]: { startingDay: true, color: yellow[0], textColor: Colours.darkBlue }, + [startStr]: { + startingDay: true, + endingDay: false, + color: yellow[0], + textColor: Colours.darkBlue, + }, }; selectedStr.forEach((dateStr) => { markedDates[dateStr] = { selected: true, color: yellow[0], textColor: Colours.darkBlue }; }); - markedDates[endStr] = { endingDay: true, color: yellow[0], textColor: Colours.darkBlue }; + markedDates[endStr] = { + endingDay: true, + startingDay: false, + color: yellow[0], + textColor: Colours.darkBlue, + }; + + const isInRange = new EDate(selected).inRangeOf(start, end); + markedDates[dateToYMD(selected)] = { + startingDay: !isInRange, + endingDay: !isInRange, + ...markedDates[dateToYMD(selected)], + selected: true, + textColor: Colours.yellow, + color: "#ff7171", + }; return markedDates; }; interface CalendArProps { - day: string; + setSelectedDay: React.Dispatch>; } -export default function CalendAr({ day }: CalendArProps) { - const [selectedDay, setSelectedDay] = useState(""); +export default function CalendAr({ setSelectedDay }: CalendArProps) { + useEffect(() => { + const today = dateToMDY(new Date()); + setSelectedDay(today); + }, []); function dayPressHandler(day: DateObject) { - setSelectedDay(months[day.month - 1] + " " + day.day + ", " + day.year); - console.log(selectedDay); - return selectedDay; + const thisDay = momentToMDY(day); + setSelectedDay(thisDay); + setSelectedDate(momentToDate(day)); } + const [selectedDate, setSelectedDate] = useState(new Date()); + return ( - + - - selectedDay - {selectedDay} - {/* Like rn, the calendar component returns a string :/ */} - + {selectedDay} @@ -38,7 +34,7 @@ export default function CalendarScreen({ navigation }: ScreenProps) { - + {/* */}