Skip to content

Commit

Permalink
Kate/87510/add existing Take Profit component to Turbos Trade params (d…
Browse files Browse the repository at this point in the history
…eriv-com#77)

* refactor: add existing take profit component for turbos

* refactor: unite condition for riskmanagmentinfo component for multiplier and turbos
  • Loading branch information
kate-deriv authored Feb 6, 2023
1 parent 332dbd2 commit 28104c1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ const CollapsibleTradeParams = ({
has_allow_equals,
previous_symbol,
is_allow_equal,
is_trade_params_expanded,
is_multiplier,
is_trade_params_expanded,
is_turbos,
setIsTradeParamsExpanded,
}) => {
React.useEffect(() => {
Expand Down Expand Up @@ -55,13 +56,13 @@ const CollapsibleTradeParams = ({
</div>
)}
{isVisible('barrier') && (
<div collapsible={'true'}>
<div collapsible='true'>
<BarrierMobile />
</div>
)}
<MobileWidget is_collapsed={is_collapsed} toggleDigitsWidget={toggleDigitsWidget} />
{has_allow_equals && <AllowEqualsMobile collapsible='true' />}
{is_multiplier && (
{(is_multiplier || is_turbos) && (
<div collapsible='true'>
<RiskManagementInfo />
</div>
Expand Down Expand Up @@ -113,6 +114,7 @@ ScreenSmall.propTypes = {
export default connect(({ modules }) => ({
is_allow_equal: !!modules.trade.is_equal,
is_multiplier: modules.trade.is_multiplier,
is_turbos: modules.trade.is_turbos,
duration_unit: modules.trade.duration_unit,
contract_types_list: modules.trade.contract_types_list,
contract_type: modules.trade.contract_type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import CancelDeal from 'Modules/Trading/Components/Elements/Multiplier/cancel-de

const RiskManagementDialog = ({
is_open,
is_turbos,
onClose,
take_profit,
stop_loss,
Expand Down Expand Up @@ -104,13 +105,15 @@ const RiskManagementDialog = ({
onChangeMultiple={onChangeMultipleLocal}
validation_errors={validation_errors}
/>
<StopLoss
stop_loss={state.stop_loss}
has_stop_loss={state.has_stop_loss}
onChange={onChange}
onChangeMultiple={onChangeMultipleLocal}
validation_errors={validation_errors}
/>
{!is_turbos && (
<StopLoss
stop_loss={state.stop_loss}
has_stop_loss={state.has_stop_loss}
onChange={onChange}
onChangeMultiple={onChangeMultipleLocal}
validation_errors={validation_errors}
/>
)}
{should_show_deal_cancellation && (
<CancelDeal
has_take_profit={state.has_take_profit}
Expand Down Expand Up @@ -140,6 +143,7 @@ const RiskManagementDialog = ({
};

export default connect(({ modules }) => ({
is_turbos: modules.trade.is_turbos,
take_profit: modules.trade.take_profit,
has_take_profit: modules.trade.has_take_profit,
stop_loss: modules.trade.stop_loss,
Expand Down

0 comments on commit 28104c1

Please sign in to comment.