Skip to content

Instantly share code, notes, and snippets.

@dbismut
Created April 9, 2018 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbismut/9808769f289eb4bb377facbfefb38001 to your computer and use it in GitHub Desktop.
Save dbismut/9808769f289eb4bb377facbfefb38001 to your computer and use it in GitHub Desktop.
Part 3 - changing the render to implement the close icon state
render() {
/* ... */
const { closeInverted, dragProgress } = this.state; // change the state
return (
/* same code */
// this will add the invert class
// when this.state.closeInverted is true
<div
className={cn('close', { invert: closeInverted })}
onClick={() => navigateTo('home')}
/>
/* same code */
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment