Merge branch '297-bug-overspilling-text-in-pain-mood-note' into 'master'

Use built-in numberOfLines prop instead of truncating by hand

Closes #297

See merge request bloodyhealth/drip!174
This commit is contained in:
Julia Friesel
2019-02-04 19:07:16 +00:00
2 changed files with 6 additions and 5 deletions
+1
View File
@@ -7,6 +7,7 @@ export default function AppText(props) {
<Text
style={[styles.appText, props.style]}
onPress={props.onPress}
numberOfLines={props.numberOfLines}
>
{props.children}
</Text>
+5 -5
View File
@@ -167,10 +167,7 @@ export default class CycleDayOverView extends Component {
}
const symptomValue = cycleDay[symptomName]
const label = l[symptomName](symptomValue)
if (!label) return
if (label.length < 45) return label
return label.slice(0, 42) + '...'
return l[symptomName](symptomValue)
}
render() {
@@ -293,7 +290,10 @@ class SymptomBox extends Component {
</AppText>
</View>
<View style={[styles.symptomDataBox, disabledStyle]}>
<AppText style={styles.symptomDataText}>{this.props.data}</AppText>
<AppText
style={styles.symptomDataText}
numberOfLines={3}
>{this.props.data}</AppText>
</View>
</TouchableOpacity>
)