Skip to content

Instantly share code, notes, and snippets.

@BetterProgramming
Created January 6, 2020 23:09
Show Gist options
  • Save BetterProgramming/7e95682ce502a424d6282d140b529f65 to your computer and use it in GitHub Desktop.
Save BetterProgramming/7e95682ce502a424d6282d140b529f65 to your computer and use it in GitHub Desktop.
...
import Graph from "./Graph";
...
let content = <div>No Data</div>;
if (coinData && coinData.prices && coinData.prices.length > 0)
content = (
<div>
<Totals
priceArr={coinData.prices}
freqInDays={freqInDays}
amountToInvest={amountToInvest}
/>
<Graph
priceArr={coinData.prices}
freqInDays={freqInDays}
amountToInvest={amountToInvest}
/>
</div>
);
if (isLoading) content = <div>Loading</div>;
if (error) content = <div>{error}</div>;
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment