Skip to content

Commit

Permalink
make is simple
Browse files Browse the repository at this point in the history
  • Loading branch information
atherdon committed May 29, 2018
1 parent 449ca36 commit ef1a7b2
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 27 deletions.
33 changes: 6 additions & 27 deletions src/components/SearchForm/SearchForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import Diet from './Diet/Diet'
import Holiday from './Holiday/Holiday'
import Ingredient from './Ingredient/Ingredient'

import Test from './Test/Test'

const InputGroup = Input.Group;

class SearchForm extends Component {
Expand Down Expand Up @@ -151,7 +153,7 @@ class SearchForm extends Component {
sign={true} passedSelected={this.state.dontWantOnHolidays}
placeholder="Holidays/Specific You want" />
<Holiday updateHoliday={this.updateDontWantOnHolidays.bind(this)}
sign={false} passedSelected={this.state.wantOnHolidays}
sign={false} passedSelected={this.state.wantOnHolidays}
placeholder="Holidays/Specific You don't want" />
</InputGroup>
<br />
Expand All @@ -160,32 +162,9 @@ class SearchForm extends Component {
Search Recipes
</Button>
</Form>
<hr />
<div>
<label>Maximum cooking time: {this.state.maxTime}</label>
<br />
<label>Ingredients you have: {this.state.haveIngredients}</label>
<br />
<label>Ingredients you don't have: {this.state.dontHaveIngredients}</label>
<br />
<label>Allergies: {this.state.allergies}</label>
<br />
<label>Specific diets: {this.state.specificDiets}</label>
<br />
<label>Cuisines you like: {this.state.likeCuisines}</label>
<br />
<label>Cuisines you don't like: {this.state.dontLikeCuisines}</label>
<br />
<label>Courses you want: {this.state.wantCourses}</label>
<br />
<label>Courses you don't want: {this.state.dontWantCourses}</label>
<br />
<label>Holidays you want: {this.state.wantOnHolidays}</label>
<br />
<label>Holidays you don't want: {this.state.dontWantOnHolidays}</label>
<br />
<br />
</div>

<Test data={this.state} />

This comment has been minimized.

Copy link
@chauhannishith

chauhannishith May 30, 2018

Contributor

@atherdon This will behave as static component so you wont see the changes like before


</div>
);
}
Expand Down
43 changes: 43 additions & 0 deletions src/components/SearchForm/Test/Test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React, { Component } from 'react';


class Test extends Component {
constructor(props) {
super(props)

this.state = props.data;
}

render(){

return (
<div>
<hr />
<label>Maximum cooking time: {this.state.maxTime}</label>
<br />
<label>Ingredients you have: {this.state.haveIngredients}</label>
<br />
<label>Ingredients you don't have: {this.state.dontHaveIngredients}</label>
<br />
<label>Allergies: {this.state.allergies}</label>
<br />
<label>Specific diets: {this.state.specificDiets}</label>
<br />
<label>Cuisines you like: {this.state.likeCuisines}</label>
<br />
<label>Cuisines you don't like: {this.state.dontLikeCuisines}</label>
<br />
<label>Courses you want: {this.state.wantCourses}</label>
<br />
<label>Courses you don't want: {this.state.dontWantCourses}</label>
<br />
<label>Holidays you want: {this.state.wantOnHolidays}</label>
<br />
<label>Holidays you don't want: {this.state.dontWantOnHolidays}</label>
<br />
<br />
</div>
);
}
}
export default Test;

0 comments on commit ef1a7b2

Please sign in to comment.