bigbuffet-rw/app/soapbox/features/ui/components/sign_up_panel.js

44 lines
1.3 KiB
JavaScript
Raw Normal View History

2020-03-27 13:59:38 -07:00
import React from 'react';
2020-04-14 14:37:17 -07:00
import PropTypes from 'prop-types';
2020-05-28 15:52:07 -07:00
import SoapboxPropTypes from 'soapbox/utils/soapbox_prop_types';
2020-04-01 13:31:40 -07:00
import { connect } from 'react-redux';
import { FormattedMessage, injectIntl } from 'react-intl';
2020-03-27 13:59:38 -07:00
2020-04-01 13:31:40 -07:00
const mapStateToProps = state => {
return {
siteTitle: state.getIn(['instance', 'title']),
me: state.get('me'),
2020-04-01 13:31:40 -07:00
};
};
const SignUpPanel = ({ siteTitle, me }) => {
2020-03-27 13:59:38 -07:00
if (me) return null;
return (
<div className='wtf-panel'>
<div className='wtf-panel-header'>
<span className='wtf-panel-header__label'>
2020-04-14 11:44:40 -07:00
<FormattedMessage id='signup_panel.title' defaultMessage='New to {site_title}?' values={{ site_title: siteTitle }} />
2020-03-27 13:59:38 -07:00
</span>
</div>
<div className='wtf-panel__content'>
<span className='wtf-panel__subtitle'>
<FormattedMessage id='signup_panel.subtitle' defaultMessage='Sign up now to discuss.' />
</span>
<div className='wtf-panel__form'>
2020-06-07 14:55:28 -07:00
<a className='button' href='/'>
2020-03-27 13:59:38 -07:00
<FormattedMessage id='account.register' defaultMessage='Sign up' />
</a>
</div>
</div>
</div>
2020-04-14 11:44:40 -07:00
);
};
2020-03-27 13:59:38 -07:00
2020-04-14 14:37:17 -07:00
SignUpPanel.propTypes = {
siteTitle: PropTypes.string,
2020-04-27 11:56:26 -07:00
me: SoapboxPropTypes.me,
2020-04-14 14:37:17 -07:00
};
2020-04-01 13:31:40 -07:00
export default injectIntl(connect(mapStateToProps)(SignUpPanel));