diff --git a/packages/components/src/components/progress-slider/progress-slider.tsx b/packages/components/src/components/progress-slider/progress-slider.tsx index 716364ee4951..3beb5015bea5 100644 --- a/packages/components/src/components/progress-slider/progress-slider.tsx +++ b/packages/components/src/components/progress-slider/progress-slider.tsx @@ -9,11 +9,11 @@ import moment from 'moment'; type TProgressSliderProps = { className?: string; current_tick: number; - expiry_time: number & string; + expiry_time: number; getCardLabels: () => { [key: string]: string }; // TODO Use the one from shared workspace after migration is_loading: boolean; server_time: moment.Moment; - start_time: number & string; + start_time: number; ticks_count: number; }; diff --git a/packages/reports/src/Constants/data-table-constants.tsx b/packages/reports/src/Constants/data-table-constants.tsx index 01013820fa3f..6d25f78d0b87 100644 --- a/packages/reports/src/Constants/data-table-constants.tsx +++ b/packages/reports/src/Constants/data-table-constants.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { Icon, Label, Money, ContractCard, Popover } from '@deriv/components'; import { isMobile, getCurrencyDisplayCode, getTotalProfit, shouldShowCancellation } from '@deriv/shared'; import { localize, Localize } from '@deriv/translations'; -import ProgressSliderStream from '../Containers/progress-slider-stream.jsx'; +import ProgressSliderStream from '../Containers/progress-slider-stream'; import { getCardLabels } from '_common/contract'; import { getProfitOrLoss } from '../Helpers/profit-loss'; diff --git a/packages/reports/src/Containers/open-positions.tsx b/packages/reports/src/Containers/open-positions.tsx index 8b4808749035..1f37ee79883e 100644 --- a/packages/reports/src/Containers/open-positions.tsx +++ b/packages/reports/src/Containers/open-positions.tsx @@ -20,6 +20,7 @@ import { getTotalProfit, getContractPath, formatPortfolioPosition, + TContractInfo, } from '@deriv/shared'; import { localize, Localize } from '@deriv/translations'; import { ReportsTableRowLoader } from '../Components/Elements/ContentLoader'; @@ -34,7 +35,6 @@ import PlaceholderComponent from '../Components/placeholder-component'; import { getCardLabels } from '_common/contract'; import { connect } from 'Stores/connect'; import type { TRootStore } from 'Stores/index'; -import { TContractInfo } from '@deriv/shared/src/utils/contract/contract-types'; type TRangeFloatZeroToOne = React.ComponentProps['value']; type TFormatPortfolioPosition = ReturnType; diff --git a/packages/reports/src/Containers/progress-slider-stream.jsx b/packages/reports/src/Containers/progress-slider-stream.tsx similarity index 69% rename from packages/reports/src/Containers/progress-slider-stream.jsx rename to packages/reports/src/Containers/progress-slider-stream.tsx index 024822c3d65c..53f70630aaa9 100644 --- a/packages/reports/src/Containers/progress-slider-stream.jsx +++ b/packages/reports/src/Containers/progress-slider-stream.tsx @@ -1,11 +1,18 @@ -import PropTypes from 'prop-types'; import React from 'react'; import { ProgressSlider } from '@deriv/components'; -import { getCurrentTick } from '@deriv/shared'; +import { getCurrentTick, TContractInfo } from '@deriv/shared'; import { connect } from 'Stores/connect'; import { getCardLabels } from '_common/contract'; +import moment from 'moment'; +import { TRootStore } from 'Stores/index'; -const ProgressSliderStream = ({ contract_info, is_loading, server_time }) => { +type TProgressSliderStream = { + contract_info: Required; + is_loading: boolean; + server_time: moment.Moment; +}; + +const ProgressSliderStream = ({ contract_info, is_loading, server_time }: TProgressSliderStream) => { if (!contract_info) { return
; } @@ -24,13 +31,7 @@ const ProgressSliderStream = ({ contract_info, is_loading, server_time }) => { ); }; -ProgressSliderStream.propTypes = { - contract_info: PropTypes.object, - is_loading: PropTypes.bool, - server_time: PropTypes.object, -}; - -export default connect(({ common, portfolio }) => ({ +export default connect(({ common, portfolio }: TRootStore) => ({ is_loading: portfolio.is_loading, server_time: common.server_time, }))(ProgressSliderStream); diff --git a/packages/shared/src/utils/contract/index.ts b/packages/shared/src/utils/contract/index.ts index 394968d22612..a15e2673e86e 100644 --- a/packages/shared/src/utils/contract/index.ts +++ b/packages/shared/src/utils/contract/index.ts @@ -1 +1,2 @@ export * from './contract'; +export * from './contract-types';