Added documentation.

This commit is contained in:
Tim Brandin 2017-01-06 12:49:09 +01:00
parent c948fd3462
commit 4a34ee2200
2 changed files with 6 additions and 5 deletions

View file

@ -4,6 +4,7 @@ import { Accounts } from 'meteor/accounts-base';
export class FormMessage extends React.Component { export class FormMessage extends React.Component {
render () { render () {
let { message, type, className = "message", style = {}, deprecated } = this.props; let { message, type, className = "message", style = {}, deprecated } = this.props;
// XXX Check for deprecations.
if (deprecated) { if (deprecated) {
// Found backwords compatibility issue. // Found backwords compatibility issue.
console.warn('You are overriding Accounts.ui.Form and using FormMessage, the use of FormMessage in Form has been depreacted in v1.3.0, update your implementation to use FormMessages: https://github.com/studiointeract/accounts-ui/#deprecations'); console.warn('You are overriding Accounts.ui.Form and using FormMessage, the use of FormMessage in Form has been depreacted in v1.3.0, update your implementation to use FormMessages: https://github.com/studiointeract/accounts-ui/#deprecations');

View file

@ -904,14 +904,14 @@ export class LoginForm extends Tracker.Component {
this.setState({ messages: [] }); this.setState({ messages: [] });
} }
componentWillMount() { componentDidMount() {
// Check for backwards compatibility. // XXX Check for backwards compatibility.
this.props.message = 'test';
const container = document.createElement('div'); const container = document.createElement('div');
ReactDOM.render(<Accounts.ui.Field message="test" />, container); ReactDOM.render(<Accounts.ui.Field message="test" />, container);
if (container.getElementsByClassName('message').length == 0) { if (container.getElementsByClassName('message').length == 0) {
// Found backwards compatibility issue with 1.3.x // Found backwards compatibility issue with 1.3.x
console.warn('Implementations of Accounts.ui.Field must render message in v1.3.0 https://github.com/studiointeract/accounts-ui/#deprecations'); console.warn(`Implementations of Accounts.ui.Field must render message in v1.3.0.
https://github.com/studiointeract/accounts-ui/#deprecations`);
} }
} }
@ -923,7 +923,7 @@ export class LoginForm extends Tracker.Component {
render() { render() {
this.oauthButtons(); this.oauthButtons();
// Backwords compatibility with v1.3.x. // Backwords compatibility with v1.2.x.
const { messages = [] } = this.state; const { messages = [] } = this.state;
const message = { const message = {
deprecated: true, deprecated: true,