Skip to content

Instantly share code, notes, and snippets.

@funador
Last active July 26, 2018 00:24
Show Gist options
  • Save funador/4dea23e26071933af5f9382faea7727c to your computer and use it in GitHub Desktop.
Save funador/4dea23e26071933af5f9382faea7727c to your computer and use it in GitHub Desktop.
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