Skip to content

Commit

Permalink
update tr language #272
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhvk committed Aug 6, 2020
1 parent eb427c0 commit 98a39cc
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 7 deletions.
16 changes: 13 additions & 3 deletions src/components/OrdersTableMobile/OrdersTableRendererMobile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ const ORDERTYPES = {
'MO': <FormattedMessage id='exchangePage.market' />,
}

const ORDERSIDES = {
'BUY': <FormattedMessage id='exchangePage.buy' />,
'SELL': <FormattedMessage id='exchangePage.sell' />,
}

const OrdersTableRendererMobile = (props: Props) => {
const {
loading,
Expand Down Expand Up @@ -166,7 +171,9 @@ const OpenOrderTable = ({orders, cancelOrder, isHideOtherPairs, handleChangeHide
{orders.map((order, index) => (
<Row key={index}>
<CenterCell width={"25%"} muted>
<FieldValue style={{marginBottom: "7px"}} color={order.side === 'BUY' ? TmColors.GREEN : TmColors.RED}>{order.side} {order.type}</FieldValue>
<FieldValue style={{marginBottom: "7px"}} color={order.side === 'BUY' ? TmColors.GREEN : TmColors.RED}>
{ORDERSIDES[order.side.toUpperCase()]} {ORDERTYPES[order.type]}
</FieldValue>
<div style={{width: "40px"}}>
<CircularProgressbar
value={calcPercent(order.filled, order.amount, amountPrecision).toFixed(0)}
Expand Down Expand Up @@ -498,9 +505,12 @@ const FieldTitle = styled.span`
color: ${props => props.color || TmColors.LIGHT_GRAY};
`

const FieldValue = styled.span`
const FieldValue = styled.div`
display: inline-block;
color: ${props => props.color || TmColors.WHITE};
span {
color: ${props => props.color || TmColors.WHITE} !important;
}
`

export default OrdersTableRendererMobile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ type Props = {
}
}

const ORDERTYPES = {
'LO': <FormattedMessage id='exchangePage.limit' />,
'MO': <FormattedMessage id='exchangePage.market' />,
}

const ORDERSIDES = {
'BORROW': <FormattedMessage id='exchangeLendingPage.orderPlace.btnBorrow' />,
'LEND': <FormattedMessage id='exchangeLendingPage.orderPlace.btnLend' />,
}

const DappLendingOrdersTableRenderer = (props: Props ) => {
const {
selectedPanel,
Expand Down Expand Up @@ -164,7 +174,9 @@ const OpenOrderTable = ({orders, cancelOrder, isHideOtherPairs, handleChangeHide
{orders.map((order, index) => (
<Row key={index}>
<CenterCell width={"25%"} muted>
<FieldValue style={{marginBottom: "7px"}} color={order.side === 'BORROW' ? TmColors.GREEN : TmColors.RED}>{order.side} {order.type}</FieldValue>
<FieldValue style={{marginBottom: "7px"}} color={order.side === 'BORROW' ? TmColors.GREEN : TmColors.RED}>
{ORDERSIDES[order.side.toUpperCase()]} {ORDERTYPES[order.type]}
</FieldValue>
<div style={{width: "40px"}}>
<CircularProgressbar
value={calcPercent(order.filled, order.amount, amountPrecision).toFixed(0)}
Expand Down Expand Up @@ -597,10 +609,13 @@ const FieldTitle = styled.span`
color: ${props => props.color || TmColors.LIGHT_GRAY};
`

const FieldValue = styled.span`
const FieldValue = styled.div`
display: inline-block;
font-size: 10px;
color: ${props => props.color || TmColors.WHITE};
span {
color: ${props => props.color || TmColors.WHITE} !important;
}
`

export default DappLendingOrdersTableRenderer
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ const TOPUPTYPES = {
'1': <FormattedMessage id='exchangeLendingPage.orders.topUpAuto' />,
}

const ORDERSIDES = {
'BORROW': <FormattedMessage id='exchangeLendingPage.orderPlace.btnBorrow' />,
'LEND': <FormattedMessage id='exchangeLendingPage.orderPlace.btnLend' />,
}

const rowHeight = 45
const overscanRowCount = 5
const columnsOpenOrder = {
Expand Down Expand Up @@ -235,7 +240,7 @@ const OpenOrderTable = ({
{ORDERTYPES[order.type]}
</Cell>
<Cell width={columnsOpenOrder["side"]} className={`${order.side && order.side.toLowerCase() === "borrow" ? "up" : "down"}`} muted>
{order.side && capitalizeFirstLetter(order.side)}
{order.side && ORDERSIDES[order.side.toUpperCase()]}
</Cell>
<Cell width={columnsOpenOrder["interest"]} muted>
{BigNumber(order.interest).toFormat(2)}&#37;
Expand Down

0 comments on commit 98a39cc

Please sign in to comment.