RegisterInvite: convert to TSX
This commit is contained in:
parent
dd4f41f246
commit
40f3b769fc
2 changed files with 43 additions and 49 deletions
|
@ -1,49 +0,0 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import RegistrationForm from 'soapbox/features/auth_login/components/registration_form';
|
||||
|
||||
const mapStateToProps = state => {
|
||||
return {
|
||||
siteTitle: state.getIn(['instance', 'title']),
|
||||
};
|
||||
};
|
||||
|
||||
export default @connect(mapStateToProps)
|
||||
class RegisterInvite extends React.Component {
|
||||
|
||||
static propTypes = {
|
||||
params: PropTypes.object.isRequired,
|
||||
siteTitle: PropTypes.string.isRequired,
|
||||
}
|
||||
|
||||
render() {
|
||||
const { siteTitle, params } = this.props;
|
||||
|
||||
return (
|
||||
<div className='register-invite'>
|
||||
<div className='register-invite__header'>
|
||||
<h1 className='register-invite__title'>
|
||||
<FormattedMessage
|
||||
id='register_invite.title'
|
||||
defaultMessage="You've been invited to join {siteTitle}!"
|
||||
values={{ siteTitle }}
|
||||
/>
|
||||
</h1>
|
||||
<p className='register-invite__lead'>
|
||||
<FormattedMessage
|
||||
id='register_invite.lead'
|
||||
defaultMessage='Complete the form below to create an account.'
|
||||
/>
|
||||
</p>
|
||||
</div>
|
||||
<div className='register-invite__form'>
|
||||
<RegistrationForm inviteToken={params.token} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
43
app/soapbox/features/register_invite/index.tsx
Normal file
43
app/soapbox/features/register_invite/index.tsx
Normal file
|
@ -0,0 +1,43 @@
|
|||
import React from 'react';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import RegistrationForm from 'soapbox/features/auth_login/components/registration_form';
|
||||
import { useAppSelector } from 'soapbox/hooks';
|
||||
|
||||
interface IRegisterInvite {
|
||||
/** URL params. */
|
||||
params: {
|
||||
/** Invite token from the URL. */
|
||||
token: string,
|
||||
},
|
||||
}
|
||||
|
||||
/** Page to register with an invitation. */
|
||||
const RegisterInvite: React.FC<IRegisterInvite> = ({ params }) => {
|
||||
const siteTitle = useAppSelector(state => state.instance.title);
|
||||
|
||||
return (
|
||||
<div className='register-invite'>
|
||||
<div className='register-invite__header'>
|
||||
<h1 className='register-invite__title'>
|
||||
<FormattedMessage
|
||||
id='register_invite.title'
|
||||
defaultMessage="You've been invited to join {siteTitle}!"
|
||||
values={{ siteTitle }}
|
||||
/>
|
||||
</h1>
|
||||
<p className='register-invite__lead'>
|
||||
<FormattedMessage
|
||||
id='register_invite.lead'
|
||||
defaultMessage='Complete the form below to create an account.'
|
||||
/>
|
||||
</p>
|
||||
</div>
|
||||
<div className='register-invite__form'>
|
||||
<RegistrationForm inviteToken={params.token} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default RegisterInvite;
|
Loading…
Reference in a new issue