Skip to content

Commit

Permalink
chore: migrate account statistics to ts (#14)
Browse files Browse the repository at this point in the history
* chore: migrate account statistics to ts

* fix: typo in comment
  • Loading branch information
aizad-deriv committed Jan 12, 2023
1 parent 04c8414 commit ecbb7fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import React from 'react';
import PropTypes from 'prop-types';
import { MobileWrapper, Money, Text } from '@deriv/components';
import { localize } from '@deriv/translations';
import { connect } from 'Stores/connect';

const AccountStatistics = ({ account_statistics, currency }) => {
type TAccountStatistics = {
account_statistics: {
total_withdrawals: number;
total_deposits: number;
};
currency: string;
};

const AccountStatistics = ({ account_statistics, currency }: TAccountStatistics) => {
return (
<div className='statement__account-statistics'>
<div className='statement__account-statistics-item'>
Expand Down Expand Up @@ -59,12 +66,8 @@ const AccountStatistics = ({ account_statistics, currency }) => {
);
};

AccountStatistics.propTypes = {
account_statistics: PropTypes.object,
currency: PropTypes.string,
};

export default connect(({ modules, client }) => ({
// TODO: implement reports store TRootStore in types.ts
export default connect(({ modules, client }: any) => ({
account_statistics: modules.statement.account_statistics,
currency: client.currency,
}))(AccountStatistics);
2 changes: 1 addition & 1 deletion packages/reports/src/Containers/statement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { getSupportedContracts } from '_common/contract';
import { connect } from 'Stores/connect';
import { getStatementTableColumnsTemplate } from '../Constants/data-table-constants';
import PlaceholderComponent from '../Components/placeholder-component.jsx';
import AccountStatistics from '../Components/account-statistics.jsx';
import AccountStatistics from '../Components/account-statistics';
import FilterComponent from '../Components/filter-component.jsx';
import { ReportsMeta } from '../Components/reports-meta';
import EmptyTradeHistoryMessage from '../Components/empty-trade-history-message';
Expand Down

0 comments on commit ecbb7fd

Please sign in to comment.