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

50 lines
1.5 KiB
JavaScript
Raw Normal View History

2020-04-14 14:37:17 -07:00
import PropTypes from 'prop-types';
import React from 'react';
2020-04-01 13:31:40 -07:00
import { FormattedMessage, injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { getSoapboxConfig } from 'soapbox/actions/soapbox';
2022-01-10 14:01:24 -08:00
import SoapboxPropTypes from 'soapbox/utils/soapbox_prop_types';
2020-03-27 13:59:38 -07:00
2020-04-01 13:31:40 -07:00
const mapStateToProps = state => {
const soapboxConfig = getSoapboxConfig(state);
2020-04-01 13:31:40 -07:00
return {
siteTitle: state.getIn(['instance', 'title']),
me: state.get('me'),
singleUserMode: soapboxConfig.get('singleUserMode'),
2020-04-01 13:31:40 -07:00
};
};
const SignUpPanel = ({ siteTitle, me, singleUserMode }) => {
if (me || singleUserMode) return null;
2020-03-27 13:59:38 -07:00
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,
singleUserMode: PropTypes.bool,
2020-04-14 14:37:17 -07:00
};
2020-04-01 13:31:40 -07:00
export default injectIntl(connect(mapStateToProps)(SignUpPanel));