Skip to content

Commit

Permalink
Added documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
timbrandin committed Jan 6, 2017
1 parent c948fd3 commit 4a34ee2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions imports/ui/components/FormMessage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Accounts } from 'meteor/accounts-base';
export class FormMessage extends React.Component {
render () {
let { message, type, className = "message", style = {}, deprecated } = this.props;
// XXX Check for deprecations.
if (deprecated) {
// 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');
Expand Down
10 changes: 5 additions & 5 deletions imports/ui/components/LoginForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -904,14 +904,14 @@ export class LoginForm extends Tracker.Component {
this.setState({ messages: [] });
}

componentWillMount() {
// Check for backwards compatibility.
this.props.message = 'test';
componentDidMount() {
// XXX Check for backwards compatibility.
const container = document.createElement('div');
ReactDOM.render(<Accounts.ui.Field message="test" />, container);
if (container.getElementsByClassName('message').length == 0) {
// 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`);
}
}

Expand All @@ -923,7 +923,7 @@ export class LoginForm extends Tracker.Component {

render() {
this.oauthButtons();
// Backwords compatibility with v1.3.x.
// Backwords compatibility with v1.2.x.
const { messages = [] } = this.state;
const message = {
deprecated: true,
Expand Down

0 comments on commit 4a34ee2

Please sign in to comment.