Skip to content

Commit

Permalink
Updated orders-preview & orders-row - removed method & table heading
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhish-nayak committed Aug 5, 2023
1 parent 5d32b67 commit 194799f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
3 changes: 0 additions & 3 deletions src/components/orders-preview/orders-preview.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const OrdersPreview = () => {
<th>Order No.</th>
<th>OrdersType (Quantity)</th>
<th>Total</th>
<th>Payment Type</th>
<th>Status</th>
</tr>
</thead>
Expand All @@ -46,15 +45,13 @@ const OrdersPreview = () => {
const paymentDetail: PaymentDetailsType = paymentDetails[
index
] || {
method: "N/A",
status: "N/A",
};
return (
<OrderRow
key={index}
order={order}
index={index}
method={paymentDetail.method}
status={paymentDetail.status}
/>
);
Expand Down
3 changes: 1 addition & 2 deletions src/components/orders-row/orders-row.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import { OrdersType } from "../../store/orders/orders.types";
type OrderRowType = {
order: OrdersType;
index: number;
method: string;
status: string;
};

const OrderRow: React.FC<OrderRowType> = ({ order, index, method, status }) => {
const OrderRow: React.FC<OrderRowType> = ({ order, index, status }) => {
const calculateTotalPrice = (order: OrdersType) => {
const totalPrice = order.reduce(
(accumulator, item) => accumulator + item.price * item.quantity,
Expand Down

0 comments on commit 194799f

Please sign in to comment.