Vulcan/packages/vulcan-accounts/imports/ui/components/EnrollAccount.jsx
Justin Reynolds 75b6ece0a4 Fix linting
2018-01-25 15:03:03 -06:00

41 lines
1.1 KiB
JavaScript

import { Components, registerComponent, withCurrentUser } from 'meteor/vulcan:core';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { intlShape } from 'meteor/vulcan:i18n';
import { STATES } from '../../helpers.js';
class AccountsEnrollAccount extends PureComponent {
componentDidMount() {
const token = this.props.params.token;
Accounts._loginButtonsSession.set('enrollAccountToken', token);
}
render() {
if (!this.props.currentUser) {
return (
<Components.AccountsLoginForm
formState={ STATES.ENROLL_ACCOUNT }
/>
);
} else {
return (
<div className='password-reset-form'>
<div>{this.context.intl.formatMessage({id: 'accounts.info_password_changed'})}!</div>
</div>
);
}
}
}
AccountsEnrollAccount.contextTypes = {
intl: intlShape
}
AccountsEnrollAccount.propsTypes = {
currentUser: PropTypes.object,
params: PropTypes.object,
};
AccountsEnrollAccount.displayName = 'AccountsEnrollAccount';
registerComponent('AccountsEnrollAccount', AccountsEnrollAccount, withCurrentUser);