From 4781888b56282f305b5d2764ec2be9beac55ef30 Mon Sep 17 00:00:00 2001 From: asem1789 Date: Wed, 27 Nov 2019 10:51:14 +0200 Subject: [PATCH] delete WelcomeMessage component and handle it directly Relates #8 --- client/src/components/StepsQuestions/index.js | 16 +++++++++------- .../subcomponents/WelcomeMessage.js | 9 --------- .../StepsQuestions/subcomponents/index.js | 3 +-- client/src/staticDataSet/questions.js | 2 +- 4 files changed, 11 insertions(+), 19 deletions(-) delete mode 100644 client/src/components/StepsQuestions/subcomponents/WelcomeMessage.js diff --git a/client/src/components/StepsQuestions/index.js b/client/src/components/StepsQuestions/index.js index 810dc0f..3eb0551 100644 --- a/client/src/components/StepsQuestions/index.js +++ b/client/src/components/StepsQuestions/index.js @@ -37,13 +37,15 @@ export default class StepsQuestions extends React.Component { return (

{question}

- - this.handleStateChange({ key, value }) - } - /> + {Component && ( + + this.handleStateChange({ key, value }) + } + /> + )}
); return ''; diff --git a/client/src/components/StepsQuestions/subcomponents/WelcomeMessage.js b/client/src/components/StepsQuestions/subcomponents/WelcomeMessage.js deleted file mode 100644 index 60fc7f3..0000000 --- a/client/src/components/StepsQuestions/subcomponents/WelcomeMessage.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; - -const Welcome = () => ( -
-

Hi, Welcome

-
-); - -export default Welcome; diff --git a/client/src/components/StepsQuestions/subcomponents/index.js b/client/src/components/StepsQuestions/subcomponents/index.js index 416eb28..83ecb14 100644 --- a/client/src/components/StepsQuestions/subcomponents/index.js +++ b/client/src/components/StepsQuestions/subcomponents/index.js @@ -1,6 +1,5 @@ -import WelcomeMessage from './WelcomeMessage'; import TypeQuestion from './TypeQuestion'; import InputQuestion from './InputQuestion'; import CountryOrCity from './CountryOrCity'; -export default { TypeQuestion, InputQuestion, CountryOrCity, WelcomeMessage }; +export default { TypeQuestion, InputQuestion, CountryOrCity }; diff --git a/client/src/staticDataSet/questions.js b/client/src/staticDataSet/questions.js index 5dd177d..d9c5cbb 100644 --- a/client/src/staticDataSet/questions.js +++ b/client/src/staticDataSet/questions.js @@ -1,5 +1,5 @@ export default [ - { stepNo: 0, key: 'welcome', question: 'welcome', type: 'WelcomeMessage' }, + { stepNo: 0, key: 'welcome', question: 'welcome' }, { stepNo: 1, key: 'name', question: 'name?', type: 'InputQuestion' }, { stepNo: 2, key: 'link', question: 'link?', type: 'InputQuestion' }, {