2015-05-29 01:54:56 +02:00
|
|
|
import React from 'react';
|
|
|
|
import AlertDismissable from '../components/ascribe_forms/alert';
|
|
|
|
|
|
|
|
let AlertMixin = {
|
|
|
|
setAlerts(errors){
|
|
|
|
let alerts = errors.map(
|
|
|
|
function(error) {
|
2015-05-29 15:16:42 +02:00
|
|
|
return <AlertDismissable error={error} key={error}/>;
|
2015-05-29 01:54:56 +02:00
|
|
|
}.bind(this)
|
|
|
|
);
|
2015-05-29 15:16:42 +02:00
|
|
|
this.setState({alerts: alerts});
|
2015-05-29 10:58:07 +02:00
|
|
|
},
|
|
|
|
clearAlerts(){
|
|
|
|
this.setState({alerts: null});
|
2015-05-29 01:54:56 +02:00
|
|
|
}
|
2015-05-29 10:58:07 +02:00
|
|
|
|
2015-05-29 01:54:56 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default AlertMixin;
|