2015-06-05 11:06:36 +02:00
|
|
|
'use strict';
|
|
|
|
|
2015-05-29 01:54:56 +02:00
|
|
|
import React from 'react';
|
|
|
|
import AlertDismissable from '../components/ascribe_forms/alert';
|
|
|
|
|
|
|
|
let AlertMixin = {
|
|
|
|
setAlerts(errors){
|
2015-06-05 11:06:36 +02:00
|
|
|
let alerts = errors.map((error) => {
|
|
|
|
return <AlertDismissable error={error} key={error}/>;
|
|
|
|
});
|
|
|
|
|
2015-05-29 15:16:42 +02:00
|
|
|
this.setState({alerts: alerts});
|
2015-05-29 10:58:07 +02:00
|
|
|
},
|
2015-06-05 11:06:36 +02:00
|
|
|
|
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;
|