mirror of
https://github.com/wassname/talk.git
synced 2026-06-28 20:41:01 +08:00
25 lines
680 B
JavaScript
25 lines
680 B
JavaScript
import React from 'react';
|
|
import {Button} from 'coral-ui';
|
|
import {connect} from 'react-redux';
|
|
import {bindActionCreators} from 'redux';
|
|
import {showSignInDialog} from 'coral-framework/actions/auth';
|
|
|
|
const SignInButton = ({loggedIn, showSignInDialog}) => (
|
|
<div>
|
|
{
|
|
!loggedIn ? (
|
|
<Button id="coralSignInButton" onClick={showSignInDialog} full>
|
|
Sign in to comment
|
|
</Button>
|
|
) : null
|
|
}
|
|
</div>
|
|
);
|
|
|
|
const mapStateToProps = ({auth}) => ({loggedIn: auth.loggedIn});
|
|
|
|
const mapDispatchToProps = dispatch =>
|
|
bindActionCreators({showSignInDialog}, dispatch);
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(SignInButton);
|