Last active
July 26, 2018 00:24
-
-
Save funador/4dea23e26071933af5f9382faea7727c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default class App extends Component { | |
| // previously written lifecycle and custom methods | |
| // .... | |
| render() { | |
| const { name, photo} = this.state.user | |
| const { disabled } = this.state | |
| return ( | |
| <div className={'container'}> | |
| {/* Show the user if it exists. Otherwise show the login button */} | |
| {name | |
| ? <div className={'card'}> | |
| <img src={photo} alt={name} /> | |
| <FontAwesome | |
| name={'times-circle'} | |
| className={'close'} | |
| onClick={this.closeCard.bind(this)} | |
| /> | |
| <h4>{`@${name}`}</h4> | |
| </div> | |
| : <div className={'button'}> | |
| <button | |
| onClick={this.startAuth.bind(this)} | |
| className={`twitter ${disabled}`} | |
| > | |
| <FontAwesome | |
| name={'twitter'} | |
| /> | |
| </button> | |
| </div> | |
| } | |
| <Footer /> | |
| </div> | |
| ) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment