From c4f075343f557f278b1bacb4b92891e646f8fb2a Mon Sep 17 00:00:00 2001 From: Michael Foiani Date: Tue, 20 Apr 2021 07:55:53 -0400 Subject: Finished up the front end functionality. Some issues with the backend (small NaN issues), and some elements need a little more love (styling) before demo. --- .../public/assets/outline_cancel_white_18dp.png | Bin 0 -> 388 bytes react-frontend/public/assets/outline_close_white_18dp.png | Bin 0 -> 181 bytes .../public/assets/outline_minimize_white_18dp.png | Bin 0 -> 97 bytes .../public/assets/outline_search_white_18dp.png | Bin 0 -> 397 bytes react-frontend/public/assets/outline_tune_white_18dp.png | Bin 0 -> 171 bytes .../public/assets/round_arrow_back_white_18dp.png | Bin 0 -> 163 bytes .../public/assets/round_expand_less_white_18dp.png | Bin 0 -> 170 bytes .../public/assets/round_expand_more_white_18dp.png | Bin 0 -> 166 bytes react-frontend/public/round_arrow_back_white_18dp.png | Bin 163 -> 0 bytes 9 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 react-frontend/public/assets/outline_cancel_white_18dp.png create mode 100644 react-frontend/public/assets/outline_close_white_18dp.png create mode 100644 react-frontend/public/assets/outline_minimize_white_18dp.png create mode 100644 react-frontend/public/assets/outline_search_white_18dp.png create mode 100644 react-frontend/public/assets/outline_tune_white_18dp.png create mode 100644 react-frontend/public/assets/round_arrow_back_white_18dp.png create mode 100644 react-frontend/public/assets/round_expand_less_white_18dp.png create mode 100644 react-frontend/public/assets/round_expand_more_white_18dp.png delete mode 100644 react-frontend/public/round_arrow_back_white_18dp.png (limited to 'react-frontend/public') diff --git a/react-frontend/public/assets/outline_cancel_white_18dp.png b/react-frontend/public/assets/outline_cancel_white_18dp.png new file mode 100644 index 0000000..b989e20 Binary files /dev/null and b/react-frontend/public/assets/outline_cancel_white_18dp.png differ diff --git a/react-frontend/public/assets/outline_close_white_18dp.png b/react-frontend/public/assets/outline_close_white_18dp.png new file mode 100644 index 0000000..65867f3 Binary files /dev/null and b/react-frontend/public/assets/outline_close_white_18dp.png differ diff --git a/react-frontend/public/assets/outline_minimize_white_18dp.png b/react-frontend/public/assets/outline_minimize_white_18dp.png new file mode 100644 index 0000000..a6a12d6 Binary files /dev/null and b/react-frontend/public/assets/outline_minimize_white_18dp.png differ diff --git a/react-frontend/public/assets/outline_search_white_18dp.png b/react-frontend/public/assets/outline_search_white_18dp.png new file mode 100644 index 0000000..52ffe5f Binary files /dev/null and b/react-frontend/public/assets/outline_search_white_18dp.png differ diff --git a/react-frontend/public/assets/outline_tune_white_18dp.png b/react-frontend/public/assets/outline_tune_white_18dp.png new file mode 100644 index 0000000..4168a63 Binary files /dev/null and b/react-frontend/public/assets/outline_tune_white_18dp.png differ diff --git a/react-frontend/public/assets/round_arrow_back_white_18dp.png b/react-frontend/public/assets/round_arrow_back_white_18dp.png new file mode 100644 index 0000000..bbaccda Binary files /dev/null and b/react-frontend/public/assets/round_arrow_back_white_18dp.png differ diff --git a/react-frontend/public/assets/round_expand_less_white_18dp.png b/react-frontend/public/assets/round_expand_less_white_18dp.png new file mode 100644 index 0000000..a64f430 Binary files /dev/null and b/react-frontend/public/assets/round_expand_less_white_18dp.png differ diff --git a/react-frontend/public/assets/round_expand_more_white_18dp.png b/react-frontend/public/assets/round_expand_more_white_18dp.png new file mode 100644 index 0000000..f8c7213 Binary files /dev/null and b/react-frontend/public/assets/round_expand_more_white_18dp.png differ diff --git a/react-frontend/public/round_arrow_back_white_18dp.png b/react-frontend/public/round_arrow_back_white_18dp.png deleted file mode 100644 index bbaccda..0000000 Binary files a/react-frontend/public/round_arrow_back_white_18dp.png and /dev/null differ -- cgit v1.2.3-70-g09d2 From d37e4f1f4e7e6bb26ed83b81821b6a4df09a3b24 Mon Sep 17 00:00:00 2001 From: clarkohw Date: Tue, 20 Apr 2021 10:51:04 -0400 Subject: added link, gain --- react-frontend/public/link-icon.svg | 1 + react-frontend/src/components/InvestorInfo.js | 107 ++++++++++++++------- react-frontend/src/css/InvesterInfo.css | 5 + src/main/java/edu/brown/cs/student/term/Main.java | 7 +- .../cs/student/term/profit/ProfitCalculation.java | 11 ++- 5 files changed, 92 insertions(+), 39 deletions(-) create mode 100644 react-frontend/public/link-icon.svg (limited to 'react-frontend/public') diff --git a/react-frontend/public/link-icon.svg b/react-frontend/public/link-icon.svg new file mode 100644 index 0000000..926cbcb --- /dev/null +++ b/react-frontend/public/link-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/react-frontend/src/components/InvestorInfo.js b/react-frontend/src/components/InvestorInfo.js index 3a3a11f..436fa17 100644 --- a/react-frontend/src/components/InvestorInfo.js +++ b/react-frontend/src/components/InvestorInfo.js @@ -14,8 +14,10 @@ import uuid from "react-uuid"; function InvestorInfo(props) { const [info, setInfo] = useState({ percentGain: 0, + moneyIn: 0, + moneyOut: 0, percentSP500: 0, - holdings: [] + holdings: [], }); const [showStocks, setShowStocks] = useState(false); @@ -26,7 +28,7 @@ function InvestorInfo(props) { return; } - const toEpochMilli = date => Date.parse(date); + const toEpochMilli = (date) => Date.parse(date); console.log({ selectedId: props.selectedId, @@ -46,37 +48,42 @@ function InvestorInfo(props) { }, credentials: "same-origin", }) - .then(res => res.json()) - .then(data => { - console.log(data); - setInfo(data); - props.setShowSelectedInfo(true); - }) - .catch(err => console.log(err)); + .then((res) => res.json()) + .then((data) => { + console.log(data); + setInfo(data); + props.setShowSelectedInfo(true); + }) + .catch((err) => console.log(err)); }; const stockTable = () => { return ( <> -
  • -
    -
    Symbol
    -
    Realized gain
    -
    Unrealized gain
    -
    -
  • - {info.holdings.map(holding => -
  • -
    {holding.ticker}
    -
    {holding.realizedGain.toFixed(3)}
    -
    {holding.unrealizedGain.toFixed(3)}
    -
  • )} +
  • +
    +
    Symbol
    +
    Realized gain
    +
    Unrealized gain
    +
    +
  • + {info.holdings.map((holding) => ( +
  • +
    {holding.ticker}
    +
    {holding.realizedGain.toFixed(3)}
    +
    {holding.unrealizedGain.toFixed(3)}
    +
  • + ))} ); }; - const followerList = () => - props.followers.map(follower =>
  • props.setSelectedId(follower.id)}>{follower.name}
  • ); + const followerList = () => + props.followers.map((follower) => ( +
  • props.setSelectedId(follower.id)}> + {follower.name} +
  • + )); // Hook that updates when selected has changed useEffect(() => getInfo(), [props.selectedId]); @@ -84,15 +91,20 @@ function InvestorInfo(props) { return (