feat(dashboard-v2): use true reported bandwidth values

This commit is contained in:
Michał Leszczyk 2022-03-24 09:38:17 +01:00
parent 18600533eb
commit c964086f7b
No known key found for this signature in database
GPG Key ID: FA123CA8BAA2FBF4
1 changed files with 14 additions and 12 deletions

View File

@ -59,7 +59,7 @@ const Price = ({ price }) => (
</div> </div>
); );
const bandwidth = (value) => parseFloat(bytes(value, { bits: true, binary: true })); const bandwidth = (value) => `${bytes(value, { bits: true })}/s`;
const storage = (value) => bytes(value, { binary: true }); const storage = (value) => bytes(value, { binary: true });
@ -71,7 +71,7 @@ const PlansSlider = () => {
if (userError || plansError) { if (userError || plansError) {
return ( return (
<div className="flex items-center justify-center text-error"> <div className="flex flex-col items-center justify-center">
<h3>Oooops!</h3> <h3>Oooops!</h3>
<p>Something went wrong, please try again later.</p> <p>Something went wrong, please try again later.</p>
</div> </div>
@ -99,16 +99,18 @@ const PlansSlider = () => {
{!isHigherThanCurrent && !isCurrent && "Choose"} {!isHigherThanCurrent && !isCurrent && "Choose"}
</Button> </Button>
</div> </div>
<ul className="-ml-2"> {plan.limits && (
<PlanSummaryItem> <ul className="-ml-2">
Pin up to {storage(plan.limits.storageLimit)} of censorship-resistant storage <PlanSummaryItem>
</PlanSummaryItem> Pin up to {storage(plan.limits.storageLimit)} of censorship-resistant storage
<PlanSummaryItem> </PlanSummaryItem>
Support for up to {localizedNumber(plan.limits.maxNumberUploads)} files <PlanSummaryItem>
</PlanSummaryItem> Support for up to {localizedNumber(plan.limits.maxNumberUploads)} files
<PlanSummaryItem>{bandwidth(plan.limits.uploadBandwidth)} mbps upload bandwidth</PlanSummaryItem> </PlanSummaryItem>
<PlanSummaryItem>{bandwidth(plan.limits.downloadBandwidth)} mbps download bandwidth</PlanSummaryItem> <PlanSummaryItem>{bandwidth(plan.limits.uploadBandwidth)} upload bandwidth</PlanSummaryItem>
</ul> <PlanSummaryItem>{bandwidth(plan.limits.downloadBandwidth)} download bandwidth</PlanSummaryItem>
</ul>
)}
</Panel> </Panel>
); );
})} })}