Skip to content

Commit

Permalink
fix: review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadtaimoor-deriv committed Jun 20, 2024
1 parent 051d57a commit 3700272
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const ContractDetailsFooter = observer(({ contract_info }: ContractInfoProps) =>
<Button
label={label}
isLoading={is_sell_requested}
disabled={is_sell_requested || (Number(profit) < 0 && is_valid_to_cancel)}
disabled={Number(profit) < 0 && is_valid_to_cancel}
onClick={() => onClickSell(contract_id)}
{...buttonProps}
/>
Expand All @@ -62,8 +62,7 @@ const ContractDetailsFooter = observer(({ contract_info }: ContractInfoProps) =>
onClick={() => onClickCancel(contract_id)}
label={
<>
{cardLabels.CANCEL}
{' '}
{cardLabels.CANCEL}{' '}
<RemainingTime
as='span'
end_time={cancellation_date_expiry}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,21 @@ const DealCancellationRemainingTime = observer(({ format = 'mm:ss' }: DealCancel
}

return (
<React.Fragment>
<Tag
className='deal-cancellation-badge'
color='custom'
data-testid='deal-cancellation-badge'
label={
<RemainingTime
end_time={end_time}
format='mm:ss'
getCardLabels={getCardLabelsV2}
start_time={start_time}
/>
}
size='sm'
variant='custom'
/>
</React.Fragment>
<Tag
className='deal-cancellation-badge'
color='custom'
data-testid='deal-cancellation-badge'
label={
<RemainingTime
end_time={end_time}
format='mm:ss'
getCardLabels={getCardLabelsV2}
start_time={start_time}
/>
}
size='sm'
variant='custom'
/>
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const EntryExitDetails = ({ contract_info }: { contract_info: TContractInfo }) =
const exitValue = exit_tick_display_value ? addComma(exit_tick_display_value) : null;

return (
<CardWrapper title='Entry & exit details' className='entry-exit-details'>
<CardWrapper title={<Localize i18n_default_text='Entry & exit details' />} className='entry-exit-details'>
<div className='entry-exit-details__table'>
{dateTimes.start && (
<EntryExitDetailRow
Expand Down
22 changes: 10 additions & 12 deletions packages/trader/src/AppV2/Components/TakeProfit/take-profit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ const TakeProfit = observer(() => {
const { contract_info } = useContractDetails();
const { limit_order } = contract_info;
const { isTakeProfitVisible } = getContractDetailsConfig(contract_info.contract_type ?? '');
return (
isTakeProfitVisible && (
<RiskManagementItem
label={<Localize i18n_default_text='Take profit' />}
modal_body_content={
<Localize i18n_default_text='When your profit reaches or exceeds the set amount, your trade will be closed automatically.' />
}
value={limit_order?.take_profit?.order_amount}
type='take_profit'
/>
)
);
return isTakeProfitVisible ? (
<RiskManagementItem
label={<Localize i18n_default_text='Take profit' />}
modal_body_content={
<Localize i18n_default_text='When your profit reaches or exceeds the set amount, your trade will be closed automatically.' />
}
value={limit_order?.take_profit?.order_amount}
type='take_profit'
/>
) : null;
});

export default TakeProfit;
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,14 @@ const ContractDetails = observer(() => {
<div className='contract-card-wrapper'>
<ContractCard contractInfo={contract_info} serverTime={server_time} />
</div>

<ChartPlaceholder />

<DealCancellation />
{showRiskManagement && (
<CardWrapper>
<TakeProfit />
<StopLoss />
</CardWrapper>
)}

<OrderDetails contract_info={contract_info} />
<PayoutInfo contract_info={contract_info} />
<EntryExitDetails contract_info={contract_info} />
Expand Down
4 changes: 2 additions & 2 deletions packages/trader/src/AppV2/Routes/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const Router: React.FC = () => {
is_logged_in={is_logged_in}
language={current_language}
Component404={Page404}
should_redirect_login={true}
should_redirect_login
routes={traderRoutes}
to={''}
to=''
{...route}
/>
))}
Expand Down

0 comments on commit 3700272

Please sign in to comment.