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 #191

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 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,29 +91,30 @@ class OrderHistoryPage extends React.Component {

renderOrdersTable() {
return (
<Table
<DataTable
className="order-history table-bordered"
data={this.getTableData()}
itemCount={this.props.orders.length}
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',
},
]}
/>
Expand Down