2016-06-14 10:45:03 +09:00
|
|
|
import React, { PropTypes, Component } from 'react';
|
|
|
|
import { Alert } from 'react-bootstrap';
|
|
|
|
|
2016-06-19 12:57:23 +09:00
|
|
|
const Flash = ({message}) => {
|
2016-06-14 10:45:03 +09:00
|
|
|
|
2016-06-19 12:57:23 +09:00
|
|
|
let type = message.type;
|
2016-06-14 10:45:03 +09:00
|
|
|
type = type === "error" ? "danger" : type; // if type is "error", use "danger" instead
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Alert className="flash-message" bsStyle={type}>
|
2016-06-19 12:57:23 +09:00
|
|
|
{message.content}
|
2016-06-14 10:45:03 +09:00
|
|
|
</Alert>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
Flash.propTypes = {
|
|
|
|
message: React.PropTypes.object.isRequired
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Flash;
|