diff --git a/websrc/components/Tables.tsx b/websrc/components/Tables.tsx index 3f102a0..3c7737d 100644 --- a/websrc/components/Tables.tsx +++ b/websrc/components/Tables.tsx @@ -1,13 +1,9 @@ import React, {Component} from "react" import {Badge, Button, Container, Table} from "react-bootstrap" -import {NewTickData, PositionCloseMessage, PositionState, socket} from '../'; +import {PositionCloseMessage, PositionState, socket} from '../'; -export class PositionTable extends Component<{}, { positions: Array }> { - state = { - positions: [] - } - +export class PositionTable extends Component<{ positions: Array }> { constructor(props) { super(props) } @@ -35,16 +31,8 @@ export class PositionTable extends Component<{}, { positions: Array { - this.setState({ - positions: data.positions - }) - }) - } - tableData() { - return this.state.positions.map((position: PositionState) => { + return this.props.positions.map((position: PositionState) => { return ( {position.state} @@ -54,10 +42,9 @@ export class PositionTable extends Component<{}, { positions: Array{position.profit_loss.toFixed(2)} {position.profit_loss_percentage.toFixed(2)} %