-
Notifications
You must be signed in to change notification settings - Fork 17
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
Exquisite Corpse #8
base: master
Are you sure you want to change the base?
Conversation
} | ||
|
||
addFavourites(corpseitem) { | ||
this.setState({ |
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.
rather than using a callback here, it would be better to use
const favourites = this.state.favourites.concat(corpseitem);
this.setState({
favourites: favourites
});
window.localStorage.setItem('favourites', favourites);
src/components/App.js
Outdated
} | ||
|
||
removeFromFavourites(corpseitem) { | ||
const filteredFavourites = this.state.favourites.filter(currentFavourite => { |
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.
nice
src/components/Favourite.js
Outdated
|
||
const favouriteclasses = cx('workshop__favourite', { | ||
'active': this.state.active, | ||
'': !this.state.active |
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.
I don't think this line is needed as it will insert nothing in both cases
src/components/Generate.js
Outdated
function Generate({receiveType, typeresult1, typeresult2, favourites, addFavourites, removeFromFavourites}) { | ||
|
||
function handleChange1(event) { | ||
receiveType(event.target.value, 'type1'); |
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.
I wonder if type1
and type2
could have more descriptive names as they seem a bit vague
src/components/GenerateCorpse.js
Outdated
|
||
const corpsesclasses = cx('generate__corpses menu--settings', { | ||
'active': notEmpty && sameLength, | ||
'': !(notEmpty && sameLength) |
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.
I don't think this line needed. It does not add any classes
Great work |
In development…