-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Created Pig App #18
base: master
Are you sure you want to change the base?
Created Pig App #18
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have console.log
s lingering, commented out code, and terrible line spacing. This is not final draft work. Please go back and clean this up, and then I'll review the code once you do that.
src/components/App.js
Outdated
|
||
import hogs from "../porkers_data"; | ||
|
||
function App() { | ||
console.log(hogs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log(hogs) |
src/components/App.js
Outdated
return ( | ||
<div className="App"> | ||
<Nav /> | ||
<Form onAddPig={handleAddingNewPig}/> | ||
<PigsList hogs={hogslist}/> | ||
</div> | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This spacing is crazy.
src/components/Filter.jsx
Outdated
function Filter ({onCategoryChange}) { | ||
|
||
return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
STOP DOING THIS!!!
function Filter ({onCategoryChange}) { | |
return ( | |
function Filter ({ onCategoryChange }) { | |
return ( |
src/components/Filter.jsx
Outdated
</div> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
</div> | |
); | |
} | |
</div> | |
); | |
} |
src/components/Form.jsx
Outdated
// return ( | ||
// <form onSubmit={handleSubmit}> | ||
// <input | ||
// type="text" | ||
// name="name" | ||
// placeholder="Name" | ||
// value={formData.name} | ||
// onChange={handleChange} | ||
// /> | ||
// <input | ||
// type="text" | ||
// name="image" | ||
// placeholder="Image URL" | ||
// value={formData.image} | ||
// onChange={handleChange} | ||
// /> | ||
// <input | ||
// type="checkbox" | ||
// name="greased" | ||
// checked={formData.greased} | ||
// onChange={handleChange} | ||
// /> | ||
// <input | ||
// type="text" | ||
// name="specialty" | ||
// placeholder="Specialty" | ||
// value={formData.specialty} | ||
// onChange={handleChange} | ||
// /> | ||
// <input | ||
// type="number" | ||
// name="weight" | ||
// placeholder="Weight" | ||
// value={formData.weight} | ||
// onChange={handleChange} | ||
// /> | ||
// <input | ||
// type="text" | ||
// name="medal" | ||
// placeholder="Highest Medal Achieved" | ||
// value={formData.medal} | ||
// onChange={handleChange} | ||
// /> | ||
// <input | ||
// type="checkbox" | ||
// name="visible" | ||
// checked={formData.visible} | ||
// onChange={handleChange} | ||
// /> | ||
// <button type="submit">Add Pig</button> | ||
// </form> | ||
// ); | ||
// }; | ||
|
||
// export default Form; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
....
src/components/Form.jsx
Outdated
function Form({onAddPig}) { | ||
const [formData, setFormData] = useState ('') | ||
|
||
console.log(onAddPig) | ||
return ( | ||
<div> | ||
<form onSubmit={onAddPig}> | ||
<input type="text" id="name" name="name" placeholder="Name"></input> | ||
<input type="text" id="image" name="image" placeholder="Image URL"></input> | ||
<input type="text" id="specialty" name="specialty" placeholder="Specialty"></input> | ||
<input type="text" id="weight" name="weight" placeholder="Weight"></input> | ||
<input type="text" id="medal" name="medal" placeholder="Highest Medal Achieved"></input> | ||
<label>Greased?</label> | ||
<input type="checkbox" id="greased" name="Greased"/> | ||
<button type="submit">Add Pig</button> | ||
</form> | ||
</div> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be cleaned up.
Still working on the form bonus deliverables and will be coming back to practice. Code for Form Component is NOT in working state and does not have function yet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Added list of pigs that shows image and name of pig when app first loads. Added event listener that shows pig details in pig card is clicked. Add Component that filters the pigs that that are greased and not greased. Added a Sort Component that sorts pigs through event listening based on the weight of the pig or the name of the pig. Both sorts are done in acceding order. All Deliverables had been achieved. Started to add Form Component to add new Pig (future commits)