mirror of
https://github.com/wassname/talk.git
synced 2026-07-06 03:41:46 +08:00
25 lines
673 B
JavaScript
25 lines
673 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.toJS().loggedIn
|
|
});
|
|
|
|
const mapDispatchToProps = dispatch =>
|
|
bindActionCreators({showSignInDialog}, dispatch);
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(SignInButton);
|