mirror of
https://github.com/wassname/talk.git
synced 2026-06-28 22:04:50 +08:00
26 lines
765 B
JavaScript
26 lines
765 B
JavaScript
import React from 'react';
|
|
import {Button} from 'plugin-api/beta/client/components/ui';
|
|
import {connect} from 'react-redux';
|
|
import {bindActionCreators} from 'redux';
|
|
import {showSignInDialog} from 'coral-framework/actions/auth';
|
|
import t from 'coral-framework/services/i18n';
|
|
|
|
const SignInButton = ({loggedIn, showSignInDialog}) => (
|
|
<div>
|
|
{!loggedIn
|
|
? <Button id="coralSignInButton" onClick={showSignInDialog} full>
|
|
{t('sign_in.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);
|