1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 09:35:10 +01:00
onion/js/mixins/alert_mixin.js

19 lines
496 B
JavaScript
Raw Normal View History

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