mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 09:35:10 +01:00
21 lines
423 B
JavaScript
21 lines
423 B
JavaScript
'use strict';
|
|
|
|
import React from 'react';
|
|
import AlertDismissable from '../components/ascribe_forms/alert';
|
|
|
|
let AlertMixin = {
|
|
setAlerts(errors){
|
|
let alerts = errors.map((error) => {
|
|
return <AlertDismissable error={error} key={error}/>;
|
|
});
|
|
|
|
this.setState({alerts: alerts});
|
|
},
|
|
|
|
clearAlerts(){
|
|
this.setState({alerts: null});
|
|
}
|
|
|
|
};
|
|
|
|
export default AlertMixin; |