From 23b634e734ce68ecaf109295dff772319d5e2c95 Mon Sep 17 00:00:00 2001 From: Chris Lawton <chris.lawton@torchbox.com> Date: Tue, 12 Feb 2019 11:42:13 +0000 Subject: [PATCH] don't show empty submission information --- .../src/components/SubmissionDisplay/index.js | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/opentech/static_src/src/app/src/components/SubmissionDisplay/index.js b/opentech/static_src/src/app/src/components/SubmissionDisplay/index.js index 3d00eeac2..53853ef43 100644 --- a/opentech/static_src/src/app/src/components/SubmissionDisplay/index.js +++ b/opentech/static_src/src/app/src/components/SubmissionDisplay/index.js @@ -68,19 +68,25 @@ export default class SubmissionDisplay extends Component { return ( <div className="application-display"> - <h3>{stage} Information</h3> + {stage && + <h3>{stage} Information</h3> + } - <div className="grid grid--proposal-info"> - {metaQuestions.map((response, index) => ( - <MetaResponse key={index} {...response} /> - ))} - </div> + {metaQuestions.length > 0 && + <div className="grid grid--proposal-info"> + {metaQuestions.map((response, index) => ( + <MetaResponse key={index} {...response} /> + ))} + </div> + } - <div className="rich-text rich-text--answers"> - {questions.map((response, index) => ( - <Response key={index} {...response} /> - ))} - </div> + {questions.length > 0 && + <div className="rich-text rich-text--answers"> + {questions.map((response, index) => ( + <Response key={index} {...response} /> + ))} + </div> + } </div> ) } -- GitLab