From a9923fae9ff43cd3e3de7eeeb58806e2d35827f8 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Fri, 30 Nov 2018 11:24:28 +0100 Subject: [PATCH 01/17] Use icon font for home icons --- .../main/assets/fonts/drip-home-icon-font.ttf | Bin 0 -> 5600 bytes .../src/main/assets/fonts/drip-home-icons.ttf | Bin 0 -> 5532 bytes assets/drip-home-icons.js | 4 ++ assets/drip-icons.js | 2 +- assets/fonts/config-drip-home-icons.json | 38 ++++++++++++++++++ ...config.json => config-drip-icon-font.json} | 0 assets/fonts/drip-home-icons.ttf | Bin 0 -> 5532 bytes assets/home-circle.js | 15 ------- assets/home-drop.js | 14 ------- components/chart/chart.js | 17 +++----- components/home.js | 16 ++------ ios/drip.xcodeproj/project.pbxproj | 20 ++++++--- ios/drip/Info.plist | 2 + styles/index.js | 2 +- 14 files changed, 69 insertions(+), 61 deletions(-) create mode 100644 android/app/src/main/assets/fonts/drip-home-icon-font.ttf create mode 100644 android/app/src/main/assets/fonts/drip-home-icons.ttf create mode 100644 assets/drip-home-icons.js create mode 100644 assets/fonts/config-drip-home-icons.json rename assets/fonts/{config.json => config-drip-icon-font.json} (100%) create mode 100644 assets/fonts/drip-home-icons.ttf delete mode 100644 assets/home-circle.js delete mode 100644 assets/home-drop.js diff --git a/android/app/src/main/assets/fonts/drip-home-icon-font.ttf b/android/app/src/main/assets/fonts/drip-home-icon-font.ttf new file mode 100644 index 0000000000000000000000000000000000000000..3c7621a677e16fbb3f65109579c2a109d47dd43f GIT binary patch literal 5600 zcmd^DTWnlM8UE*-y?NKS__9vDxy<_5j^jPMwv*U#6UT9Oy>@PG9NTes)27*z_4PRtO34Mga-RLuZo~m0nQbsX{!!6Cfer0i--2(FYJzMKRxhcJ16; zTJ@E)yJx=tGBf{t^Ur^dO@fH(=mzPO8=pECl`nT(hvq-{O`nTpknP0v( z_u+4|e<#wrh_veq8Edw2`8zj=oZp9iU;zsEIsIA4e}LS+uu{0{U0?s0$OVzAm$PY$ z-V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)&@@}Oio929JHP^ZxI~>I0YaW zoHlO>Tk{lvt$CV#qA;Cd9|jZb!{99YFqmYYVSp+2VKB`;49>9+gBkW20eFUe7$n$- zL6UtKoM)dHz_aYb;5qhTaDjaoJkLHy0WPu+gB1HPu-J#eB~u;Tq&dxkIt=x!jfQ|S zc0NIU1j3xD1~xzxob=6ddHeItU*seJn zvFi&qV%NNRy9)olsJt0PL&}p;di%sxe$<2sFWDbV;sr!}14X&~TAeGAGm6zyH-p<= zO?b+vmTcsTzN6iNxe8i$^c@;0W1U7z?c(NHyfxlTl=RurQYTCAcy8d2;*pzaygI=J ZFUQH-_?J|5_uFFqtIF|pJSawq{tICy>s9~& literal 0 HcmV?d00001 diff --git a/android/app/src/main/assets/fonts/drip-home-icons.ttf b/android/app/src/main/assets/fonts/drip-home-icons.ttf new file mode 100644 index 0000000000000000000000000000000000000000..586a697bdc42f7a6d81cb2250b2eca0b5db86c25 GIT binary patch literal 5532 zcmd^DTWlN06}_`dQq;qe^`acnmWN)8mc=C{$`&QtvMlofnX>%Z5s5EeiY3|fqu2 z@;d?Y+og8r+dD$whQa3rE=Zo!kW3jxnV3E6K5wNjUKqG7ym@o7n zi|gb>d@pF2iN02C#Rn7?8noopp?%1eoKNIv;wIe``t0pXbY7pO4bXVZ>V+|}N<=1Z z%qz~;Y)NRDWuk4c^$yx=a~!O{DQ+W&H;JE+s~*D>VJ8i`|L3d84j$ELU&soI$-b+Z zR#V)IZh}w3{x__}h`~4qe1&)ZS!jqKSl{lm=>(nD$Pz0YNdx3X#G{;$(WF zQP2(#?G`(AXGcKvh+QJwQD?XY#Gc`i@NhUJ_J#c|V$VKf_(0@<^Ps2eknnWjSLdn= zJNEfu9T4MUBr*~i>h!o+>*@;IjFE5ze|~U=!SRnA5)skT-l++pY4~ext8cvk#Nt_9 z`{HDVyf?^s953pIoo>4c}OKqs?ertxWs&U`mI6;q`ORs4rgaGQR)Z8<+o> zI_S4Y(l+yWRd3bDC`7Z=GvN&hk>G5LIXjD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YdJ8+keX3jt=!nXQcfCEJQ=UnAvR(lkt4 zuh!~9Jy={BqqZ{eF{lpLJcw;BO@`mS_lLN-lt)ZMhB#}JICaO;p-Mn>VB?K#sj-@O z)JM0}HhZ({J)Ch<4F@(Y_Y8W>RFOa#HN?eI#&&#QVk}EY1u*}Foh~lG&Fpe<8Q2ve zY?7*v$8lKTfZnRq&3He(6sI0m7@wv3IB$Hej2WX|-(BnNOV@miaxylP8sqqVoOyP! z7ROe|afIAi-JE!pV;{DMR2X|P@d*7S&RWsYu7<#wGSxveCpc>f#X_L!Q zoj_V2H}Ri3#{p&l1cQ_2hOjkH0N9!*nG=QSDdsRpGKaw_<}jFL&N#qn<}jFJ4udny zVQ`i?69DI!!yv^R25IInIM19Iz|+iO@Hyr%c!oI)KF^$E02i3UAj2F67IPR}G}Xvf znzJmZBT(mTGzOHn>j~cTY{b-6 zQyt!-uCZWK3pQfvb2egX(Y#Ub&^Et}q5&M>VHSv{<3m>9WRPF(f - - - - ) -} \ No newline at end of file diff --git a/assets/home-drop.js b/assets/home-drop.js deleted file mode 100644 index 6bde404..0000000 --- a/assets/home-drop.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react' -import { Surface, Group as G, Shape, Transform } from 'react-native/Libraries/ART/ReactNativeART' - -export default function HomeDropIcon(props) { - return ( - - - - - - ) -} diff --git a/components/chart/chart.js b/components/chart/chart.js index dc3be06..53ff3da 100644 --- a/components/chart/chart.js +++ b/components/chart/chart.js @@ -2,7 +2,6 @@ import React, { Component } from 'react' import { View, FlatList, ActivityIndicator } from 'react-native' import range from 'date-range' import { LocalDate } from 'js-joda' -import { Surface } from 'react-native/Libraries/ART/ReactNativeART' import { makeYAxisLabels, makeHorizontalGrid } from './y-axis' import nfpLines from './nfp-lines' import DayColumn from './day-column' @@ -13,7 +12,7 @@ import config from '../../config' import AppText from '../app-text' import { shared as labels } from '../../i18n/en/labels' import DripIcon from '../../assets/drip-icons' -import CycleDayIcon from '../../assets/home-circle' +import DripHomeIcon from '../../assets/drip-home-icons' import nothingChanged from '../../db/db-unchanged' const symptomIcons = { @@ -163,15 +162,11 @@ export default class CycleChart extends Component { {makeYAxisLabels(this.columnHeight)} - - - + - - - + @@ -107,7 +97,7 @@ export default class Home extends Component { style={styles.homeIconElement} > - + diff --git a/ios/drip.xcodeproj/project.pbxproj b/ios/drip.xcodeproj/project.pbxproj index 17b099d..f0cc598 100644 --- a/ios/drip.xcodeproj/project.pbxproj +++ b/ios/drip.xcodeproj/project.pbxproj @@ -69,6 +69,8 @@ F165D5E4692041AD900573C8 /* Prompt-Thin.ttf in Resources */ = {isa = PBXBuildFile; fileRef = CB2405AD4098483C85C1A261 /* Prompt-Thin.ttf */; }; BF3587E45FCA48DEA13183A1 /* fontello.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BB0CB875BB2749F4A46AA5F1 /* fontello.ttf */; }; BBD61F152BE74DD7AED99DFB /* drip-icon-font.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 05154E9AE0EA4BE19F3D9E0B /* drip-icon-font.ttf */; }; + DAA390B1EE7442D88A768596 /* drip-home-icon-font.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 94973D7B7BBA4B0FBE713A0E /* drip-home-icon-font.ttf */; }; + BA7CE1E95B7843D7B0CF85FF /* drip-home-icons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 887F1D52A4684A5280CB79AA /* drip-home-icons.ttf */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -412,6 +414,8 @@ CB2405AD4098483C85C1A261 /* Prompt-Thin.ttf */ = {isa = PBXFileReference; name = "Prompt-Thin.ttf"; path = "../assets/fonts/Prompt-Thin.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; BB0CB875BB2749F4A46AA5F1 /* fontello.ttf */ = {isa = PBXFileReference; name = "fontello.ttf"; path = "../assets/fonts/fontello.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; 05154E9AE0EA4BE19F3D9E0B /* drip-icon-font.ttf */ = {isa = PBXFileReference; name = "drip-icon-font.ttf"; path = "../assets/fonts/drip-icon-font.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; + 94973D7B7BBA4B0FBE713A0E /* drip-home-icon-font.ttf */ = {isa = PBXFileReference; name = "drip-home-icon-font.ttf"; path = "../assets/fonts/drip-home-icon-font.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; + 887F1D52A4684A5280CB79AA /* drip-home-icons.ttf */ = {isa = PBXFileReference; name = "drip-home-icons.ttf"; path = "../assets/fonts/drip-home-icons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -720,6 +724,8 @@ CB2405AD4098483C85C1A261 /* Prompt-Thin.ttf */, BB0CB875BB2749F4A46AA5F1 /* fontello.ttf */, 05154E9AE0EA4BE19F3D9E0B /* drip-icon-font.ttf */, + 94973D7B7BBA4B0FBE713A0E /* drip-home-icon-font.ttf */, + 887F1D52A4684A5280CB79AA /* drip-home-icons.ttf */, ); name = Resources; sourceTree = ""; @@ -755,9 +761,9 @@ 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 2B572382D4504B8FB4B9D251 /* Embed Frameworks */, - F64994825D454BDD8D73467F /* Build NodeJS Mobile Native Modules */, - E01FA74D87244C06A5D9B389 /* Sign NodeJS Mobile Native Modules */, - 28C4AB8094CC4A7E8DE0E83B /* Remove NodeJS Mobile Framework Simulator Strips */, + 0909337B049F4ECB933412B2 /* Build NodeJS Mobile Native Modules */, + B6AAD324BDBA4E92AB5627B3 /* Sign NodeJS Mobile Native Modules */, + 3DE3CFA1BEC54E9D9B5B9D47 /* Remove NodeJS Mobile Framework Simulator Strips */, ); buildRules = ( ); @@ -1196,6 +1202,8 @@ F165D5E4692041AD900573C8 /* Prompt-Thin.ttf in Resources */, BF3587E45FCA48DEA13183A1 /* fontello.ttf in Resources */, BBD61F152BE74DD7AED99DFB /* drip-icon-font.ttf in Resources */, + DAA390B1EE7442D88A768596 /* drip-home-icon-font.ttf in Resources */, + BA7CE1E95B7843D7B0CF85FF /* drip-home-icons.ttf in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1245,7 +1253,7 @@ shellPath = /bin/sh; shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; }; - F64994825D454BDD8D73467F /* Build NodeJS Mobile Native Modules */ = { + 0909337B049F4ECB933412B2 /* Build NodeJS Mobile Native Modules */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -1313,7 +1321,7 @@ fi popd "; }; - E01FA74D87244C06A5D9B389 /* Sign NodeJS Mobile Native Modules */ = { + B6AAD324BDBA4E92AB5627B3 /* Sign NodeJS Mobile Native Modules */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -1373,7 +1381,7 @@ find \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -path \"*/*.framework/*\" -del find \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.framework\" -type d -delete "; }; - 28C4AB8094CC4A7E8DE0E83B /* Remove NodeJS Mobile Framework Simulator Strips */ = { + 3DE3CFA1BEC54E9D9B5B9D47 /* Remove NodeJS Mobile Framework Simulator Strips */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( diff --git a/ios/drip/Info.plist b/ios/drip/Info.plist index 31237d6..d44ff1b 100644 --- a/ios/drip/Info.plist +++ b/ios/drip/Info.plist @@ -72,6 +72,8 @@ Prompt-Thin.ttf fontello.ttf drip-icon-font.ttf + drip-home-icon-font.ttf + drip-home-icons.ttf diff --git a/styles/index.js b/styles/index.js index 78730f3..4023b20 100644 --- a/styles/index.js +++ b/styles/index.js @@ -110,7 +110,7 @@ export default StyleSheet.create({ }, homeCircle: { borderRadius: 100, - borderWidth: 1, + borderWidth: 0.7, width: 80, height: 80, alignItems: 'center', From 306aa9bfaf82a403350bcb4e3705d8bfb1673bdc Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Fri, 30 Nov 2018 12:06:52 +0100 Subject: [PATCH 02/17] Fix color --- components/chart/chart.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/chart/chart.js b/components/chart/chart.js index 53ff3da..dbe0edf 100644 --- a/components/chart/chart.js +++ b/components/chart/chart.js @@ -7,6 +7,7 @@ import nfpLines from './nfp-lines' import DayColumn from './day-column' import { getCycleDaysSortedByDate, getAmountOfCycleDays } from '../../db' import styles from './styles' +import { cycleDayColor } from '../../styles' import { scaleObservable } from '../../local-storage' import config from '../../config' import AppText from '../app-text' @@ -165,7 +166,7 @@ export default class CycleChart extends Component { Date: Sat, 1 Dec 2018 13:26:16 +0000 Subject: [PATCH 03/17] Update README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 82cbd64..54c6501 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,19 @@ A menstrual cycle tracking app that's open-source and leaves your data on your p 8. Run `adb shell input keyevent 82` and select enable hot reloading (see https://facebook.github.io/react-native/docs/debugging.html) 9. We recommend installing an [ESLint plugin in your editor](https://eslint.org/docs/user-guide/integrations#editors). There's an `.eslintrc` file in this project which will be used by the plugin to check your code for style errors and potential bugs. +## Java problems on macOS + +Make sure that you have Java 1.8 by running `java -version`. + +If you don't have Java installed, or your Java version is different, the app may not work. You can try just using Android Studio's Java by prepending it to your `$PATH` in your shell profile: + + ``` + export PATH="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin:${PATH}" + ``` + +Now, `which java` should output `/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java`, and the correct Java version should be used. + + ## Tests You can run the tests with `npm test`. From 57e77341c66fbd4ad9c1941d4ef2948e06722845 Mon Sep 17 00:00:00 2001 From: Sofiya Tepikin Date: Sat, 1 Dec 2018 15:59:39 +0100 Subject: [PATCH 04/17] Centers the Symptom header title --- components/header/symptom-view.js | 1 + styles/index.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/header/symptom-view.js b/components/header/symptom-view.js index df8b4be..3f6a21f 100644 --- a/components/header/symptom-view.js +++ b/components/header/symptom-view.js @@ -24,6 +24,7 @@ export default function SymptomViewHeader(props) { diff --git a/styles/index.js b/styles/index.js index 78730f3..59360e6 100644 --- a/styles/index.js +++ b/styles/index.js @@ -139,6 +139,10 @@ export default StyleSheet.create({ color: 'black', marginBottom: 5 }, + symptomInfoIcon: { + marginRight: 20, + marginLeft: 20 + }, symptomBoxImage: { width: 50, height: 50 @@ -199,9 +203,6 @@ export default StyleSheet.create({ flexDirection: 'row', justifyContent: 'space-between', }, - headerSymptom: { - paddingRight: 20 - }, navigationArrow: { padding: 20 }, From 0c22644c54b1d8e6125a3d3e9289848f6eaec0ca Mon Sep 17 00:00:00 2001 From: mashazyu Date: Sun, 2 Dec 2018 13:15:46 +0100 Subject: [PATCH 05/17] Extracts buttons on home screen as a component --- components/home.js | 51 ++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/components/home.js b/components/home.js index 8f794f4..52bc360 100644 --- a/components/home.js +++ b/components/home.js @@ -14,6 +14,19 @@ import styles from '../styles' import AppText, { AppTextLight } from './app-text' import nothingChanged from '../db/db-unchanged' +const HomeButton = ({ backgroundColor, children }) => { + return ( + + + {children} + + + ) +} + export default class Home extends Component { constructor(props) { super(props) @@ -92,14 +105,11 @@ export default class Home extends Component { { this.state.showMore && {cycleDayMoreText} } - - - {labels.editToday} - - + + + {labels.editToday} + + } - - - {labels.trackPeriod} - - + + + {labels.trackPeriod} + + } - - - {labels.checkFertility} - - + + + {labels.checkFertility} + From 1b5c637d4ea7cc1e2c79e878fe1ccc4f8148309b Mon Sep 17 00:00:00 2001 From: mashazyu Date: Sun, 2 Dec 2018 13:52:17 +0100 Subject: [PATCH 06/17] Fixes fertility icon space --- components/home.js | 5 ++++- styles/index.js | 10 +++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/components/home.js b/components/home.js index 52bc360..73e9591 100644 --- a/components/home.js +++ b/components/home.js @@ -141,7 +141,10 @@ export default class Home extends Component { onPress={() => this.props.navigate('Chart')} style={styles.homeIconElement} > - + + + + {this.state.phase ? this.state.phase.toString() diff --git a/styles/index.js b/styles/index.js index 59360e6..05489a5 100644 --- a/styles/index.js +++ b/styles/index.js @@ -100,13 +100,17 @@ export default StyleSheet.create({ marginBottom: 10, }, wrapperCycle: { - width: 70, - height: 75 + width: 80, + height: 77 }, wrapperDrop: { + width: 81, + height: 85, + marginTop: 20 + }, + wrapperCircle: { width: 80, height: 80, - marginTop: 20 }, homeCircle: { borderRadius: 100, From 96d2459777d8a3cb5718d65c08eed0efb332416a Mon Sep 17 00:00:00 2001 From: mashazyu Date: Sun, 2 Dec 2018 19:23:02 +0100 Subject: [PATCH 07/17] Changes header of today's cycle day overview page --- components/header/cycle-day.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/header/cycle-day.js b/components/header/cycle-day.js index a78cf1b..332b300 100644 --- a/components/header/cycle-day.js +++ b/components/header/cycle-day.js @@ -2,11 +2,18 @@ import React from 'react' import { View, Text} from 'react-native' +import { LocalDate } from 'js-joda' import moment from 'moment' import styles from '../../styles' import NavigationArrow from './navigation-arrow' -export default function CycleDayHeader(props) { +const FormattedDate = ({ date }) => { + const today = LocalDate.now() + const dateToDisplay = LocalDate.parse(date) + return today.equals(dateToDisplay) ? 'today' : moment(date).format('MMMM Do YYYY') +} + +export default function CycleDayHeader({ date, ...props }) { return ( - {moment(props.date).format('MMMM Do YYYY')} + {props.cycleDayNumber && From 9843fb015720149378e4d91c1a097e529f006c1a Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Mon, 3 Dec 2018 17:37:55 +0000 Subject: [PATCH 08/17] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ad12a50..a7b9468 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ A menstrual cycle tracking app that's open-source and leaves your data on your p cd drip ``` -1. Open Android Studio and click on "Open an existing Android Studio project". Navigate to the drip repository you cloned and double click the android folder. It detects, downloads and cofigures requirements that might be missing, like the NDK and CMake to build the native code part of the project. Also check out nodejs-mobile repository for the necessary prerequisites for your system. +1. Open Android Studio and click on "Open an existing Android Studio project". Navigate to the drip repository you cloned and double click the android folder. It detects, downloads and cofigures requirements that might be missing, like the NDK and CMake to build the native code part of the project. Also see the [nodejs-mobile repository](https://github.com/janeasystems/nodejs-mobile) for the necessary prerequisites for your system. 1. Either start a virtual device in Android Studio (or make sure it's already running, you should see a phone on your screen) or [set your physical device like your phone up](https://developer.android.com/training/basics/firstapp/running-app) to run the app. From 55acd26a39a54cb97504af8fa3e4b8136153283d Mon Sep 17 00:00:00 2001 From: mashazyu Date: Mon, 3 Dec 2018 19:19:05 +0100 Subject: [PATCH 09/17] Transforms labels to lowercase --- components/chart/chart.js | 2 +- components/cycle-day/cycle-day-overview.js | 2 +- components/cycle-day/symptoms/action-button-footer.js | 3 +-- components/header/cycle-day.js | 5 +++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/chart/chart.js b/components/chart/chart.js index dc3be06..6d7dff3 100644 --- a/components/chart/chart.js +++ b/components/chart/chart.js @@ -176,7 +176,7 @@ export default class CycleChart extends Component { styles.column.label.date, styles.yAxisLabels.dateLabel ]}> - {labels.date} + {labels.date.toLowerCase()} } diff --git a/components/cycle-day/cycle-day-overview.js b/components/cycle-day/cycle-day-overview.js index 92b8ac0..88de356 100644 --- a/components/cycle-day/cycle-day-overview.js +++ b/components/cycle-day/cycle-day-overview.js @@ -261,7 +261,7 @@ class SymptomBox extends Component { - {this.props.title} + {this.props.title.toLowerCase()} diff --git a/components/cycle-day/symptoms/action-button-footer.js b/components/cycle-day/symptoms/action-button-footer.js index 3458550..076b0bb 100644 --- a/components/cycle-day/symptoms/action-button-footer.js +++ b/components/cycle-day/symptoms/action-button-footer.js @@ -64,7 +64,6 @@ export default class ActionButtonFooter extends Component { ) : iconStyles.menuIcon - return ( - {title} + {title.toLowerCase()} ) diff --git a/components/header/cycle-day.js b/components/header/cycle-day.js index 332b300..b5dbbdf 100644 --- a/components/header/cycle-day.js +++ b/components/header/cycle-day.js @@ -10,7 +10,8 @@ import NavigationArrow from './navigation-arrow' const FormattedDate = ({ date }) => { const today = LocalDate.now() const dateToDisplay = LocalDate.parse(date) - return today.equals(dateToDisplay) ? 'today' : moment(date).format('MMMM Do YYYY') + const formattedDate = today.equals(dateToDisplay) ? 'today' : moment(date).format('MMMM Do YYYY') + return formattedDate.toLowerCase() } export default function CycleDayHeader({ date, ...props }) { @@ -26,7 +27,7 @@ export default function CycleDayHeader({ date, ...props }) { {props.cycleDayNumber && - Cycle day {props.cycleDayNumber} + {`Cycle day ${props.cycleDayNumber}`.toLowerCase()} } From 735b89ef9b558c5c85f3396be7d6f22d48dcb870 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Tue, 4 Dec 2018 10:46:33 +0000 Subject: [PATCH 10/17] Update CONTRIBUTING.md --- CONTRIBUTING.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e5651b7..a78d9d1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,25 +14,25 @@ So good to see you here, hello :wave\_tone1: :wave\_tone2: :wave\_tone3: :wave\_ ## TL;DR -You just want to say hello? Send us a [nice email](mailto:bl00dyhealth@mailbox.org?Subject=Nice%20incoming%20mail) :postbox: or tweet :bird: at us @bl00dyhealth. +You just want to say hello? Send us a [nice email](mailto:bl00dyhealth@mailbox.org?Subject=Nice%20incoming%20mail) :postbox: or tweet :bird: at us [@bl00dyhealth](https://twitter.com/bl00dyhealth). ## What should I know before I get started? We have prepared something for **you**: check out our [README](https://gitlab.com/bloodyhealth/drip/blob/master/README.md) for more information on how to set up and install everything you'll need. [Ping us](mailto:bl00dyhealth@mailbox.org) if you could need some help :helmet\_with\_cross: ! -Let us know if you want to suggest improvements for the README. +Let us know if you want to suggest improvements for the README and open a merge request (which is just like Github's pull request) ## How can I contribute? ### Your First Code Contribution We are fans of labels, at least for our issues. You can find a list of `newbie` issues [here](https://gitlab.com/bloodyhealth/drip/issues?label_name%5B%5D=Newbie). -If you decide to work on an issue, please create a branch based on that issue. -This allows us to keep track of the issues that are related to an existing branch, which tells everyone "somebody's on it". +If you decide to work on an issue, please click on `Create branch` based on that issue. You can find this as a dropdown option right under `Create merge request`. +This allows us to keep track of the issues that are related to an existing branch and tells everyone "somebody is working on it". If you want to open a merge request, yeah :tada: exciting! We are using a template for merge requests to make sure we explain what we have done and why. -Keep in mind that people who will review your merge request are more motivated to do so when the merge request is well explained. +Keep in mind that people who will review your merge request are more motivated to do so when the merge request is well explained and ideally not too big. ### Reporting Bugs From d39d59c3a30985cd864cb2fea0fac1880481fb25 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Tue, 4 Dec 2018 10:50:02 +0000 Subject: [PATCH 11/17] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a78d9d1..695c101 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,7 +48,7 @@ Do you have suggestions for enhancing the app or for cleaning up some code? Fant Before creating a new issue, please review the [list of existing issues](https://gitlab.com/bloodyhealth/drip/issues) to make sure nobody else had the same idea before you! You are then invited to open a new issue with a somewhat extensive description, you can use emojis or GIFs if it helps :)! -To send us a new issue you can also use our gitlab email: incoming+bloodyhealth/drip@incoming.gitlab.com. It will automagically add a new issue to the list with a description text taken from the body of your email. +To send us a new issue you can also use our [gitlab email](mailto:incoming+bloodyhealth/drip@incoming.gitlab.com). It will automagically add a new issue to the list with the title taken from the subject line and the description text for the issue taken from the body of your email. ### Thank you From 2a7ffa4666aa4e815a387928b91b395caad16060 Mon Sep 17 00:00:00 2001 From: Sofiya Tepikin Date: Tue, 4 Dec 2018 22:52:49 +0100 Subject: [PATCH 12/17] Adds password confirmation on setting a new password on Settings screen --- components/settings/password/create.js | 132 ++++++++++++++---- .../settings/password/password-field.js | 2 +- i18n/en/settings.js | 3 + styles/index.js | 8 ++ 4 files changed, 116 insertions(+), 29 deletions(-) diff --git a/components/settings/password/create.js b/components/settings/password/create.js index 87bd2bf..68b7b2d 100644 --- a/components/settings/password/create.js +++ b/components/settings/password/create.js @@ -6,17 +6,35 @@ import { import nodejs from 'nodejs-mobile-react-native' import AppText from '../../app-text' import styles from '../../../styles' -import { settings as labels } from '../../../i18n/en/settings' +import { settings } from '../../../i18n/en/settings' import { requestHash, changeEncryptionAndRestartApp } from '../../../db' import PasswordField from './password-field' import showBackUpReminder from './show-backup-reminder' +const SettingsButton = ({ children, ...props }) => { + return ( + + + {children} + + + ) +} + export default class CreatePassword extends Component { constructor() { super() this.state = { - enteringNewPassword: false, - newPassword: null + isSettingPassword: false, + password: '', + passwordConfirmation: '', + shouldShowErrorMessage: false, } nodejs.channel.addListener( 'create-pw-hash', @@ -29,33 +47,91 @@ export default class CreatePassword extends Component { nodejs.channel.removeListener('create-pw-hash', changeEncryptionAndRestartApp) } + savePassword = () => { + if (this.comparePasswords()) { + requestHash('create-pw-hash', this.state.password) + } else { + this.setState({ + shouldShowErrorMessage: true + }) + } + } + + toggleSettingPassword = () => { + const { isSettingPassword } = this.state + this.setState({ isSettingPassword: !isSettingPassword }) + } + + startSettingPassword = () => { + showBackUpReminder(this.toggleSettingPassword) + } + + comparePasswords = () => { + return this.state.password === this.state.passwordConfirmation + } + + handlePasswordInput = (password) => { + this.setState({ password }) + } + + handleConfirmationInput = (passwordConfirmation) => { + const { password } = this.state + this.setState({ + passwordConfirmation, + isPasswordsMatch: passwordConfirmation === password + }) + } + render () { - return ( - - {this.state.enteringNewPassword && + const { + isSettingPassword, + password, + passwordConfirmation, + shouldShowErrorMessage, + } = this.state + const labels = settings.passwordSettings + + const isSaveButtonDisabled = + !password.length || + !passwordConfirmation.length + + if (!isSettingPassword) { + return ( + + + {labels.setPassword} + + + ) + } else { + return ( + this.setState({newPassword: val})} + placeholder={labels.enterNew} + value={password} + onChangeText={this.handlePasswordInput} /> - } - { - if (!this.state.enteringNewPassword) { - showBackUpReminder(() => { - this.setState({ enteringNewPassword: true }) - }) - } else { - requestHash('create-pw-hash', this.state.newPassword) - } - }} - disabled={this.state.enteringNewPassword && !this.state.newPassword} - style={styles.settingsButton}> - - {labels.passwordSettings.setPassword} - - - - ) + + { + shouldShowErrorMessage && + + {labels.passwordsDontMatch} + + } + + {labels.savePassword} + + + ) + } + } } \ No newline at end of file diff --git a/components/settings/password/password-field.js b/components/settings/password/password-field.js index 1757331..a62b435 100644 --- a/components/settings/password/password-field.js +++ b/components/settings/password/password-field.js @@ -6,7 +6,7 @@ export default function PasswordField(props) { return ( Date: Fri, 7 Dec 2018 12:33:10 +0000 Subject: [PATCH 13/17] adds windows problems; adds link to emulator --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a7b9468..b538d30 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Bloody Health Cycle Tracker -A menstrual cycle tracking app that's open-source and leaves your data on your phone. Use it to track your menstrual cycle or for fertility awareness! +A menstrual cycle tracking app that's open-source and leaves your data on your phone. Use it to track your menstrual cycle and/or for fertility awareness! ## Development setup 1. Install [Android Studio](https://developer.android.com/studio/) - you'll need it to install some dependencies. @@ -21,7 +21,7 @@ A menstrual cycle tracking app that's open-source and leaves your data on your p 1. Open Android Studio and click on "Open an existing Android Studio project". Navigate to the drip repository you cloned and double click the android folder. It detects, downloads and cofigures requirements that might be missing, like the NDK and CMake to build the native code part of the project. Also see the [nodejs-mobile repository](https://github.com/janeasystems/nodejs-mobile) for the necessary prerequisites for your system. -1. Either start a virtual device in Android Studio (or make sure it's already running, you should see a phone on your screen) or [set your physical device like your phone up](https://developer.android.com/training/basics/firstapp/running-app) to run the app. +1. Either start a [virtual device in Android Studio](https://developer.android.com/studio/run/emulator) or [set your physical device like your Android phone up](https://developer.android.com/training/basics/firstapp/running-app) to run the app. 1. Open a terminal in Android Studio and run `npm install` @@ -45,6 +45,9 @@ If you don't have Java installed, or your Java version is different, the app may Now, `which java` should output `/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java`, and the correct Java version should be used. +## Windows problems + +Unfortunately, the react native version we use doesn't work on Windows 10 it seems, find [more info here](https://github.com/facebook/react-native/issues/20015). ## Tests You can run the tests with `npm test`. From b23bd19270ba9900c35037fd4e39006c2d8b844c Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Fri, 7 Dec 2018 14:00:51 +0100 Subject: [PATCH 14/17] Add cervix setting --- components/settings/index.js | 2 ++ components/settings/use-cervix.js | 48 +++++++++++++++++++++++++++++++ i18n/en/settings.js | 5 ++++ local-storage/index.js | 11 +++++++ 4 files changed, 66 insertions(+) create mode 100644 components/settings/use-cervix.js diff --git a/components/settings/index.js b/components/settings/index.js index bfddbc7..b91acbc 100644 --- a/components/settings/index.js +++ b/components/settings/index.js @@ -13,6 +13,7 @@ import TempSlider from './temp-slider' import openImportDialogAndImport from './import-dialog' import openShareDialogAndExport from './export-dialog' import PasswordSetting from './password' +import UseCervixSetting from './use-cervix' export default class Settings extends Component { constructor(props) { @@ -24,6 +25,7 @@ export default class Settings extends Component { return ( + {labels.tempScale.segmentTitle} diff --git a/components/settings/use-cervix.js b/components/settings/use-cervix.js new file mode 100644 index 0000000..668a0e8 --- /dev/null +++ b/components/settings/use-cervix.js @@ -0,0 +1,48 @@ +import React, { Component } from 'react' +import { + View, + TouchableOpacity, + Switch +} from 'react-native' +import AppText from '../app-text' +import { + useCervixObservable, + saveUseCervix +} from '../../local-storage' +import styles from '../../styles/index' +import { settings as labels } from '../../i18n/en/settings' + +export default class UseCervixSetting extends Component { + constructor() { + super() + this.state = {useCervix: useCervixObservable.value} + } + + render() { + return ( + + + {labels.useCervix.title} + + + + {this.state.useCervix ? + {labels.useCervix.cervixModeOn} + : + {labels.useCervix.cervixModeOff} + } + + { + this.setState({ useCervix: bool }) + saveUseCervix(bool) + }} + /> + + + ) + } +} diff --git a/i18n/en/settings.js b/i18n/en/settings.js index 7b23f67..2d8fad8 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -46,6 +46,11 @@ export const settings = { reminderText: 'Get a notification 3 days before your next period is likely to start.', notification: daysToEndOfPrediction => `Your next period is likely to start in 3 to ${daysToEndOfPrediction} days.` }, + useCervix: { + title: 'Secondary symptom', + cervixModeOn: 'Cervix values are being used for symptothermal fertility detection', + cervixModeOff: 'Mucus values are being used for symptothermal fertility detection' + }, passwordSettings: { title: 'App password', explainerDisabled: "Encrypt the app's database with a password. You need to enter the password every time the app is started.", diff --git a/local-storage/index.js b/local-storage/index.js index 5f4af70..cf3fcea 100644 --- a/local-storage/index.js +++ b/local-storage/index.js @@ -44,6 +44,15 @@ export async function savePeriodReminder(reminder) { periodReminderObservable.set(reminder) } +export const useCervixObservable = Observable() +setObvWithInitValue('useCervix', useCervixObservable, false) + +export async function saveUseCervix(bool) { + console.log('saving cervix to', bool) + await AsyncStorage.setItem('useCervix', JSON.stringify(bool)) + useCervixObservable.set(bool) +} + export const hasEncryptionObservable = Observable() setObvWithInitValue('hasEncryption', hasEncryptionObservable, false) @@ -54,6 +63,8 @@ export async function saveEncryptionFlag(bool) { async function setObvWithInitValue(key, obv, defaultValue) { const result = await AsyncStorage.getItem(key) + console.log('result from db for key') + console.log(result) let value if (result) { value = JSON.parse(result) From 709bae231921e364bee1d7981c89f659bc7e2741 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sat, 8 Dec 2018 09:22:49 +0100 Subject: [PATCH 15/17] Use nfp mode setting in sympto adapter --- lib/sympto-adapter.js | 3 +++ local-storage/index.js | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/sympto-adapter.js b/lib/sympto-adapter.js index 821e7c5..628ea2b 100644 --- a/lib/sympto-adapter.js +++ b/lib/sympto-adapter.js @@ -1,6 +1,7 @@ import getFertilityStatus from './sympto' import cycleModule from './cycle' import { fertilityStatus } from '../i18n/en/labels' +import { useCervixObservable } from '../local-storage' export function getFertilityStatusForDay(dateString) { const status = getCycleStatusForDay(dateString) @@ -48,6 +49,8 @@ export function getCycleStatusForDay(dateString, opts = {}) { } } + cycleInfo.secondarySymptom = useCervixObservable.value ? 'cervix' : 'mucus' + return getFertilityStatus(cycleInfo) } diff --git a/local-storage/index.js b/local-storage/index.js index cf3fcea..89b37d9 100644 --- a/local-storage/index.js +++ b/local-storage/index.js @@ -48,7 +48,6 @@ export const useCervixObservable = Observable() setObvWithInitValue('useCervix', useCervixObservable, false) export async function saveUseCervix(bool) { - console.log('saving cervix to', bool) await AsyncStorage.setItem('useCervix', JSON.stringify(bool)) useCervixObservable.set(bool) } @@ -63,8 +62,6 @@ export async function saveEncryptionFlag(bool) { async function setObvWithInitValue(key, obv, defaultValue) { const result = await AsyncStorage.getItem(key) - console.log('result from db for key') - console.log(result) let value if (result) { value = JSON.parse(result) From f9ca0c62d80e3a9c5d2227ee30ed5dc17678eb0e Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sat, 8 Dec 2018 17:27:12 +0100 Subject: [PATCH 16/17] Improve switch label wording --- i18n/en/settings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i18n/en/settings.js b/i18n/en/settings.js index 2d8fad8..eef6615 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -48,8 +48,8 @@ export const settings = { }, useCervix: { title: 'Secondary symptom', - cervixModeOn: 'Cervix values are being used for symptothermal fertility detection', - cervixModeOff: 'Mucus values are being used for symptothermal fertility detection' + cervixModeOn: 'Cervix values are being used for symptothermal fertility detection. You can switch here to use mucus values for symptothermal fertility detection', + cervixModeOff: 'By default, mucus values are being used for symptothermal fertility detection. You can switch here to use cervix values for symptothermal fertility detection' }, passwordSettings: { title: 'App password', From 7d10fbffece7a9f11d3e8d3845d9f9c047f8e48b Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sun, 9 Dec 2018 14:08:35 +0000 Subject: [PATCH 17/17] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b538d30..33c2411 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ A menstrual cycle tracking app that's open-source and leaves your data on your p 1. Either start a [virtual device in Android Studio](https://developer.android.com/studio/run/emulator) or [set your physical device like your Android phone up](https://developer.android.com/training/basics/firstapp/running-app) to run the app. -1. Open a terminal in Android Studio and run `npm install` +1. Open a terminal and run `npm install` 1. Run `npm run android`