From e359237bb2820b830b8b48c73f87e944d19baecb Mon Sep 17 00:00:00 2001 From: Julia McCauley Date: Tue, 20 Apr 2021 12:02:58 -0400 Subject: fixed some stuff with css overflow for investor info popup --- react-frontend/src/components/EdgeInfo.js | 52 ++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 12 deletions(-) (limited to 'react-frontend/src/components/EdgeInfo.js') diff --git a/react-frontend/src/components/EdgeInfo.js b/react-frontend/src/components/EdgeInfo.js index 60af0e8..566c70a 100644 --- a/react-frontend/src/components/EdgeInfo.js +++ b/react-frontend/src/components/EdgeInfo.js @@ -1,5 +1,6 @@ import '../css/UserCheckin.css'; +import { useEffect, useState } from "react"; /** * Componenet for checkins. Has a toggle to show more info. @@ -7,25 +8,52 @@ import '../css/UserCheckin.css'; * @returns {import('react').HtmlHTMLAttributes} A list element holding a checkin's info. */ function EdgeInfo(props) { - // State - toggled + /* // State - toggled + const [stockList, setStockList] = useState([]); - const stockList = props.stockList; - - /* const stockInfo = stockList.map((stock) => + const stockInfo = stockList.map((stock) =>
  • {stock}
  • - );*/ + ); + + + const getEdgeInfo = (fromID, toID) => { + fetch("http://localhost:4567/edge-data", { + method: "POST", + body: JSON.stringify({ + followerID: fromID, + leaderID: toID, + }), + headers: { + "Content-Type": "application/json", + }, + credentials: "same-origin" + }) + .then(res => res.json()) + .then(data => { + console.log(data); + setStockList(data); + }) + .catch(err => console.log(err)); + } + + useEffect(() => getEdgeInfo(), [props.selectedFollowerID, props.selectedLeaderID]); + */ - const hideSelf = () => { - props.setHideInfo(true); - } return ( -
    -

    X

    +
    + +
    + /*); +
    */); } export default EdgeInfo; \ No newline at end of file -- cgit v1.2.3-70-g09d2