Merge pull request #26 from Luminarys/master

Display upload and download for infinite ratio
This commit is contained in:
Drew DeVault 2018-01-17 00:20:11 -05:00 committed by GitHub
commit 3de379d742
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,17 +11,10 @@ export default function Ratio({ up, down }) {
<span></span> <span></span>
</span>; </span>;
} }
if (!isFinite(ratio)) {
return <span class="ratio">
<strong></strong>
<span></span>
<span></span>
</span>;
}
return ( return (
<span class="ratio"> <span class="ratio">
<span> <span>
{`${ratio.toFixed(2)}`} {isFinite(ratio) ? `${ratio.toFixed(2)}` : "∞"}
</span> </span>
<span>{formatAmount(up)} <FontAwesome name="arrow-up" /></span> <span>{formatAmount(up)} <FontAwesome name="arrow-up" /></span>
<span>{`${formatAmount(down)}`} <FontAwesome name="arrow-down" /></span> <span>{`${formatAmount(down)}`} <FontAwesome name="arrow-down" /></span>