mirror of
https://github.com/vale981/accounts-ui
synced 2025-03-04 17:31:41 -05:00
Added deprecation notice.
This commit is contained in:
parent
ac8c900f1d
commit
214dc5dfba
2 changed files with 12 additions and 1 deletions
|
@ -3,7 +3,11 @@ import { Accounts } from 'meteor/accounts-base';
|
|||
|
||||
export class FormMessage extends React.Component {
|
||||
render () {
|
||||
let { message, type, className = "message", style = {} } = this.props;
|
||||
let { message, type, className = "message", style = {}, deprecated } = this.props;
|
||||
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-in-v130');
|
||||
}
|
||||
message = _.isObject(message) ? message.message : message; // If message is object, then try to get message from it
|
||||
return message ? (
|
||||
<div style={ style }
|
||||
|
|
|
@ -911,12 +911,19 @@ export class LoginForm extends Tracker.Component {
|
|||
|
||||
render() {
|
||||
this.oauthButtons();
|
||||
// Backwords compatibility with v1.2.x.
|
||||
const { messages = [] } = this.state;
|
||||
const message = {
|
||||
deprecated: true,
|
||||
message: messages.map(({ message }) => message).join(', '),
|
||||
};
|
||||
return (
|
||||
<Accounts.ui.Form
|
||||
oauthServices={this.oauthButtons()}
|
||||
fields={this.fields()}
|
||||
buttons={this.buttons()}
|
||||
{...this.state}
|
||||
message={message}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue