Phyks (Lucas Verney)
fffe9c4cd3
Major code review, cleaning the code and adding a lot of comments. Also implements a separate store to keep entities with a reference count and garbage collection. This closes #15. Known issues at the moment are: * Webplayer is no longer working, it has to be refactored. * AlbumPage is to be implemented.
32 lines
846 B
JavaScript
32 lines
846 B
JavaScript
// NPM imports
|
|
import React, { Component, PropTypes } from "react";
|
|
|
|
|
|
/**
|
|
* A dismissible Bootstrap alert.
|
|
*/
|
|
export default class DismissibleAlert extends Component {
|
|
render () {
|
|
// Set correct alert type
|
|
let alertType = "alert-danger";
|
|
if (this.props.type) {
|
|
alertType = "alert-" + this.props.type;
|
|
}
|
|
|
|
return (
|
|
<div className={["alert", alertType].join(" ")} role="alert">
|
|
<p>
|
|
<button type="button" className="close" data-dismiss="alert" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
{this.props.text}
|
|
</p>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
DismissibleAlert.propTypes = {
|
|
type: PropTypes.string,
|
|
text: PropTypes.string
|
|
};
|