Merge branch 'main' into 'feature/prods'

# Conflicts:
#   components/cycle-day/symptom-edit-view.js
#   i18n/en/cycle-day.js
This commit is contained in:
bl00dymarie
2024-04-03 19:56:12 +00:00
116 changed files with 5090 additions and 4628 deletions
+16 -5
View File
@@ -15,6 +15,7 @@ import Temperature from './temperature'
import { blank, save, shouldShow, symptomPage } from '../helpers/cycle-day'
import { showToast } from '../helpers/general'
import { fertilityTrackingObservable } from '../../local-storage'
import { shared as sharedLabels } from '../../i18n/en/labels'
import info from '../../i18n/en/symptom-info'
import { Colors, Containers, Sizes, Spacing } from '../../styles'
@@ -26,6 +27,8 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
const isBleeding = symptom === 'bleeding'
const getParsedData = () => JSON.parse(JSON.stringify(data))
const onPressLearnMore = () => setShouldShowInfo(!shouldShowInfo)
const isFertilityTrackingEnabled = fertilityTrackingObservable.value
const onEditNote = (note) => {
const parsedData = getParsedData()
@@ -102,8 +105,7 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
const onSelectTab = (group, value) => {
const parsedData = getParsedData()
Object.assign(parsedData, { [group.key]: value })
parsedData[group.key] = parsedData[group.key] !== value ? value : null
setData(parsedData)
}
const iconName = shouldShowInfo ? 'chevron-up' : 'chevron-down'
@@ -187,9 +189,18 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
</Segment>
)
})}
{!isBleeding && excludeToggle}
{/* 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>
)}
{shouldShow(symptomConfig.note) && (
<Segment style={styles.segmentBorder}>
<AppText>{symptomPage[symptom].note}</AppText>