generated from WildCodeSchool/create-js-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b28a29
commit 34387ca
Showing
5 changed files
with
159 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
function Step1() { | ||
import PropTypes from "prop-types"; | ||
|
||
function Step1({ name, image, description }) { | ||
return ( | ||
<div> | ||
<h1>Step 1</h1> | ||
<p>Step 1</p> | ||
<p>{name}</p> | ||
<p>{image}</p> | ||
<p>{description}</p> | ||
</div> | ||
); | ||
} | ||
Step1.propTypes = { | ||
name: PropTypes.string.isRequired, | ||
image: PropTypes.string.isRequired, | ||
description: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default Step1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,41 @@ | ||
function Step2() { | ||
import PropTypes from "prop-types"; | ||
|
||
function Step2({ ingredient, material }) { | ||
return ( | ||
<div> | ||
<h1>Step 1</h1> | ||
<h1>Step 2</h1> | ||
<div> | ||
<label htmlFor="select-ingredient"> | ||
<select id="select-ingredient"> | ||
<option value="">Choisir son ingredient :</option> | ||
{ingredient && | ||
ingredient.map((ingr) => ( | ||
<option key={ingr.ID} value={ingr.name}> | ||
{ingr.name} {ingr.kcal} {ingr.unit} | ||
</option> | ||
))} | ||
</select> | ||
</label> | ||
</div> | ||
<div> | ||
<label htmlFor="select-material"> | ||
<select id="select-material"> | ||
<option value="">Choisir son materiel :</option> | ||
{material && | ||
material.map((mate) => ( | ||
<option key={mate.ID} value={mate.name}> | ||
{mate.name} | ||
</option> | ||
))} | ||
</select> | ||
</label> | ||
</div> | ||
</div> | ||
); | ||
} | ||
Step2.propTypes = { | ||
ingredient: PropTypes.string.isRequired, | ||
material: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default Step2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
function Step3() { | ||
import PropTypes from "prop-types"; | ||
|
||
function Step3({ instruction }) { | ||
return ( | ||
<div> | ||
<h1>Step 1</h1> | ||
<h1>Step 3</h1> | ||
<h2>Instructions</h2> | ||
<form> | ||
<input | ||
id="instructtionInput" | ||
type="text" | ||
name="instruction" | ||
placeholder="instructions" | ||
value={instruction} | ||
/> | ||
</form> | ||
</div> | ||
); | ||
} | ||
Step3.propTypes = { | ||
instruction: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default Step3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
function Step4() { | ||
import PropTypes from "prop-types"; | ||
|
||
function Step4({ post }) { | ||
return ( | ||
<div> | ||
<h1>Step 1</h1> | ||
<h1>Step 4</h1> | ||
<button type="submit" onClick={post}> | ||
Poster la recette | ||
</button> | ||
</div> | ||
); | ||
} | ||
Step4.propTypes = { | ||
post: PropTypes.func.isRequired, | ||
}; | ||
|
||
export default Step4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters