Skip to content

Commit

Permalink
silly meter tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
darkhappy committed Mar 2, 2020
1 parent 4b2e92d commit 47f9c77
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/components/SillyMeter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,26 @@ class SillyMeter extends Component {
formatValue = value => value.toFixed(0);
duration = 500;

getRawPercentage() {
const { sillyData } = this.props;
// if we're still loading, slap a 0 for niceness
if (sillyData.hp === undefined) {
return 0;
}

return sillyData.hp + " / 5000000";
}

render() {
return (
<div>
<h1>Silly Meter</h1>
<h5>
<span className={this.getStatus("status")}>
<span
className={this.getStatus("status")}
data-for="sillymeterETA"
data-tip={this.getRawPercentage()}
>
{this.getStatus("text")}{" "}
<AnimatedNumber
value={this.getPercentage()}
Expand Down

0 comments on commit 47f9c77

Please sign in to comment.