-
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
Completed Hogwild #17
base: master
Are you sure you want to change the base?
Conversation
return ( | ||
<div className="App"> | ||
<Nav /> | ||
<PigForm hogs={hogs} allHogs={allHogs} setAllHogs={setAllHogs}/> | ||
<Filter hogs={hogs} allHogs={allHogs} setAllHogs={setAllHogs} /> | ||
<Sort allHogs={allHogs} setAllHogs={setAllHogs} hogs={hogs}/> | ||
<HideHogs allHogs={allHogs} setAllHogs={setAllHogs} hogs={hogs}/> | ||
<PigList className='ui grid container' hogs={hogs} allHogs={allHogs}/> | ||
</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.
Woah what's going on with the spacing here?!
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.
Thats a great question. I'll go back and clean this up.
<> | ||
<button onClick={handleClick}> | ||
{buttonText} | ||
</button> | ||
</> |
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.
<> | |
<button onClick={handleClick}> | |
{buttonText} | |
</button> | |
</> | |
<button onClick={handleClick}> | |
{buttonText} | |
</button> |
<> | ||
<button onClick={handleClick}> | ||
{buttonText} | ||
</button> | ||
</> |
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.
Same thing here.
const [newHogName, setNewHogName] = useState('') | ||
const [newHogSpecialty, setNewHogSpecialty] = useState('') | ||
const [newHogWeight, setNewHogWeight] = useState('') | ||
const [newHogGreased, setNewHogGreased] = useState('') | ||
const [newHogMedal, setNewHogMedal] = useState('') | ||
const [newHogImg, setNewHogImg] = useState('') | ||
|
||
function handleHogNameChange(event) { | ||
setNewHogName(event.target.value) | ||
} | ||
|
||
function handleHogSpecialtyChange(event) { | ||
setNewHogSpecialty(event.target.value) | ||
} | ||
|
||
function handleHogWeightChange(event) { | ||
setNewHogWeight(event.target.value) | ||
} | ||
|
||
function handleHogGreasedChange(event) { | ||
setNewHogGreased(event.target.value) | ||
} | ||
|
||
function handleHogsMedalChange(event) { | ||
setNewHogMedal(event.target.value) | ||
} | ||
|
||
function handleHogsImgChange(event) { | ||
setNewHogImg(event.target.value) | ||
} |
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.
If you review the form abstraction lesson you can find a much simpler way to do this.
<> | ||
<button onClick={handleNameClick}> | ||
{sortButtonName} | ||
</button> | ||
<button onClick={handleWeightClick}> | ||
{sortButtonWeight} | ||
</button> | ||
</> |
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.
When you use a fragment, you should still indent the content by 2 spaces.
Wrote components to display, filter, sort, and create new hogs.