SignInButton

This commit is contained in:
Belen Curcio
2017-05-19 19:29:50 -03:00
parent 3af49de0ce
commit dbfd2aff7c
5 changed files with 18 additions and 19 deletions
@@ -4,17 +4,19 @@ import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {showSignInDialog} from 'coral-framework/actions/auth';
class SignInButton extends React.Component {
render() {
return (
<Button id="coralSignInButton" onClick={this.props.showSignInDialog} full>
Sign in to comment
</Button>
);
}
}
const SignInButton = ({loggedIn, showSignInDialog}) => (
<div>
{
!loggedIn ? (
<Button id="coralSignInButton" onClick={showSignInDialog} full>
Sign in to comment
</Button>
) : null
}
</div>
);
const mapStateToProps = ({auth}) => ({auth});
const mapStateToProps = ({auth}) => ({loggedIn: auth.loggedIn});
const mapDispatchToProps = dispatch =>
bindActionCreators({showSignInDialog}, dispatch);