Skip to content

Commit

Permalink
delete WelcomeMessage component and handle it directly
Browse files Browse the repository at this point in the history
Relates #8
  • Loading branch information
asem1789 committed Nov 27, 2019
1 parent 232e26e commit 4781888
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
16 changes: 9 additions & 7 deletions client/src/components/StepsQuestions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ export default class StepsQuestions extends React.Component {
return (
<div key={`content${stepNo}`}>
<p>{question}</p>
<Component
options={newOptions}
value={data[key]}
handleStateChange={value =>
this.handleStateChange({ key, value })
}
/>
{Component && (
<Component
options={newOptions}
value={data[key]}
handleStateChange={value =>
this.handleStateChange({ key, value })
}
/>
)}
</div>
);
return '';
Expand Down

This file was deleted.

3 changes: 1 addition & 2 deletions client/src/components/StepsQuestions/subcomponents/index.js
Original file line number Diff line number Diff line change
@@ -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 };
2 changes: 1 addition & 1 deletion client/src/staticDataSet/questions.js
Original file line number Diff line number Diff line change
@@ -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' },
{
Expand Down

0 comments on commit 4781888

Please sign in to comment.