From 891ac527a272468df0673512ea836f44c2760111 Mon Sep 17 00:00:00 2001 From: "m.ray" <16125548+MadalinaRaicu@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:18:52 +0300 Subject: [PATCH] feat(trading): add tooltips for iceberg and post or reduce only (#5119) --- .../components/deal-ticket/deal-ticket.tsx | 49 ++++++++++++------- libs/environment/src/hooks/use-links.ts | 2 + 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx b/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx index 0a71485d4..59da58510 100644 --- a/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx +++ b/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx @@ -24,6 +24,7 @@ import { Tooltip, TradingButton as Button, Pill, + ExternalLink, } from '@vegaprotocol/ui-toolkit'; import { useOpenVolume } from '@vegaprotocol/positions'; @@ -77,6 +78,7 @@ import { DealTicketSizeIceberg } from './deal-ticket-size-iceberg'; import noop from 'lodash/noop'; import { isNonPersistentOrder } from '../../utils/time-in-force-persistance'; import { KeyValue } from './key-value'; +import { DocsLinks } from '@vegaprotocol/environment'; export const REDUCE_ONLY_TOOLTIP = '"Reduce only" will ensure that this order will not increase the size of an open position. When the order is matched, it will only trade enough volume to bring your open volume towards 0 but never change the direction of your position. If applied to a limit order that is not instantly filled, the order will be stopped.'; @@ -548,15 +550,20 @@ export const DealTicket = ({ render={({ field }) => ( - {disablePostOnlyCheckbox - ? t( - '"Post only" can not be used on "Fill or Kill" or "Immediate or Cancel" orders.' - ) - : t( - '"Post only" will ensure the order is not filled immediately but is placed on the order book as a passive order. When the order is processed it is either stopped (if it would not be filled immediately), or placed in the order book as a passive order until the price taker matches with it.' - )} - + <> + + {disablePostOnlyCheckbox + ? t( + '"Post only" can not be used on "Fill or Kill" or "Immediate or Cancel" orders.' + ) + : t( + '"Post only" will ensure the order is not filled immediately but is placed on the order book as a passive order. When the order is processed it is either stopped (if it would not be filled immediately), or placed in the order book as a passive order until the price taker matches with it.' + )} + {' '} + + {t('Find out more')} + + } >
@@ -580,13 +587,18 @@ export const DealTicket = ({ render={({ field }) => ( - {disableReduceOnlyCheckbox - ? t( - '"Reduce only" can be used only with non-persistent orders, such as "Fill or Kill" or "Immediate or Cancel".' - ) - : t(REDUCE_ONLY_TOOLTIP)} - + <> + + {disableReduceOnlyCheckbox + ? t( + '"Reduce only" can be used only with non-persistent orders, such as "Fill or Kill" or "Immediate or Cancel".' + ) + : t(REDUCE_ONLY_TOOLTIP)} + {' '} + + {t('Find out more')} + + } >
@@ -618,7 +630,10 @@ export const DealTicket = ({ {t(`Trade only a fraction of the order size at once. After the peak size of the order has traded, the size is reset. This is repeated until the order is cancelled, expires, or its full volume trades away. For example, an iceberg order with a size of 1000 and a peak size of 100 will effectively be split into 10 orders with a size of 100 each. - Note that the full volume of the order is not hidden and is still reflected in the order book.`)} + Note that the full volume of the order is not hidden and is still reflected in the order book.`)}{' '} + + {t('Find out more')} + {' '}

} > diff --git a/libs/environment/src/hooks/use-links.ts b/libs/environment/src/hooks/use-links.ts index 96103af1a..1e3c8b58a 100644 --- a/libs/environment/src/hooks/use-links.ts +++ b/libs/environment/src/hooks/use-links.ts @@ -82,6 +82,8 @@ export const DocsLinks = VEGA_DOCS_URL VALIDATOR_SCORES_REWARDS: `${VEGA_DOCS_URL}/concepts/vega-chain/validator-scores-and-rewards`, MARKET_LIFECYCLE: `${VEGA_DOCS_URL}/concepts/trading-on-vega/market-lifecycle`, ETH_DATA_SOURCES: `${VEGA_DOCS_URL}/concepts/trading-on-vega/data-sources#ethereum-data-sources`, + ICEBERG_ORDERS: `${VEGA_DOCS_URL}/concepts/trading-on-vega/orders#iceberg-order`, + POST_REDUCE_ONLY: `${VEGA_DOCS_URL}/concepts/trading-on-vega/orders#conditional-order-parameters`, } : undefined;