accounts-ui/imports/ui/components/PasswordOrService.jsx
Tim Brandin 9bba8e5ab8 * Buttons for oauth services
* Option for "NO_PASSWORD" changed to "EMAIL_ONLY_NO_PASSWORD"
* Added new options to accounts-password "USERNAME_AND_EMAIL_NO_PASSWORD".
2016-03-31 15:57:28 +02:00

28 lines
700 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react';
import { Accounts } from 'meteor/accounts-base';
import { T9n } from 'meteor/softwarerero:accounts-t9n';
export class PasswordOrService extends React.Component {
render () {
let {
oauthServices = {},
className,
style = {}
} = this.props;
let labels = Object.keys(oauthServices).map(service => oauthServices[service].label);
if (labels.length > 2) {
labels = [];
}
if (labels.length) {
return (
<div style={ style } className={ className }>
{ `${T9n.get('or use')} ${ labels.join(' / ') }` }
</div>
);
}
return null;
}
}
Accounts.ui.PasswordOrService = PasswordOrService;