Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Paragon table deprecation migration to DataTable #200

31 changes: 18 additions & 13 deletions src/order-history/OrderHistoryPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
FormattedDate,
FormattedNumber,
} from '@edx/frontend-platform/i18n';
import { Table, Hyperlink, Pagination } from '@edx/paragon';
import { DataTable, Hyperlink, Pagination } from '@edx/paragon';
import MediaQuery from 'react-responsive';

import messages from './OrderHistoryPage.messages';
Expand Down Expand Up @@ -91,32 +91,35 @@ class OrderHistoryPage extends React.Component {

renderOrdersTable() {
return (
<Table
<DataTable
className="order-history table-bordered"
data={this.getTableData()}
itemCount={this.props.count}
columns={[
{
label: this.props.intl.formatMessage(messages['ecommerce.order.history.table.column.items']),
key: 'description',
Header: this.props.intl.formatMessage(messages['ecommerce.order.history.table.column.items']),
accessor: 'description',
},
{
label: this.props.intl.formatMessage(messages['ecommerce.order.history.table.column.date.placed']),
key: 'datePlaced',
Header: this.props.intl.formatMessage(messages['ecommerce.order.history.table.column.date.placed']),
accessor: 'datePlaced',
},
{
label: this.props.intl.formatMessage(messages['ecommerce.order.history.table.column.total.cost']),
key: 'total',
Header: this.props.intl.formatMessage(messages['ecommerce.order.history.table.column.total.cost']),
accessor: 'total',
},
{
label: this.props.intl.formatMessage(messages['ecommerce.order.history.table.column.order.number']),
key: 'orderId',
Header: this.props.intl.formatMessage(messages['ecommerce.order.history.table.column.order.number']),
accessor: 'orderId',
},
{
label: this.props.intl.formatMessage(messages['ecommerce.order.history.table.column.order.details']),
key: 'receiptUrl',
Header: this.props.intl.formatMessage(messages['ecommerce.order.history.table.column.order.details']),
accessor: 'receiptUrl',
},
]}
/>
>
<DataTable.Table />
</DataTable>
);
}

Expand Down Expand Up @@ -222,6 +225,7 @@ OrderHistoryPage.propTypes = {
})),
})),
pageCount: PropTypes.number,
count: PropTypes.number,
currentPage: PropTypes.number,
loading: PropTypes.bool,
loadingError: PropTypes.string,
Expand All @@ -233,6 +237,7 @@ OrderHistoryPage.defaultProps = {
loadingError: null,
loading: false,
pageCount: 0,
count: 0,
currentPage: null,
};

Expand Down