diff --git a/websrc/components/Tables.tsx b/websrc/components/Tables.tsx index adeed92..7f85f68 100644 --- a/websrc/components/Tables.tsx +++ b/websrc/components/Tables.tsx @@ -1,6 +1,7 @@ import React, {Component} from "react" import {PositionProp} from "../types"; import {ClosePositionModal} from "./Overlays"; +import {symbolToPair} from "../utils"; type PositionsTableState = { showConfirmation: boolean, @@ -54,10 +55,11 @@ export class PositionsTable extends Component<{ positions: Array } renderTableRows() { return this.props.positions.map((position) => { + // TODO: move symbolToPair out of here? + const currencyPair = symbolToPair(position.symbol) const stateBg = "bg-".concat(this.stateColor(position.state)).concat("-100 ") const stateText = "text-".concat(this.stateColor(position.state)).concat("-800 ") const stateClass = "px-2 inline-flex text-xs leading-5 font-semibold rounded-full ".concat(stateBg).concat(stateText) - const percentageText = "text-".concat(this.stateColor(position.state)).concat("-300 ") return ( @@ -70,22 +72,22 @@ export class PositionsTable extends Component<{ positions: Array } -
{position.symbol}
+
{currencyPair.base}/{currencyPair.quote}
{/*
{position.}
*/} -
{position.base_price.toLocaleString()} USD/BTC
+
{position.base_price.toLocaleString()} {currencyPair.quote}/{currencyPair.base}
{/*
Insert total % here?
*/} -
{position.amount.toFixed(5)} BTC
+
{position.amount.toFixed(5)} {currencyPair.base}
Insert total % here?
-
{position.profit_loss.toLocaleString()} USD
+
{position.profit_loss.toLocaleString()} {currencyPair.quote}
{position.profit_loss_percentage.toFixed(2)}%