From a575b4c50250706c79e2f6ceb8ccf34afa02ee21 Mon Sep 17 00:00:00 2001 From: Maciek Date: Fri, 10 Mar 2023 00:52:38 +0100 Subject: [PATCH] chore(trading): tweaks and improvements of floating bottom buttons (#3138) --- .../src/integration/withdraw-key-to-key.cy.ts | 3 ++ .../client-pages/market/trade-grid.tsx | 5 +- .../client-pages/portfolio/portfolio.tsx | 5 +- .../accounts-container/accounts-container.tsx | 7 ++- apps/trading/components/footer/footer.tsx | 2 +- libs/fills/src/lib/fills-data-provider.ts | 5 +- libs/fills/src/lib/fills-manager.tsx | 50 ++++++++++++++++--- libs/fills/src/lib/use-fills-list.ts | 25 +++++++++- .../positions/src/lib/positions-container.tsx | 3 ++ libs/positions/src/lib/positions-manager.tsx | 19 ++++++- 10 files changed, 106 insertions(+), 18 deletions(-) diff --git a/apps/trading-e2e/src/integration/withdraw-key-to-key.cy.ts b/apps/trading-e2e/src/integration/withdraw-key-to-key.cy.ts index 86b45ad23..9cad74ffb 100644 --- a/apps/trading-e2e/src/integration/withdraw-key-to-key.cy.ts +++ b/apps/trading-e2e/src/integration/withdraw-key-to-key.cy.ts @@ -76,6 +76,9 @@ describe( cy.getByTestId(closeDialog).click(); cy.getByTestId('Trading').first().click(); cy.getByTestId(collateralTab).click(); + cy.getByTestId(openTransferDialog).should('not.exist'); + cy.getByTestId('Portfolio').eq(0).click(); + cy.getByTestId(collateralTab).click(); cy.getByTestId(openTransferDialog).click(); cy.getByTestId(dialogTransferText).should( 'contain.text', diff --git a/apps/trading/client-pages/market/trade-grid.tsx b/apps/trading/client-pages/market/trade-grid.tsx index c73755154..8830a489c 100644 --- a/apps/trading/client-pages/market/trade-grid.tsx +++ b/apps/trading/client-pages/market/trade-grid.tsx @@ -179,7 +179,10 @@ const MainGrid = ({ - + diff --git a/apps/trading/client-pages/portfolio/portfolio.tsx b/apps/trading/client-pages/portfolio/portfolio.tsx index 128d44605..5024f635b 100644 --- a/apps/trading/client-pages/portfolio/portfolio.tsx +++ b/apps/trading/client-pages/portfolio/portfolio.tsx @@ -49,7 +49,10 @@ export const Portfolio = () => { - + diff --git a/apps/trading/components/accounts-container/accounts-container.tsx b/apps/trading/components/accounts-container/accounts-container.tsx index 2c8a58a4c..7fa594a8b 100644 --- a/apps/trading/components/accounts-container/accounts-container.tsx +++ b/apps/trading/components/accounts-container/accounts-container.tsx @@ -8,15 +8,14 @@ import { useVegaWallet } from '@vegaprotocol/wallet'; import type { PinnedAsset } from '@vegaprotocol/accounts'; import { AccountManager, useTransferDialog } from '@vegaprotocol/accounts'; import { useDepositDialog } from '@vegaprotocol/deposits'; -import { useParams } from 'react-router-dom'; export const AccountsContainer = ({ pinnedAsset, + hideButtons, }: { pinnedAsset?: PinnedAsset; + hideButtons?: boolean; }) => { - const params = useParams(); - const hideButtons = 'marketId' in params; const { pubKey, isReadOnly } = useVegaWallet(); const { open: openAssetDetailsDialog } = useAssetDetailsDialogStore(); const openWithdrawalDialog = useWithdrawalDialog((store) => store.open); @@ -49,7 +48,7 @@ export const AccountsContainer = ({ pinnedAsset={pinnedAsset} /> {!isReadOnly && !hideButtons && ( -
+