From 92090743326fdfe63b10dff83cfd7958b7b4b5ac Mon Sep 17 00:00:00 2001 From: Matthew Russell Date: Fri, 1 Sep 2023 17:00:11 -0700 Subject: [PATCH] chore(trading): change pane context buttons color (#4680) --- .../accounts-menu/accounts-menu.tsx | 4 +- .../deposits-menu/deposits-menu.tsx | 3 +- .../positions-menu/positions-menu.tsx | 3 +- .../withdrawals-menu/withdrawals-menu.tsx | 3 +- .../src/lib/candles-menu.spec.tsx | 4 +- libs/candles-chart/src/lib/candles-menu.tsx | 112 ++++++++++-------- .../open-orders-menu/open-orders-menu.tsx | 9 +- 7 files changed, 69 insertions(+), 69 deletions(-) diff --git a/apps/trading/components/accounts-menu/accounts-menu.tsx b/apps/trading/components/accounts-menu/accounts-menu.tsx index 8fe5ae993..86c80e91c 100644 --- a/apps/trading/components/accounts-menu/accounts-menu.tsx +++ b/apps/trading/components/accounts-menu/accounts-menu.tsx @@ -1,5 +1,5 @@ import { t } from '@vegaprotocol/i18n'; -import { Intent, TradingButton } from '@vegaprotocol/ui-toolkit'; +import { TradingButton } from '@vegaprotocol/ui-toolkit'; import { ViewType, useSidebar } from '../sidebar'; export const AccountsMenu = () => { @@ -8,7 +8,6 @@ export const AccountsMenu = () => { return ( <> setView({ type: ViewType.Transfer })} @@ -16,7 +15,6 @@ export const AccountsMenu = () => { {t('Transfer')} setView({ type: ViewType.Deposit })} > diff --git a/apps/trading/components/deposits-menu/deposits-menu.tsx b/apps/trading/components/deposits-menu/deposits-menu.tsx index 28c751e84..81b6edf60 100644 --- a/apps/trading/components/deposits-menu/deposits-menu.tsx +++ b/apps/trading/components/deposits-menu/deposits-menu.tsx @@ -1,5 +1,5 @@ import { t } from '@vegaprotocol/i18n'; -import { Intent, TradingButton } from '@vegaprotocol/ui-toolkit'; +import { TradingButton } from '@vegaprotocol/ui-toolkit'; import { ViewType, useSidebar } from '../sidebar'; export const DepositsMenu = () => { @@ -7,7 +7,6 @@ export const DepositsMenu = () => { return ( setView({ type: ViewType.Deposit })} data-testid="deposit-button" diff --git a/apps/trading/components/positions-menu/positions-menu.tsx b/apps/trading/components/positions-menu/positions-menu.tsx index 58dddee7b..428bb82d7 100644 --- a/apps/trading/components/positions-menu/positions-menu.tsx +++ b/apps/trading/components/positions-menu/positions-menu.tsx @@ -1,5 +1,5 @@ import { t } from '@vegaprotocol/i18n'; -import { Intent, TradingButton } from '@vegaprotocol/ui-toolkit'; +import { TradingButton } from '@vegaprotocol/ui-toolkit'; import { usePositionsStore } from '../positions-container'; export const PositionsMenu = () => { @@ -7,7 +7,6 @@ export const PositionsMenu = () => { const toggle = usePositionsStore((store) => store.toggleClosedMarkets); return ( { @@ -7,7 +7,6 @@ export const WithdrawalsMenu = () => { return ( setView({ type: ViewType.Withdraw })} data-testid="withdraw-dialog-button" diff --git a/libs/candles-chart/src/lib/candles-menu.spec.tsx b/libs/candles-chart/src/lib/candles-menu.spec.tsx index 7a9ed6f52..85f8b5b24 100644 --- a/libs/candles-chart/src/lib/candles-menu.spec.tsx +++ b/libs/candles-chart/src/lib/candles-menu.spec.tsx @@ -7,8 +7,8 @@ describe('CandlesMenu', () => { render(); await userEvent.click( - screen.getByText('Studies', { - selector: '[type="button"]', + screen.getByRole('button', { + name: 'Studies', }) ); expect(await screen.findByRole('menu')).toBeInTheDocument(); diff --git a/libs/candles-chart/src/lib/candles-menu.tsx b/libs/candles-chart/src/lib/candles-menu.tsx index 2b3209e0a..cc5b62e40 100644 --- a/libs/candles-chart/src/lib/candles-menu.tsx +++ b/libs/candles-chart/src/lib/candles-menu.tsx @@ -10,13 +10,14 @@ import { studyLabels, } from 'pennant'; import { - DropdownMenu, - DropdownMenuCheckboxItem, - DropdownMenuContent, - DropdownMenuItemIndicator, - DropdownMenuRadioGroup, - DropdownMenuRadioItem, - DropdownMenuTrigger, + TradingButton, + TradingDropdown, + TradingDropdownCheckboxItem, + TradingDropdownContent, + TradingDropdownItemIndicator, + TradingDropdownRadioGroup, + TradingDropdownRadioItem, + TradingDropdownTrigger, Icon, } from '@vegaprotocol/ui-toolkit'; import type { IconName } from '@blueprintjs/icons'; @@ -44,69 +45,76 @@ export const CandlesMenu = () => { } = useCandlesChartSettings(); const triggerClasses = 'text-xs'; const contentAlign = 'end'; + const triggerButtonProps = { size: 'extra-small' } as const; return ( <> - - {t(`Interval: ${intervalLabels[interval]}`)} - + + + {t(`Interval: ${intervalLabels[interval]}`)} + + } > - - + { setInterval(value as Interval); }} > {Object.values(Interval).map((timeInterval) => ( - {intervalLabels[timeInterval]} - - + + ))} - - - - + + + - - + + + + + } > - - + { setType(value as ChartType); }} > {Object.values(ChartType).map((type) => ( - + {chartTypeLabels[type]} - - + + ))} - - - - + + + - {t('Overlays')} - + + + {t('Overlays')} + + } > - + {Object.values(Overlay).map((overlay) => ( - { @@ -121,21 +129,23 @@ export const CandlesMenu = () => { }} > {overlayLabels[overlay]} - - + + ))} - - - + + - {t('Studies')} - + + + {t('Studies')} + + } > - + {Object.values(Study).map((study) => ( - { @@ -150,11 +160,11 @@ export const CandlesMenu = () => { }} > {studyLabels[study]} - - + + ))} - - + + ); }; diff --git a/libs/orders/src/lib/components/open-orders-menu/open-orders-menu.tsx b/libs/orders/src/lib/components/open-orders-menu/open-orders-menu.tsx index 4ada22fb6..1f3879aa1 100644 --- a/libs/orders/src/lib/components/open-orders-menu/open-orders-menu.tsx +++ b/libs/orders/src/lib/components/open-orders-menu/open-orders-menu.tsx @@ -1,5 +1,5 @@ import { t } from '@vegaprotocol/i18n'; -import { Intent, TradingButton } from '@vegaprotocol/ui-toolkit'; +import { TradingButton } from '@vegaprotocol/ui-toolkit'; import { useVegaTransactionStore, useVegaWallet } from '@vegaprotocol/wallet'; import { useHasAmendableOrder } from '../../order-hooks'; @@ -28,12 +28,7 @@ export const OpenOrdersMenu = ({ marketId }: { marketId: string }) => { }; const CancelAllOrdersButton = ({ onClick }: { onClick: () => void }) => ( - + {t('Cancel all')} );