Skip to content

Commit

Permalink
adds different swap message based on trade type (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
bordalix committed Aug 29, 2023
1 parent 3714ae7 commit b16bf18
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/features/operator/TxsTable/TxRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Icon, { RightOutlined } from '@ant-design/icons';
import { Grid } from 'antd';
import classNames from 'classnames';

import { TradeType } from '../../../api-spec/protobuf/gen/js/tdex/v2/types_pb';
import type { TradeInfo, Transaction } from '../../../api-spec/protobuf/gen/js/tdex-daemon/v2/types_pb';
import { TradeStatus } from '../../../api-spec/protobuf/gen/js/tdex-daemon/v2/types_pb';
import { useTypedSelector } from '../../../app/store';
Expand Down Expand Up @@ -78,11 +79,23 @@ export const TxRow = ({
<td>
{screens.md ? (
<>
<span className="market-icons-translate__small">
<CurrencyIcon assetId={baseAsset?.asset_id ?? ''} size={16} />
<CurrencyIcon assetId={quoteAsset?.asset_id ?? ''} size={16} />
</span>
{`Swap ${baseAsset?.ticker} for ${quoteAsset?.ticker}`}
{row.tradeType === TradeType.TRADE_TYPE_SELL ? (
<>
<span className="market-icons-translate__small">
<CurrencyIcon assetId={baseAsset?.asset_id ?? ''} size={16} />
<CurrencyIcon assetId={quoteAsset?.asset_id ?? ''} size={16} />
</span>
{`Swap ${baseAsset?.ticker} for ${quoteAsset?.ticker}`}
</>
) : (
<>
<span className="market-icons-translate__small">
<CurrencyIcon assetId={quoteAsset?.asset_id ?? ''} size={16} />
<CurrencyIcon assetId={baseAsset?.asset_id ?? ''} size={16} />
</span>
{`Swap ${quoteAsset?.ticker} for ${baseAsset?.ticker}`}
</>
)}
</>
) : (
'Swap'
Expand Down

0 comments on commit b16bf18

Please sign in to comment.