chore(trading): use action icon buttons (#4550)
This commit is contained in:
parent
809f149df9
commit
e3ed71bec4
@ -80,7 +80,7 @@ describe('OrderListTable', () => {
|
||||
'-',
|
||||
Schema.OrderTimeInForceCode[marketOrder.timeInForce],
|
||||
getDateTimeFormat().format(new Date(marketOrder.createdAt)),
|
||||
'Edit',
|
||||
'',
|
||||
];
|
||||
expectedValues.forEach((expectedValue, i) =>
|
||||
expect(cells[i]).toHaveTextContent(expectedValue)
|
||||
@ -104,7 +104,7 @@ describe('OrderListTable', () => {
|
||||
Schema.OrderTimeInForceCode[limitOrder.timeInForce]
|
||||
}: ${getDateTimeFormat().format(new Date(limitOrder.expiresAt ?? ''))}`,
|
||||
getDateTimeFormat().format(new Date(limitOrder.createdAt)),
|
||||
'Edit',
|
||||
'',
|
||||
];
|
||||
expectedValues.forEach((expectedValue, i) =>
|
||||
expect(cells[i]).toHaveTextContent(expectedValue)
|
||||
|
@ -271,8 +271,8 @@ export const OrderListTable = memo<
|
||||
{
|
||||
colId: 'amend',
|
||||
...COL_DEFS.actions,
|
||||
minWidth: showAllActions ? 110 : COL_DEFS.actions.minWidth,
|
||||
maxWidth: showAllActions ? 110 : COL_DEFS.actions.minWidth,
|
||||
minWidth: showAllActions ? 90 : COL_DEFS.actions.minWidth,
|
||||
maxWidth: showAllActions ? 90 : COL_DEFS.actions.minWidth,
|
||||
cellRenderer: ({ data }: { data?: Order }) => {
|
||||
if (!data) return null;
|
||||
|
||||
@ -285,14 +285,14 @@ export const OrderListTable = memo<
|
||||
data-testid="edit"
|
||||
onClick={() => onEdit(data)}
|
||||
>
|
||||
{t('Edit')}
|
||||
<VegaIcon name={VegaIconNames.EDIT} size={16} />
|
||||
</ButtonLink>
|
||||
)}
|
||||
<ButtonLink
|
||||
data-testid="cancel"
|
||||
onClick={() => onCancel(data)}
|
||||
>
|
||||
{t('Cancel')}
|
||||
<VegaIcon name={VegaIconNames.CROSS} size={16} />
|
||||
</ButtonLink>
|
||||
</>
|
||||
)}
|
||||
|
@ -211,7 +211,7 @@ describe('Positions', () => {
|
||||
);
|
||||
});
|
||||
const cells = screen.getAllByRole('gridcell');
|
||||
expect(cells[11].textContent).toEqual('Close');
|
||||
expect(cells[11].textContent).toEqual('');
|
||||
});
|
||||
|
||||
it('do not display close button if openVolume is zero', async () => {
|
||||
|
@ -23,6 +23,8 @@ import {
|
||||
TooltipCellComponent,
|
||||
ExternalLink,
|
||||
Icon,
|
||||
VegaIconNames,
|
||||
VegaIcon,
|
||||
} from '@vegaprotocol/ui-toolkit';
|
||||
import {
|
||||
volumePrefix,
|
||||
@ -391,7 +393,7 @@ export const PositionsTable = ({
|
||||
data-testid="close-position"
|
||||
onClick={() => data && onClose(data)}
|
||||
>
|
||||
{t('Close')}
|
||||
<VegaIcon name={VegaIconNames.CROSS} size={16} />
|
||||
</ButtonLink>
|
||||
) : null}
|
||||
{data?.assetId && (
|
||||
|
Loading…
Reference in New Issue
Block a user