Skip to content
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

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ASPhillips8
Copy link

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)
Screenshot 2024-06-16 at 1 25 19 PM

Copy link

@stephenmckeon stephenmckeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have console.logs 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.


import hogs from "../porkers_data";

function App() {
console.log(hogs)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log(hogs)

Comment on lines 16 to 22
return (
<div className="App">
<Nav />
<Form onAddPig={handleAddingNewPig}/>
<PigsList hogs={hogslist}/>
</div>
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This spacing is crazy.

Comment on lines 3 to 5
function Filter ({onCategoryChange}) {

return (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

STOP DOING THIS!!!

Suggested change
function Filter ({onCategoryChange}) {
return (
function Filter ({ onCategoryChange }) {
return (

Comment on lines 13 to 15
</div>
);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
</div>
);
}
</div>
);
}

Comment on lines 26 to 80
// 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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

....

Comment on lines 3 to 21
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>
);
}

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.

@ASPhillips8 ASPhillips8 marked this pull request as draft June 17, 2024 13:02
@ASPhillips8
Copy link
Author

ASPhillips8 commented Jun 17, 2024

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

Copy link

@stephenmckeon stephenmckeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants