Use built-in numberOfLines prop instead of truncating by hand
This commit is contained in:
@@ -7,6 +7,7 @@ export default function AppText(props) {
|
|||||||
<Text
|
<Text
|
||||||
style={[styles.appText, props.style]}
|
style={[styles.appText, props.style]}
|
||||||
onPress={props.onPress}
|
onPress={props.onPress}
|
||||||
|
numberOfLines={props.numberOfLines}
|
||||||
>
|
>
|
||||||
{props.children}
|
{props.children}
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
@@ -167,10 +167,7 @@ export default class CycleDayOverView extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const symptomValue = cycleDay[symptomName]
|
const symptomValue = cycleDay[symptomName]
|
||||||
const label = l[symptomName](symptomValue)
|
return l[symptomName](symptomValue)
|
||||||
if (!label) return
|
|
||||||
if (label.length < 45) return label
|
|
||||||
return label.slice(0, 42) + '...'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -293,7 +290,10 @@ class SymptomBox extends Component {
|
|||||||
</AppText>
|
</AppText>
|
||||||
</View>
|
</View>
|
||||||
<View style={[styles.symptomDataBox, disabledStyle]}>
|
<View style={[styles.symptomDataBox, disabledStyle]}>
|
||||||
<AppText style={styles.symptomDataText}>{this.props.data}</AppText>
|
<AppText
|
||||||
|
style={styles.symptomDataText}
|
||||||
|
numberOfLines={3}
|
||||||
|
>{this.props.data}</AppText>
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user