forked from p34709852/monkey
Now that findings are aggregated, added events amount counter badge
This commit is contained in:
parent
3f2d5b1479
commit
e7953defdc
|
@ -1,9 +1,7 @@
|
||||||
import React, {Component} from "react";
|
import React, {Component, Fragment} from "react";
|
||||||
import EventsModal from "./EventsModal";
|
import EventsModal from "./EventsModal";
|
||||||
import {Button} from "react-bootstrap";
|
import {Badge, Button} from "react-bootstrap";
|
||||||
import FileSaver from "file-saver";
|
|
||||||
import * as PropTypes from "prop-types";
|
import * as PropTypes from "prop-types";
|
||||||
import ExportEventsButton from "./ExportEventsButton";
|
|
||||||
|
|
||||||
export default class EventsButton extends Component {
|
export default class EventsButton extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -22,16 +20,21 @@ export default class EventsButton extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
let eventsAmountBadge;
|
||||||
<div>
|
if (this.props.events.length > 10) {
|
||||||
<EventsModal events={this.props.events} showEvents={this.state.isShow} hideCallback={this.hide} exportFilename={this.props.exportFilename} />
|
eventsAmountBadge = <Badge>9+</Badge>;
|
||||||
|
} else {
|
||||||
|
eventsAmountBadge = <Badge>{this.props.events.length}</Badge>;
|
||||||
|
}
|
||||||
|
return <Fragment>
|
||||||
|
<EventsModal events={this.props.events} showEvents={this.state.isShow} hideCallback={this.hide}
|
||||||
|
exportFilename={this.props.exportFilename}/>
|
||||||
<div className="text-center" style={{"display": "grid"}}>
|
<div className="text-center" style={{"display": "grid"}}>
|
||||||
<Button className="btn btn-primary btn-lg" onClick={this.show}>
|
<Button className="btn btn-primary btn-lg" onClick={this.show}>
|
||||||
<i className="fa fa-list"/> Events
|
<i className="fa fa-list"/> Events {eventsAmountBadge}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Fragment>;
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue