1
1
import classNames from 'classnames' ;
2
2
import React from 'react' ;
3
+ import { Localize } from '@deriv/translations' ;
3
4
import {
4
5
getCancellationPrice ,
5
6
getContractUpdateConfig ,
@@ -17,6 +18,7 @@ import InputWithCheckbox from '../../input-wth-checkbox';
17
18
import { TContractInfo , TContractStore } from '@deriv/shared/src/utils/contract/contract-types' ;
18
19
import { TGetCardLables , TToastConfig } from '../../types' ;
19
20
import ArrowIndicator from '../../arrow-indicator' ;
21
+ import Text from '../../text' ;
20
22
21
23
export type TGeneralContractCardBodyProps = {
22
24
addToast : ( toast_config : TToastConfig ) => void ;
@@ -58,6 +60,7 @@ export type TContractUpdateFormProps = Pick<
58
60
toggleDialog : ( e : React . MouseEvent < HTMLButtonElement > ) => void ;
59
61
getContractById : ( contract_id : number ) => TContractStore ;
60
62
is_accumulator ?: boolean ;
63
+ is_mobile ?: boolean ;
61
64
is_turbos ?: boolean ;
62
65
} ;
63
66
@@ -68,6 +71,7 @@ const ContractUpdateForm = (props: TContractUpdateFormProps) => {
68
71
current_focus,
69
72
error_message_alignment,
70
73
getCardLabels,
74
+ is_mobile,
71
75
is_turbos,
72
76
is_accumulator,
73
77
onMouseLeave,
@@ -173,6 +177,10 @@ const ContractUpdateForm = (props: TContractUpdateFormProps) => {
173
177
value = { contract_profit_or_loss . contract_update_take_profit }
174
178
is_disabled = { is_multiplier && ! ! is_valid_to_cancel }
175
179
setCurrentFocus = { setCurrentFocus }
180
+ tooltip_alignment = { is_mobile ? 'left' : 'right' }
181
+ tooltip_label = {
182
+ < Localize i18n_default_text = 'When your profit reaches or exceeds this amount, your trade will be closed automatically.' />
183
+ }
176
184
/>
177
185
) ;
178
186
@@ -196,6 +204,10 @@ const ContractUpdateForm = (props: TContractUpdateFormProps) => {
196
204
value = { contract_profit_or_loss . contract_update_stop_loss }
197
205
is_disabled = { ! ! is_valid_to_cancel }
198
206
setCurrentFocus = { setCurrentFocus }
207
+ tooltip_alignment = { is_mobile ? 'left' : 'right' }
208
+ tooltip_label = {
209
+ < Localize i18n_default_text = 'When your loss reaches or exceeds this amount, your trade will be closed automatically.' />
210
+ }
199
211
/>
200
212
) ;
201
213
@@ -205,7 +217,9 @@ const ContractUpdateForm = (props: TContractUpdateFormProps) => {
205
217
< React . Fragment >
206
218
< MobileWrapper >
207
219
< div className = 'dc-contract-card-dialog__total-profit' >
208
- < span > { getCardLabels ( ) . TOTAL_PROFIT_LOSS } </ span >
220
+ < Text color = 'less-prominent' size = 'xs' weight = 'bold' >
221
+ { getCardLabels ( ) . TOTAL_PROFIT_LOSS }
222
+ </ Text >
209
223
< div
210
224
className = { classNames (
211
225
'dc-contract-card__profit-loss dc-contract-card-item__total-profit-loss-value' ,
@@ -216,7 +230,7 @@ const ContractUpdateForm = (props: TContractUpdateFormProps) => {
216
230
}
217
231
) }
218
232
>
219
- < Money amount = { total_profit } currency = { currency } />
233
+ < Money amount = { total_profit } currency = { currency } show_currency />
220
234
{ ! is_sold && (
221
235
< ArrowIndicator className = 'dc-contract-card__indicative--movement' value = { total_profit } />
222
236
) }
0 commit comments