aboutsummaryrefslogtreecommitdiff
path: root/maps-frontend/src/components/InvestorInfo.js
diff options
context:
space:
mode:
Diffstat (limited to 'maps-frontend/src/components/InvestorInfo.js')
-rw-r--r--maps-frontend/src/components/InvestorInfo.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/maps-frontend/src/components/InvestorInfo.js b/maps-frontend/src/components/InvestorInfo.js
index 24994d0..d368984 100644
--- a/maps-frontend/src/components/InvestorInfo.js
+++ b/maps-frontend/src/components/InvestorInfo.js
@@ -14,15 +14,16 @@ function InvestorInfo(props) {
const toEpochMilli = date => Date.parse(date);
const getInfo = () => {
- if (props.name === "") {
- return;
- }
-
console.log({
person: props.name,
start: toEpochMilli(props.dates.start),
end: toEpochMilli(props.dates.end)
});
+
+ if (props.name === "") {
+ return;
+ }
+
fetch("http://localhost:4567/profit", {
method: "POST",
body: JSON.stringify({
@@ -53,13 +54,13 @@ function InvestorInfo(props) {
</li>
);*/
- useEffect(() => getInfo(), [props.name])
+ useEffect(() => getInfo(), [props.name, props.isSelected, props.personId])
-return (
- <div className="Chosen-user">
- hi
- </div>
-);
+ return (
+ <div className="Chosen-user" hidden={props.isSelected}>
+ hi
+ </div>
+ );
}
export default InvestorInfo; \ No newline at end of file