Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a4e0fa64e9 | |||
| fd6f39fbc4 |
+1
-1
@@ -30,7 +30,7 @@ ios/Index/DataStore
|
|||||||
build/
|
build/
|
||||||
.idea
|
.idea
|
||||||
.gradle
|
.gradle
|
||||||
*.properties
|
local.properties
|
||||||
*.iml
|
*.iml
|
||||||
*.hprof
|
*.hprof
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,6 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## v1.2410.7 Android & iOS
|
|
||||||
|
|
||||||
### Changes
|
|
||||||
|
|
||||||
- Updated dependencies:
|
|
||||||
- react-native v0.68.5
|
|
||||||
|
|
||||||
### Adds
|
|
||||||
|
|
||||||
A button that links to our FAQ page on the drip website
|
|
||||||
|
|
||||||
## v1.2403.19 Android & iOS
|
## v1.2403.19 Android & iOS
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
apply plugin: "com.android.application"
|
apply plugin: "com.android.application"
|
||||||
|
|
||||||
import com.android.build.OutputFile
|
import com.android.build.OutputFile
|
||||||
import java.util.Properties
|
|
||||||
import java.io.FileInputStream
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
|
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
|
||||||
@@ -127,16 +125,6 @@ def enableHermes = project.ext.react.get("enableHermes", false);
|
|||||||
*/
|
*/
|
||||||
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
|
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
|
||||||
|
|
||||||
// Create a variable called keystorePropertiesFile, and initialize it to your
|
|
||||||
// keystore.properties file, in the rootProject folder.
|
|
||||||
def keystorePropertiesFile = rootProject.file("keystore.properties")
|
|
||||||
|
|
||||||
// Initialize a new Properties() object called keystoreProperties.
|
|
||||||
def keystoreProperties = new Properties()
|
|
||||||
|
|
||||||
// Load your keystore.properties file into the keystoreProperties object.
|
|
||||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
ndkVersion rootProject.ext.ndkVersion
|
ndkVersion rootProject.ext.ndkVersion
|
||||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||||
@@ -146,8 +134,8 @@ android {
|
|||||||
applicationId "com.drip"
|
applicationId "com.drip"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 35
|
versionCode 33
|
||||||
versionName "1.2410.7"
|
versionName "1.2403.19"
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
|
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
|
||||||
}
|
}
|
||||||
@@ -162,10 +150,6 @@ android {
|
|||||||
keyPassword 'android'
|
keyPassword 'android'
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
storeFile file('drip-release-key.keystore')
|
|
||||||
keyAlias keystoreProperties['keyAlias']
|
|
||||||
keyPassword keystoreProperties['keyPassword']
|
|
||||||
storePassword keystoreProperties['storePassword']
|
|
||||||
if (project.hasProperty('DRIP_RELEASE_STORE_FILE')) {
|
if (project.hasProperty('DRIP_RELEASE_STORE_FILE')) {
|
||||||
storeFile file(DRIP_RELEASE_STORE_FILE)
|
storeFile file(DRIP_RELEASE_STORE_FILE)
|
||||||
storePassword DRIP_RELEASE_STORE_PASSWORD
|
storePassword DRIP_RELEASE_STORE_PASSWORD
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { FlatList, StyleSheet, View } from 'react-native'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
// import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
|
import AppModal from '../common/app-modal'
|
||||||
|
import AppText from '../common/app-text'
|
||||||
|
|
||||||
|
import symOccModule from '../../lib/sympto-occurance'
|
||||||
|
import { Spacing, Typography, Colors } from '../../styles'
|
||||||
|
|
||||||
|
// const { t } = useTranslation(null, { keyPrefix: 'stats' })
|
||||||
|
|
||||||
|
const SymptomOccurance = ({ onClose }) => {
|
||||||
|
const cycleDays = symOccModule().getCycleStartsOfLastYear()
|
||||||
|
if (!cycleDays || cycleDays.length === 0) return false
|
||||||
|
console.log('cycle starts:', cycleDays)
|
||||||
|
|
||||||
|
const headacheDays = symOccModule().getPainDaysOfLastYear()
|
||||||
|
console.log('pain', headacheDays)
|
||||||
|
|
||||||
|
const cycleDaysOfPain = symOccModule().getCycleDayForPainDays(
|
||||||
|
cycleDays,
|
||||||
|
headacheDays
|
||||||
|
)
|
||||||
|
console.log('cycle days of pain', cycleDaysOfPain)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AppModal onClose={onClose}>
|
||||||
|
<View>
|
||||||
|
<FlatList
|
||||||
|
ListHeaderComponent={FlatListHeader}
|
||||||
|
contentContainerStyle={styles.container}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</AppModal>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
SymptomOccurance.propTypes = {
|
||||||
|
onClose: PropTypes.func,
|
||||||
|
}
|
||||||
|
|
||||||
|
const FlatListHeader = () => (
|
||||||
|
<View style={styles.row}>
|
||||||
|
<View style={styles.accentCell}>
|
||||||
|
<AppText style={styles.header}>
|
||||||
|
{'When did you experience headaches in the last year?'}
|
||||||
|
</AppText>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
divider: {
|
||||||
|
height: 1,
|
||||||
|
width: '100%',
|
||||||
|
backgroundColor: Colors.grey,
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
...Typography.accentOrange,
|
||||||
|
paddingVertical: Spacing.small,
|
||||||
|
},
|
||||||
|
headerDivider: {
|
||||||
|
borderBottomColor: Colors.purple,
|
||||||
|
borderBottomWidth: 2,
|
||||||
|
},
|
||||||
|
row: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
paddingVertical: Spacing.tiny,
|
||||||
|
backgroundColor: 'white',
|
||||||
|
},
|
||||||
|
cell: {
|
||||||
|
flex: 2,
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
accentCell: {
|
||||||
|
flex: 3,
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
container: {
|
||||||
|
minHeight: '40%',
|
||||||
|
minWidth: '95%',
|
||||||
|
paddingHorizontal: Spacing.base,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
export default SymptomOccurance
|
||||||
@@ -8,6 +8,7 @@ import Button from '../common/button'
|
|||||||
import Footnote from '../common/Footnote'
|
import Footnote from '../common/Footnote'
|
||||||
import StatsOverview from './StatsOverview'
|
import StatsOverview from './StatsOverview'
|
||||||
import PeriodDetailsModal from './PeriodDetailsModal'
|
import PeriodDetailsModal from './PeriodDetailsModal'
|
||||||
|
import SymptomOccurance from './SymptomOccurance'
|
||||||
|
|
||||||
import cycleModule from '../../lib/cycle'
|
import cycleModule from '../../lib/cycle'
|
||||||
import { getCycleLengthStats as getCycleInfo } from '../../lib/cycle-length'
|
import { getCycleLengthStats as getCycleInfo } from '../../lib/cycle-length'
|
||||||
@@ -19,6 +20,8 @@ const image = require('../../assets/cycle-icon.png')
|
|||||||
|
|
||||||
const Stats = () => {
|
const Stats = () => {
|
||||||
const [isStatsVisible, setIsStatsVisible] = useState(false)
|
const [isStatsVisible, setIsStatsVisible] = useState(false)
|
||||||
|
const [isSymptomOccuranceVisible, setIsSymptomOccuranceVisible] =
|
||||||
|
useState(false)
|
||||||
|
|
||||||
const { t } = useTranslation(null, { keyPrefix: 'stats' })
|
const { t } = useTranslation(null, { keyPrefix: 'stats' })
|
||||||
|
|
||||||
@@ -83,6 +86,14 @@ const Stats = () => {
|
|||||||
{isStatsVisible && (
|
{isStatsVisible && (
|
||||||
<PeriodDetailsModal onClose={() => setIsStatsVisible(false)} />
|
<PeriodDetailsModal onClose={() => setIsStatsVisible(false)} />
|
||||||
)}
|
)}
|
||||||
|
<Button isCTA onPress={() => setIsSymptomOccuranceVisible(true)}>
|
||||||
|
{t('showSymptomOccurance')}
|
||||||
|
</Button>
|
||||||
|
{isSymptomOccuranceVisible && (
|
||||||
|
<SymptomOccurance
|
||||||
|
onClose={() => setIsSymptomOccuranceVisible(false)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<Footnote>{t('footnote')}</Footnote>
|
<Footnote>{t('footnote')}</Footnote>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -73,6 +73,9 @@ export function getTemperatureDaysSortedByDate() {
|
|||||||
.filtered('temperature != null')
|
.filtered('temperature != null')
|
||||||
.sorted('date', true)
|
.sorted('date', true)
|
||||||
}
|
}
|
||||||
|
export function getPainDaysSortedByDate() {
|
||||||
|
return db.objects('CycleDay').filtered('pain != null').sorted('date', true)
|
||||||
|
}
|
||||||
|
|
||||||
export function getCycleDaysSortedByDate() {
|
export function getCycleDaysSortedByDate() {
|
||||||
const cycleDays = db.objects('CycleDay').sorted('date', true)
|
const cycleDays = db.objects('CycleDay').sorted('date', true)
|
||||||
|
|||||||
+2
-1
@@ -156,7 +156,8 @@
|
|||||||
"cycleLength": "Cycle length",
|
"cycleLength": "Cycle length",
|
||||||
"bleedingDays": "Bleeding"
|
"bleedingDays": "Bleeding"
|
||||||
},
|
},
|
||||||
"footnote": "Based on the standard deviation of all your tracked periods drip. calculates a range for the starting day of the upcoming 3 periods. The range will be 3 days if your standard deviation is smaller than 1.5 and 5 days if the value is bigger.\n\nThe standard deviation tells you how much the length of your periods vary, 0 means all your periods are exactly the same length and the bigger the value the more the period length varies."
|
"footnote": "Based on the standard deviation of all your tracked periods drip. calculates a range for the starting day of the upcoming 3 periods. The range will be 3 days if your standard deviation is smaller than 1.5 and 5 days if the value is bigger.\n\nThe standard deviation tells you how much the length of your periods vary, 0 means all your periods are exactly the same length and the bigger the value the more the period length varies.",
|
||||||
|
"showSymptomOccurance": "Show details on headaches"
|
||||||
},
|
},
|
||||||
"plurals": {
|
"plurals": {
|
||||||
"day": "{{count}} day",
|
"day": "{{count}} day",
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.2410.7</string>
|
<string>1.2403.19</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
import * as joda from '@js-joda/core'
|
||||||
|
const LocalDate = joda.LocalDate
|
||||||
|
const DAYS = joda.ChronoUnit.DAYS
|
||||||
|
|
||||||
|
export default function config(opts) {
|
||||||
|
let cycleStartsSortedByDate
|
||||||
|
let painSortedByDate
|
||||||
|
|
||||||
|
if (!opts) {
|
||||||
|
// we only want to require (and run) the db module
|
||||||
|
// when not running the tests
|
||||||
|
cycleStartsSortedByDate = require('../db').getCycleStartsSortedByDate()
|
||||||
|
painSortedByDate = require('../db').getPainDaysSortedByDate()
|
||||||
|
// maxCycleLength = 45
|
||||||
|
} else {
|
||||||
|
cycleStartsSortedByDate = opts.cycleStartsSortedByDate || []
|
||||||
|
painSortedByDate = opts.painSortedByDate || []
|
||||||
|
// maxCycleLength = opts.maxCycleLength || 99
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCycleStartsOfLastYear() {
|
||||||
|
const today = LocalDate.parse(new Date().toISOString().slice(0, 10))
|
||||||
|
const firstRelevantDay = today.minusYears(1)
|
||||||
|
const relevantCycles = cycleStartsSortedByDate.filter(({ date }) =>
|
||||||
|
LocalDate.parse(date).isAfter(firstRelevantDay)
|
||||||
|
)
|
||||||
|
return relevantCycles.map(({ date }) => date)
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPainDaysOfLastYear() {
|
||||||
|
const today = LocalDate.parse(new Date().toISOString().slice(0, 10))
|
||||||
|
const firstRelevantDay = today.minusYears(1)
|
||||||
|
const relevantPainDays = painSortedByDate.filter(
|
||||||
|
({ date, pain }) =>
|
||||||
|
LocalDate.parse(date).isAfter(firstRelevantDay) && pain.headache
|
||||||
|
)
|
||||||
|
return relevantPainDays.map(({ date }) => date)
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCycleDayForPainDays(cycleStarts, painDays) {
|
||||||
|
let i = 0
|
||||||
|
const cycleStartsAsc = cycleStarts.sort().reverse()
|
||||||
|
const painDaysAsc = painDays.sort().reverse()
|
||||||
|
const painCycleDays = painDaysAsc.map((pdate) => {
|
||||||
|
if (LocalDate.parse(pdate).isBefore(LocalDate.parse(cycleStartsAsc[i]))) {
|
||||||
|
// increase index i until cycleStart of this painDay is found
|
||||||
|
for (let j = i + 1; j < cycleStartsAsc.length; j++) {
|
||||||
|
i = j
|
||||||
|
if (
|
||||||
|
!LocalDate.parse(cycleStartsAsc[i]).isAfter(LocalDate.parse(pdate))
|
||||||
|
) {
|
||||||
|
// not(C > P) === C ≤ P
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return LocalDate.parse(cycleStartsAsc[i]).until(
|
||||||
|
LocalDate.parse(pdate),
|
||||||
|
DAYS
|
||||||
|
)
|
||||||
|
})
|
||||||
|
return painCycleDays
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
getCycleStartsOfLastYear,
|
||||||
|
getPainDaysOfLastYear,
|
||||||
|
getCycleDayForPainDays,
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "drip.",
|
"name": "drip.",
|
||||||
"version": "1.2410.7",
|
"version": "1.2403.19",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"Julia Friesel <julia.friesel@gmail.com>",
|
"Julia Friesel <julia.friesel@gmail.com>",
|
||||||
"Marie Kochsiek",
|
"Marie Kochsiek",
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"react": "17.0.2",
|
"react": "17.0.2",
|
||||||
"react-i18next": "^12.0.0",
|
"react-i18next": "^12.0.0",
|
||||||
"react-native": "0.68.5",
|
"react-native": "0.68.3",
|
||||||
"react-native-calendars": "^1.1287.0",
|
"react-native-calendars": "^1.1287.0",
|
||||||
"react-native-document-picker": "^8.1.1",
|
"react-native-document-picker": "^8.1.1",
|
||||||
"react-native-fs": "^2.20.0",
|
"react-native-fs": "^2.20.0",
|
||||||
|
|||||||
@@ -6378,7 +6378,7 @@ promise@^7.1.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
asap "~2.0.3"
|
asap "~2.0.3"
|
||||||
|
|
||||||
promise@^8.2.0:
|
promise@^8.0.3:
|
||||||
version "8.3.0"
|
version "8.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/promise/-/promise-8.3.0.tgz#8cb333d1edeb61ef23869fbb8a4ea0279ab60e0a"
|
resolved "https://registry.yarnpkg.com/promise/-/promise-8.3.0.tgz#8cb333d1edeb61ef23869fbb8a4ea0279ab60e0a"
|
||||||
integrity sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==
|
integrity sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==
|
||||||
@@ -6508,10 +6508,10 @@ react-native-calendars@^1.1287.0:
|
|||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
moment "^2.29.4"
|
moment "^2.29.4"
|
||||||
|
|
||||||
react-native-codegen@^0.0.18:
|
react-native-codegen@^0.0.17:
|
||||||
version "0.0.18"
|
version "0.0.17"
|
||||||
resolved "https://registry.yarnpkg.com/react-native-codegen/-/react-native-codegen-0.0.18.tgz#99d6623d65292e8ce3fdb1d133a358caaa2145e7"
|
resolved "https://registry.yarnpkg.com/react-native-codegen/-/react-native-codegen-0.0.17.tgz#83fb814d94061cbd46667f510d2ddba35ffb50ac"
|
||||||
integrity sha512-XPI9aVsFy3dvgDZvyGWrFnknNiyb22kg5nHgxa0vjWTH9ENLBgVRZt9A64xHZ8BYihH+gl0p/1JNOCIEUzRPBg==
|
integrity sha512-7GIEUmAemH9uWwB6iYXNNsPoPgH06pxzGRmdBzK98TgFBdYJZ7CBuZFPMe4jmHQTPOkQazKZ/w5O6/71JBixmw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/parser" "^7.14.0"
|
"@babel/parser" "^7.14.0"
|
||||||
flow-parser "^0.121.0"
|
flow-parser "^0.121.0"
|
||||||
@@ -6601,10 +6601,10 @@ react-native-version@^3.1.0:
|
|||||||
resolve-from "^5.0.0"
|
resolve-from "^5.0.0"
|
||||||
semver "^6.0.0"
|
semver "^6.0.0"
|
||||||
|
|
||||||
react-native@0.68.5:
|
react-native@0.68.3:
|
||||||
version "0.68.5"
|
version "0.68.3"
|
||||||
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.68.5.tgz#8ba7389e00b757c59b6ea23bf38303d52367d155"
|
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.68.3.tgz#07ac7374acde9bc5e80f9e473e03d6b730528f1c"
|
||||||
integrity sha512-t3kiQ/gumFV+0r/NRSIGtYxanjY4da0utFqHgkMcRPJVwXFWC0Fr8YiOeRGYO1dp8EfrSsOjtfWic/inqVYlbQ==
|
integrity sha512-LPgLQ4e96NWCrJPKlXzKfvlg1ddhfUplsEg00/cfBIMFZPJn2inzo9Rym8I/JYjmRORe4GjGY8kOem72hPm0Lw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@jest/create-cache-key-function" "^27.0.1"
|
"@jest/create-cache-key-function" "^27.0.1"
|
||||||
"@react-native-community/cli" "^7.0.3"
|
"@react-native-community/cli" "^7.0.3"
|
||||||
@@ -6626,9 +6626,9 @@ react-native@0.68.5:
|
|||||||
metro-source-map "0.67.0"
|
metro-source-map "0.67.0"
|
||||||
nullthrows "^1.1.1"
|
nullthrows "^1.1.1"
|
||||||
pretty-format "^26.5.2"
|
pretty-format "^26.5.2"
|
||||||
promise "^8.2.0"
|
promise "^8.0.3"
|
||||||
react-devtools-core "^4.23.0"
|
react-devtools-core "^4.23.0"
|
||||||
react-native-codegen "^0.0.18"
|
react-native-codegen "^0.0.17"
|
||||||
react-native-gradle-plugin "^0.0.6"
|
react-native-gradle-plugin "^0.0.6"
|
||||||
react-refresh "^0.4.0"
|
react-refresh "^0.4.0"
|
||||||
react-shallow-renderer "16.14.1"
|
react-shallow-renderer "16.14.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user