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

Completed Hogwild #17

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

cmhorsey
Copy link

Wrote components to display, filter, sort, and create new hogs.

Comment on lines 15 to 25
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>
);
)
}

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?!

Copy link
Author

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.

Comment on lines +19 to +23
<>
<button onClick={handleClick}>
{buttonText}
</button>
</>

Choose a reason for hiding this comment

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

Suggested change
<>
<button onClick={handleClick}>
{buttonText}
</button>
</>
<button onClick={handleClick}>
{buttonText}
</button>

Comment on lines +17 to +21
<>
<button onClick={handleClick}>
{buttonText}
</button>
</>

Choose a reason for hiding this comment

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

Same thing here.

Comment on lines +4 to +33
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)
}

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.

Comment on lines +52 to +59
<>
<button onClick={handleNameClick}>
{sortButtonName}
</button>
<button onClick={handleWeightClick}>
{sortButtonWeight}
</button>
</>

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.

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