From 951fb778d4101d3dcff96426969d3c0c9b883fb8 Mon Sep 17 00:00:00 2001 From: MariaZ Date: Mon, 19 Sep 2022 21:23:03 +0200 Subject: [PATCH] Add * to cell with standard deviation --- components/common/StatsOverview.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/components/common/StatsOverview.js b/components/common/StatsOverview.js index 1e07953..e6d11dd 100644 --- a/components/common/StatsOverview.js +++ b/components/common/StatsOverview.js @@ -15,10 +15,12 @@ StatsOverview.propTypes = { } const Row = ({ rowContent }) => { + const showHelp = rowContent[1].includes('deviation') ? true : false + return ( - + ) } @@ -27,7 +29,7 @@ Row.propTypes = { rowContent: PropTypes.array.isRequired, } -const Cell = ({ content, isLeft }) => { +const Cell = ({ content, isLeft, showHelp }) => { const styleContainer = isLeft ? styles.cellLeft : styles.cellRight const styleText = isLeft ? styles.accentPurpleBig : styles.accentOrange const numberOfLines = isLeft ? 1 : 2 @@ -42,6 +44,7 @@ const Cell = ({ content, isLeft }) => { > {content} + {showHelp && *} ) } @@ -49,6 +52,7 @@ const Cell = ({ content, isLeft }) => { Cell.propTypes = { content: PropTypes.node.isRequired, isLeft: PropTypes.bool, + showHelp: PropTypes.bool, } const styles = StyleSheet.create({ @@ -66,7 +70,10 @@ const styles = StyleSheet.create({ flex: 3, justifyContent: 'center', }, - cellRight: { flex: 5 }, + cellRight: { + flex: 5, + flexDirection: 'row', + }, row: { flexDirection: 'row' }, })