From 99f941f89a01d4a9994cca17c570f916485edc27 Mon Sep 17 00:00:00 2001 From: ahmadtaimoor-deriv <129935294+ahmadtaimoor-deriv@users.noreply.github.com> Date: Fri, 14 Jun 2024 13:17:21 +0800 Subject: [PATCH] chore: fixes --- .../remaining-time/remaining-time.tsx | 12 +++- .../contract-details-footer.tsx | 34 +++++++++--- .../ContractDetails/contract-details.scss | 6 +- .../ContractDetails/contract-details.tsx | 55 ++++++++++--------- 4 files changed, 67 insertions(+), 40 deletions(-) diff --git a/packages/components/src/components/remaining-time/remaining-time.tsx b/packages/components/src/components/remaining-time/remaining-time.tsx index 293b11be71eb..cecb84eb83a3 100644 --- a/packages/components/src/components/remaining-time/remaining-time.tsx +++ b/packages/components/src/components/remaining-time/remaining-time.tsx @@ -11,9 +11,17 @@ type TRemainingTimeProps = { start_time: moment.Moment; format?: string; getCardLabels: TGetCardLables; + className?: string; }; -const RemainingTime = ({ as = 'div', end_time, format, getCardLabels, start_time }: TRemainingTimeProps) => { +const RemainingTime = ({ + as = 'div', + end_time, + format, + getCardLabels, + start_time, + className = 'dc-remaining-time', +}: TRemainingTimeProps) => { const Tag = as; if (!end_time || start_time.unix() > +end_time) { return {''}; @@ -26,7 +34,7 @@ const RemainingTime = ({ as = 'div', end_time, format, getCardLabels, start_time } const is_zeroes = /^00:00$/.test(remaining_time); - return {!is_zeroes && {remaining_time}}; + return {!is_zeroes && {remaining_time}}; }; export default RemainingTime; diff --git a/packages/trader/src/AppV2/Components/ContractDetailsFooter/contract-details-footer.tsx b/packages/trader/src/AppV2/Components/ContractDetailsFooter/contract-details-footer.tsx index 10a2fb8a4b0a..1cb3b56f7124 100644 --- a/packages/trader/src/AppV2/Components/ContractDetailsFooter/contract-details-footer.tsx +++ b/packages/trader/src/AppV2/Components/ContractDetailsFooter/contract-details-footer.tsx @@ -1,5 +1,13 @@ -import { Button } from '@deriv-com/quill-ui'; -import { TContractInfo, getCardLabels, isMultiplierContract, isValidToCancel, isValidToSell } from '@deriv/shared'; +import { Button, Text } from '@deriv-com/quill-ui'; +import { RemainingTime } from '@deriv/components'; +import { + TContractInfo, + formatMoney, + getCardLabels, + isMultiplierContract, + isValidToCancel, + isValidToSell, +} from '@deriv/shared'; import { useStore } from '@deriv/stores'; import { getRemainingTime } from 'AppV2/Utils/helper'; import { observer } from 'mobx-react'; @@ -44,12 +52,20 @@ const ContractDetailsFooter = observer(({ contract_info }: ContractInfoProps) =>