Add * to cell with standard deviation

This commit is contained in:
MariaZ
2022-09-19 21:23:03 +02:00
parent 6d6473ca78
commit 951fb778d4
+10 -3
View File
@@ -15,10 +15,12 @@ StatsOverview.propTypes = {
} }
const Row = ({ rowContent }) => { const Row = ({ rowContent }) => {
const showHelp = rowContent[1].includes('deviation') ? true : false
return ( return (
<View style={styles.row}> <View style={styles.row}>
<Cell content={rowContent[0]} isLeft /> <Cell content={rowContent[0]} isLeft />
<Cell content={rowContent[1]} /> <Cell content={rowContent[1]} showHelp={showHelp} />
</View> </View>
) )
} }
@@ -27,7 +29,7 @@ Row.propTypes = {
rowContent: PropTypes.array.isRequired, rowContent: PropTypes.array.isRequired,
} }
const Cell = ({ content, isLeft }) => { const Cell = ({ content, isLeft, showHelp }) => {
const styleContainer = isLeft ? styles.cellLeft : styles.cellRight const styleContainer = isLeft ? styles.cellLeft : styles.cellRight
const styleText = isLeft ? styles.accentPurpleBig : styles.accentOrange const styleText = isLeft ? styles.accentPurpleBig : styles.accentOrange
const numberOfLines = isLeft ? 1 : 2 const numberOfLines = isLeft ? 1 : 2
@@ -42,6 +44,7 @@ const Cell = ({ content, isLeft }) => {
> >
{content} {content}
</AppText> </AppText>
{showHelp && <AppText style={styles.accentPurpleBig}>*</AppText>}
</View> </View>
) )
} }
@@ -49,6 +52,7 @@ const Cell = ({ content, isLeft }) => {
Cell.propTypes = { Cell.propTypes = {
content: PropTypes.node.isRequired, content: PropTypes.node.isRequired,
isLeft: PropTypes.bool, isLeft: PropTypes.bool,
showHelp: PropTypes.bool,
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
@@ -66,7 +70,10 @@ const styles = StyleSheet.create({
flex: 3, flex: 3,
justifyContent: 'center', justifyContent: 'center',
}, },
cellRight: { flex: 5 }, cellRight: {
flex: 5,
flexDirection: 'row',
},
row: { flexDirection: 'row' }, row: { flexDirection: 'row' },
}) })