diff options
author | Michael Foiani <sotech117@michaels-mbp-3.lan> | 2021-04-20 12:49:22 -0400 |
---|---|---|
committer | Michael Foiani <sotech117@michaels-mbp-3.lan> | 2021-04-20 12:49:22 -0400 |
commit | 4411ae1564d716e5aa063e4c47302ffc907a078a (patch) | |
tree | 139d757cd3152b83f452000d9fe4ed6eeb7ef497 /react-frontend/src/components/InvestorInfo.js | |
parent | e359237bb2820b830b8b48c73f87e944d19baecb (diff) |
Fixed the crash if no data in timetime and hid if an investor has no holidngs.
Diffstat (limited to 'react-frontend/src/components/InvestorInfo.js')
-rw-r--r-- | react-frontend/src/components/InvestorInfo.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/react-frontend/src/components/InvestorInfo.js b/react-frontend/src/components/InvestorInfo.js index 436fa17..9e18299 100644 --- a/react-frontend/src/components/InvestorInfo.js +++ b/react-frontend/src/components/InvestorInfo.js @@ -48,13 +48,13 @@ function InvestorInfo(props) { }, credentials: "same-origin", }) - .then((res) => res.json()) - .then((data) => { + .then(res => res.json()) + .then(data => { console.log(data); setInfo(data); props.setShowSelectedInfo(true); }) - .catch((err) => console.log(err)); + .catch(err => console.log(err)); }; const stockTable = () => { @@ -104,7 +104,7 @@ function InvestorInfo(props) { </h2> <div id="top-bar"> <div id="gain-number"> - <p className="bigNumber">{(info.moneyOut - info.moneyIn).toFixed(3)}$</p> gain + <p className="bigNumber">${(info.moneyOut - info.moneyIn).toFixed(3)}</p> gained </div> <div> @@ -114,9 +114,9 @@ function InvestorInfo(props) { </div> <div> - <div className="Checkin"> + <div className="Checkin" hidden={info.holdings.length === 0}> <div className="Img-flex"> - <span className="tableHeader">View returns</span> + <span className="tableHeader">View holdings</span> <img className="Img-btn" hidden={showStocks} |