From ed559271967072b91e003338ea532f3337988e7f Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Tue, 3 Mar 2020 15:14:34 -0500 Subject: [PATCH 1/2] Add condition to check if the AptBreakdown question is asked --- src/ReviewAnswers.js | 54 ++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/src/ReviewAnswers.js b/src/ReviewAnswers.js index 6a80950d1..1cc549b70 100644 --- a/src/ReviewAnswers.js +++ b/src/ReviewAnswers.js @@ -37,8 +37,36 @@ export default class ReviewAnswers extends React.Component { render() { const questions = this.props.questions; + console.log(questions) + console.log(questions['unitBreakdown'].answers.filter(c => c === 0).length); const phoneNumber = this.props.form.PHONE === 0 ? 'N/A' : this.props.form.PHONE; + const aptBreakdown = questions['unitBreakdown'].answers.filter(c => c === 0).length !== 6? +
+ + +
+ Apartment Unit Breakdown +
+
+ Studio: {this.props.questions['unitBreakdown'].answers[0]}
+ One Bedroom: {this.props.questions['unitBreakdown'].answers[1]}
+ Two Bedroom: {this.props.questions['unitBreakdown'].answers[2]}
+ Three Bedroom: {this.props.questions['unitBreakdown'].answers[3]}
+ Four Bedroom: {this.props.questions['unitBreakdown'].answers[4]}
+ Other: {this.props.questions['unitBreakdown'].answers[5]} +
+ +
+ + this.editAnswer('unitBreakdown') } /> + +
+
+
+
+ : ''; + const content = (
@@ -185,30 +213,8 @@ export default class ReviewAnswers extends React.Component {
- -
- - -
- Apartment Unit Breakdown -
-
- Studio: {this.props.questions['unitBreakdown'].answers[0]}
- One Bedroom: {this.props.questions['unitBreakdown'].answers[1]}
- Two Bedroom: {this.props.questions['unitBreakdown'].answers[2]}
- Three Bedroom: {this.props.questions['unitBreakdown'].answers[3]}
- Four Bedroom: {this.props.questions['unitBreakdown'].answers[4]}
- Other: {this.props.questions['unitBreakdown'].answers[5]} -
- -
- - this.editAnswer('unitBreakdown') } /> - -
-
-
-
+ + {aptBreakdown}
-- GitLab From 0a8527131ccf387ba421e8023e25bf14a6bb37e8 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Tue, 3 Mar 2020 15:52:16 -0500 Subject: [PATCH 2/2] Remove console log --- src/ReviewAnswers.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ReviewAnswers.js b/src/ReviewAnswers.js index 1cc549b70..de2a83791 100644 --- a/src/ReviewAnswers.js +++ b/src/ReviewAnswers.js @@ -37,8 +37,6 @@ export default class ReviewAnswers extends React.Component { render() { const questions = this.props.questions; - console.log(questions) - console.log(questions['unitBreakdown'].answers.filter(c => c === 0).length); const phoneNumber = this.props.form.PHONE === 0 ? 'N/A' : this.props.form.PHONE; const aptBreakdown = questions['unitBreakdown'].answers.filter(c => c === 0).length !== 6? -- GitLab