From d62320bafbf4eafba9b9adbf240891022610a9f6 Mon Sep 17 00:00:00 2001 From: Abhas Bhattacharya Date: Wed, 11 Apr 2018 11:25:37 +0530 Subject: [PATCH] Add basic portfolio manager --- .../PortfolioManager/PortfolioManager.css | 0 .../PortfolioManager/PortfolioManager.jsx | 38 +++++++++++++++++++ src/Components/PortfolioManager/index.js | 1 + 3 files changed, 39 insertions(+) create mode 100644 src/Components/PortfolioManager/PortfolioManager.css create mode 100644 src/Components/PortfolioManager/PortfolioManager.jsx create mode 100644 src/Components/PortfolioManager/index.js diff --git a/src/Components/PortfolioManager/PortfolioManager.css b/src/Components/PortfolioManager/PortfolioManager.css new file mode 100644 index 0000000..e69de29 diff --git a/src/Components/PortfolioManager/PortfolioManager.jsx b/src/Components/PortfolioManager/PortfolioManager.jsx new file mode 100644 index 0000000..058112c --- /dev/null +++ b/src/Components/PortfolioManager/PortfolioManager.jsx @@ -0,0 +1,38 @@ +/* eslint-disable react/prefer-stateless-function */ +import React, { Component } from 'react'; +import './PortfolioManager.css'; + +class PortfolioManager extends Component { + render() { + const portfolioScripPrices = this.props.portfolioScripPrices; + + return ( +
{ ev.preventDefault(); }} + onDrop={(ev) => { + const scripName = ev.dataTransfer.getData('text/plain'); + this.props.addScripToPortfolio(scripName); + }} + > +
+ Please drop here +
    + { + Object.keys(portfolioScripPrices).map((scripName) => { + return ( +
  • + {scripName} | {portfolioScripPrices[scripName]} +
  • + ); + }) + } +
+
+ ); + } +} + +export { PortfolioManager }; diff --git a/src/Components/PortfolioManager/index.js b/src/Components/PortfolioManager/index.js new file mode 100644 index 0000000..cfe215b --- /dev/null +++ b/src/Components/PortfolioManager/index.js @@ -0,0 +1 @@ +export { PortfolioManager } from './PortfolioManager';