import React, { PropTypes, Component } from 'react'; import { Alert } from 'react-bootstrap'; //import { Messages } from "meteor/nova:core"; class Flash extends Component{ constructor() { super(); this.dismissFlash = this.dismissFlash.bind(this); } componentDidMount() { this.props.markAsSeen(this.props.message._id); } dismissFlash(e) { e.preventDefault(); this.props.clear(this.props.message._id); } render() { let flashType = this.props.message.flashType; flashType = flashType === "error" ? "danger" : flashType; // if flashType is "error", use "danger" instead return ( {this.props.message.content} ) } } Flash.propTypes = { message: React.PropTypes.object.isRequired } module.exports = Flash;