aboutsummaryrefslogtreecommitdiff
path: root/react-frontend/src/components/InvestorInfo.js
diff options
context:
space:
mode:
authorMichael Foiani <sotech117@michaels-mbp-3.lan>2021-04-20 12:49:22 -0400
committerMichael Foiani <sotech117@michaels-mbp-3.lan>2021-04-20 12:49:22 -0400
commit4411ae1564d716e5aa063e4c47302ffc907a078a (patch)
tree139d757cd3152b83f452000d9fe4ed6eeb7ef497 /react-frontend/src/components/InvestorInfo.js
parente359237bb2820b830b8b48c73f87e944d19baecb (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.js12
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}