Add basic portfolio manager

This commit is contained in:
2018-04-11 11:25:37 +05:30
parent 1262b69ef5
commit d62320bafb
3 changed files with 39 additions and 0 deletions
@@ -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 (
<div
className="portfolio-manager"
onDragOver={(ev) => { ev.preventDefault(); }}
onDrop={(ev) => {
const scripName = ev.dataTransfer.getData('text/plain');
this.props.addScripToPortfolio(scripName);
}}
>
<div className="drop-block" style={{ width: '100%', height: '500px', border: '1px solid black' }} />
Please drop here
<ul>
{
Object.keys(portfolioScripPrices).map((scripName) => {
return (
<li
key={scripName}
>
{scripName} | {portfolioScripPrices[scripName]}
</li>
);
})
}
</ul>
</div>
);
}
}
export { PortfolioManager };
+1
View File
@@ -0,0 +1 @@
export { PortfolioManager } from './PortfolioManager';