diff --git a/src/components/growl/Growl.js b/src/components/growl/Growl.js index ff01a15a10..288acf0a57 100644 --- a/src/components/growl/Growl.js +++ b/src/components/growl/Growl.js @@ -14,7 +14,7 @@ export class Growl extends Component { className: null, style: null, baseZIndex: 0, - position: 'topright', + position: 'top-right', onClick: null, onRemove: null } @@ -30,9 +30,10 @@ export class Growl extends Component { }; constructor(props) { - super(props) + super(props); + this.state = { - messages: [] + messages: [] }; this.onClose = this.onClose.bind(this); @@ -66,7 +67,7 @@ export class Growl extends Component { messages: [] }) } - + onClose(message) { let newMessages = this.state.messages.filter(msg => msg.id !== message.id); this.setState({ @@ -77,21 +78,22 @@ export class Growl extends Component { this.props.onRemove(message); } } - + render() { - let className = classNames('p-growl p-component p-growl-' + this.props.position, this.props.className); + let className = classNames('p-toast p-component p-toast-' + this.props.position, this.props.className); return (
{ this.container = el; }} id={this.props.id} className={className} style={this.props.style}> - {this.state.messages.map((message) => - - - - )} + { + this.state.messages.map((message) => + + + + ) + }
- ); + ); } -} \ No newline at end of file +}