import React, { PropTypes, Component } from 'react'; import { Button, FormControl } from 'react-bootstrap'; import { Accounts } from 'meteor/std:accounts-ui'; const UsersAccountForm = () => { return ( ) }; module.exports = UsersAccountForm; export default UsersAccountForm; // customize Accounts.ui Accounts.ui.config({ passwordSignupFields: 'USERNAME_AND_EMAIL', onSignedInHook: () => {}, onSignedOutHook: () => {}, }); class AccountsButton extends Accounts.ui.Button { render () { const {label, href, type, disabled, className, onClick} = this.props; if (type === 'link') { return { label }; } return ; } } class AccountsField extends Accounts.ui.Field { // see https://github.com/studiointeract/accounts-ui/issues/60 triggerUpdate () { const { onChange } = this.props if (this.input) { onChange({ target: { value: this.input.value } }) } } render() { const { id, hint, /* label, */ type = 'text', onChange, className = "field", defaultValue = "" } = this.props; const { mount = true } = this.state; return mount ? (
) : null; } } // class AccountsSocialButtons extends Accounts.ui.SocialButtons { // render () { // let { oauthServices = {}, className = "social_buttons" } = this.props; // return( //
// {Object.keys(oauthServices) // .filter(service => oauthServices[service].disabled) // filter services registered but not enabled // .map((id, i) => )} //
// ); // } // } // class AccountsPasswordOrService extends Accounts.ui.PasswordOrService { // render () { // let { // oauthServices = {}, // className, // style = {} // } = this.props; // let { hasPasswordService } = this.state; // let labels = Object.keys(oauthServices) // .filter(service => oauthServices[service].disabled) // filter services registered but not enabled // .map(service => oauthServices[service].label); // if (labels.length > 2) { // labels = []; // } // if (hasPasswordService && labels.length > 0) { // return ( //
// { `${T9n.get('or use')} ${ labels.join(' / ') }` } //
// ); // } // return null; // } // } Accounts.ui.Button = AccountsButton; Accounts.ui.Field = AccountsField; // Accounts.ui.SocialButtons = AccountsSocialButtons; // Accounts.ui.PasswordOrService = AccountsPasswordOrService;