Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cd96baec22 | |||
| 93f412e983 | |||
| a5b058486e | |||
| 95cf6f6001 | |||
| 540d6aee03 | |||
| 0f7e3fe0ad | |||
| c21fd193ce | |||
| d5dc4ada12 | |||
| 01582c4e16 | |||
| e6134b4592 | |||
| 3b34ce7134 | |||
| d86f3ec9eb | |||
| 583c9c032c | |||
| 9fbe99e23b | |||
| e6c253f2cb | |||
| 06fab6d2ca |
@@ -134,8 +134,8 @@ android {
|
||||
applicationId "com.drip"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 33
|
||||
versionName "1.2403.19"
|
||||
versionCode 35
|
||||
versionName "1.2409.26"
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
|
||||
}
|
||||
|
||||
@@ -23,20 +23,14 @@ const SymptomBox = ({
|
||||
const { t } = useTranslation(null, { keyPrefix: 'symptoms' })
|
||||
const isSymptomEdited = editedSymptom === symptom
|
||||
const isSymptomDisabled = isDateInFuture(date) && symptom !== 'note'
|
||||
const isExcluded = symptomData !== null ? symptomData.exclude : false
|
||||
|
||||
const iconColor = isSymptomDisabled ? Colors.greyLight : Colors.grey
|
||||
const iconName = `drip-icon-${symptom}`
|
||||
const symptomNameStyle = [
|
||||
styles.symptomName,
|
||||
isSymptomDisabled && styles.symptomNameDisabled,
|
||||
isExcluded && styles.symptomNameExcluded,
|
||||
]
|
||||
const textStyle = [
|
||||
styles.text,
|
||||
isSymptomDisabled && styles.textDisabled,
|
||||
isExcluded && styles.textExcluded,
|
||||
]
|
||||
const textStyle = [styles.text, isSymptomDisabled && styles.textDisabled]
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -121,9 +115,6 @@ const styles = StyleSheet.create({
|
||||
textDisabled: {
|
||||
color: Colors.greyLight,
|
||||
},
|
||||
textExcluded: {
|
||||
color: Colors.grey,
|
||||
},
|
||||
})
|
||||
|
||||
export default SymptomBox
|
||||
|
||||
@@ -117,15 +117,23 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
|
||||
style: styles.input,
|
||||
textAlignVertical: 'top',
|
||||
}
|
||||
const excludeToggle = shouldShow(symptomConfig.excludeText) && (
|
||||
<Segment style={styles.segmentBorder}>
|
||||
<AppSwitch
|
||||
onToggle={onExcludeToggle}
|
||||
text={symptomPage[symptom].excludeText}
|
||||
value={data.exclude}
|
||||
/>
|
||||
</Segment>
|
||||
)
|
||||
|
||||
{
|
||||
/* show exclude AppSwitch for bleeding, mucus, cervix, temperature */
|
||||
}
|
||||
{
|
||||
/* but if fertility is off only for bleeding */
|
||||
}
|
||||
const excludeToggle = shouldShow(symptomConfig.excludeText) &&
|
||||
(isBleeding || isFertilityTrackingEnabled) && (
|
||||
<Segment style={styles.segmentBorder}>
|
||||
<AppSwitch
|
||||
onToggle={onExcludeToggle}
|
||||
text={symptomPage[symptom].excludeText}
|
||||
value={data.exclude}
|
||||
/>
|
||||
</Segment>
|
||||
)
|
||||
|
||||
return (
|
||||
<AppModal onClose={onSave}>
|
||||
@@ -189,18 +197,9 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
|
||||
</Segment>
|
||||
)
|
||||
})}
|
||||
{/* show exclude AppSwitch for bleeding, mucus, cervix, temperature */}
|
||||
{/* but if fertility is off only for bleeding */}
|
||||
{shouldShow(symptomConfig.excludeText) &&
|
||||
(symptom === 'bleeding' || isFertilityTrackingEnabled) && (
|
||||
<Segment style={styles.segmentBorder}>
|
||||
<AppSwitch
|
||||
onToggle={onExcludeToggle}
|
||||
text={symtomPage[symptom].excludeText}
|
||||
value={data.exclude}
|
||||
/>
|
||||
</Segment>
|
||||
)}
|
||||
|
||||
{!isBleeding && excludeToggle}
|
||||
|
||||
{shouldShow(symptomConfig.note) && (
|
||||
<Segment style={styles.segmentBorder}>
|
||||
<AppText>{symptomPage[symptom].note}</AppText>
|
||||
|
||||
@@ -262,7 +262,51 @@ export const symptomPage = {
|
||||
|
||||
export const save = {
|
||||
bleeding: (data, date, shouldDeleteData) => {
|
||||
saveBoxSymptom(data, date, shouldDeleteData, 'bleeding')
|
||||
const {
|
||||
value,
|
||||
pad,
|
||||
tampon,
|
||||
underwear,
|
||||
cup,
|
||||
softTampon,
|
||||
disk,
|
||||
none,
|
||||
other,
|
||||
note,
|
||||
} = data
|
||||
let { exclude } = data
|
||||
const isDataEntered = [
|
||||
'value',
|
||||
'pad',
|
||||
'tampon',
|
||||
'underwear',
|
||||
'cup',
|
||||
'softTampon',
|
||||
'disk',
|
||||
'none',
|
||||
'other',
|
||||
'note',
|
||||
].some((value) => typeof data[value] === 'number' || data[value] == true)
|
||||
// covering the case when a bleeding value was entered, "excluded" and saved. But then the bleeding value was deleted again.
|
||||
exclude = isNumber(value) ? exclude : false
|
||||
const valuesToSave =
|
||||
shouldDeleteData || !isDataEntered
|
||||
? null
|
||||
: {
|
||||
exclude,
|
||||
value,
|
||||
pad,
|
||||
tampon,
|
||||
underwear,
|
||||
cup,
|
||||
softTampon,
|
||||
disk,
|
||||
none,
|
||||
other,
|
||||
note,
|
||||
}
|
||||
|
||||
saveSymptom('bleeding', date, valuesToSave)
|
||||
},
|
||||
cervix: (data, date, shouldDeleteData) => {
|
||||
const { opening, firmness, position, exclude } = data
|
||||
@@ -343,7 +387,12 @@ const label = {
|
||||
bleeding: (bleeding) => {
|
||||
bleeding = mapRealmObjToJsObj(bleeding)
|
||||
const bleedingLabel = []
|
||||
if (bleeding && Object.values({ ...bleeding }).some((val) => val)) {
|
||||
if (
|
||||
bleeding &&
|
||||
Object.values({ ...bleeding }).some(
|
||||
(val) => typeof val === 'number' || val == true
|
||||
)
|
||||
) {
|
||||
Object.keys(bleeding).forEach((key) => {
|
||||
if (bleeding[key] != null && key === 'value') {
|
||||
bleedingLabel.push(
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ export function saveSymptom(symptom, date, val) {
|
||||
let cycleDay = getCycleDay(date)
|
||||
if (!cycleDay) cycleDay = createCycleDay(date)
|
||||
db.write(() => {
|
||||
if (symptom === 'bleeding' && val != null && val.value != null) {
|
||||
if (symptom === 'bleeding') {
|
||||
const mensesDaysAfter = getMensesDaysRightAfter(cycleDay)
|
||||
maybeSetNewCycleStart({
|
||||
val,
|
||||
|
||||
@@ -47,7 +47,7 @@ export const cervix = {
|
||||
explainer: 'How high up in the vagina is the cervix?',
|
||||
},
|
||||
excludeExplainer:
|
||||
"You can exclude this value if you don't want to use it for fertility detection.",
|
||||
"You can exclude these values if you don't want to use them for fertility detection.",
|
||||
}
|
||||
|
||||
export const mucus = {
|
||||
@@ -65,7 +65,7 @@ export const mucus = {
|
||||
'Looking at and touching your cervical mucus, which describes it best?',
|
||||
},
|
||||
excludeExplainer:
|
||||
"You can exclude this value if you don't want to use it for fertility detection",
|
||||
"You can exclude these values if you don't want to use them for fertility detection",
|
||||
}
|
||||
|
||||
export const desire = {
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.2403.19</string>
|
||||
<string>1.2409.26</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
export default function ({
|
||||
val, cycleDay, mensesDaysAfter, checkIsMensesStart
|
||||
val,
|
||||
cycleDay,
|
||||
mensesDaysAfter,
|
||||
checkIsMensesStart,
|
||||
}) {
|
||||
|
||||
cycleDay.bleeding = val
|
||||
|
||||
// if a bleeding value is deleted or excluded, we need to check if there are
|
||||
@@ -20,15 +22,15 @@ export default function ({
|
||||
}
|
||||
|
||||
function bleedingValueDeletedOrExluded(val) {
|
||||
const bleedingDeleted = !val
|
||||
const bleedingDeleted = !val || !(typeof val?.value === 'number')
|
||||
const bleedingExcluded = val && val.exclude
|
||||
return bleedingDeleted || bleedingExcluded
|
||||
}
|
||||
|
||||
function maybeClearOldCycleStarts() {
|
||||
// if we have a new bleeding day, we need to clear the
|
||||
// menses start marker from all following days of this
|
||||
// menses that may have been marked as start before
|
||||
mensesDaysAfter.forEach(day => day.isCycleStart = false)
|
||||
// if we have a new bleeding day, we need to clear the
|
||||
// menses start marker from all following days of this
|
||||
// menses that may have been marked as start before
|
||||
mensesDaysAfter.forEach((day) => (day.isCycleStart = false))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "drip.",
|
||||
"version": "1.2403.19",
|
||||
"version": "1.2409.26",
|
||||
"contributors": [
|
||||
"Julia Friesel <julia.friesel@gmail.com>",
|
||||
"Marie Kochsiek",
|
||||
@@ -12,8 +12,8 @@
|
||||
"scripts": {
|
||||
"start": "react-native start",
|
||||
"android": "react-native run-android",
|
||||
"ios": "react-native run-ios --simulator=\"iPhone 15\"",
|
||||
"iosSE": "react-native run-ios --simulator=\"iPhone SE (2nd generation)\"",
|
||||
"ios": "react-native run-ios --simulator=\"iPhone 8 Plus\"",
|
||||
"ios15": "react-native run-ios --simulator=\"iPhone 15 Plus\"",
|
||||
"log": "react-native log-android",
|
||||
"test": "jest test && yarn lint",
|
||||
"test-watch": "jest --watch test",
|
||||
|
||||
Reference in New Issue
Block a user