Merge branch 'react-version' of https://github.com/MarcEricMartel/420-5DW-HY-TP into react-version
This commit is contained in:
commit
7a07fea68c
@ -1,7 +1,8 @@
|
|||||||
import { faTimes } from "@fortawesome/free-solid-svg-icons";
|
import { faTimes } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
import { weight } from "fontawesome";
|
||||||
|
|
||||||
const InvoiceItem = ({ invoice, onCancel }) => {
|
const InvoiceItem = ({ invoice, onCancel, paymentInfos }) => {
|
||||||
|
|
||||||
const productTotal = (p) => {
|
const productTotal = (p) => {
|
||||||
return (p.quantity * (p.product.status == 3 || p.product.status == 4 ? p.product.promoPrice : p.product.price))
|
return (p.quantity * (p.product.status == 3 || p.product.status == 4 ? p.product.promoPrice : p.product.price))
|
||||||
@ -81,9 +82,8 @@ const InvoiceItem = ({ invoice, onCancel }) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log(invoice);
|
||||||
return (
|
return (
|
||||||
|
|
||||||
<div className="invoice-item-container">
|
<div className="invoice-item-container">
|
||||||
<div className="invoice-item-info">
|
<div className="invoice-item-info">
|
||||||
{invoice.status != null ?
|
{invoice.status != null ?
|
||||||
@ -99,7 +99,16 @@ const InvoiceItem = ({ invoice, onCancel }) => {
|
|||||||
{invoice.shippingAddress.civicNumber} {invoice.shippingAddress.street} <br />
|
{invoice.shippingAddress.civicNumber} {invoice.shippingAddress.street} <br />
|
||||||
{invoice.shippingAddress.appartment != null ? <>App: {invoice.shippingAddress.appartment} <br /></> : null}
|
{invoice.shippingAddress.appartment != null ? <>App: {invoice.shippingAddress.appartment} <br /></> : null}
|
||||||
{invoice.shippingAddress.city}, {invoice.shippingAddress.province} {invoice.shippingAddress.postalCode}<br />
|
{invoice.shippingAddress.city}, {invoice.shippingAddress.province} {invoice.shippingAddress.postalCode}<br />
|
||||||
{invoice.shippingAddress.country}<br />
|
{invoice.shippingAddress.country}<br /><br/>
|
||||||
|
{paymentInfos == true && invoice.payment != null ? <>
|
||||||
|
<label style={{"fontWeight": "bold"}}>Informations de paiement :</label><br/>
|
||||||
|
Nom : {invoice.payment.name}<br/>
|
||||||
|
Email : {invoice.payment.email}<br/>
|
||||||
|
Téléphone : {invoice.payment.phone}<br/>
|
||||||
|
Numéro de carte : **** **** **** {invoice.payment.lastFourDigits}<br/>
|
||||||
|
</>
|
||||||
|
: null }
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="invoice-item-products">
|
<div className="invoice-item-products">
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import InvoiceItem from "./InvoiceItem";
|
import InvoiceItem from "./InvoiceItem";
|
||||||
|
|
||||||
const InvoiceList = ({ invoices, onCancel }) => {
|
const InvoiceList = ({ invoices, onCancel, paymentInfos }) => {
|
||||||
return (
|
return (
|
||||||
<div className="invoice-list-container">
|
<div className="invoice-list-container">
|
||||||
{invoices.map((invoice) => (
|
{invoices.map((invoice) => (
|
||||||
@ -8,6 +8,7 @@ const InvoiceList = ({ invoices, onCancel }) => {
|
|||||||
key={invoice.id}
|
key={invoice.id}
|
||||||
invoice={invoice}
|
invoice={invoice}
|
||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
|
paymentInfos={paymentInfos}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
@ -86,6 +86,7 @@ const Invoices = () => {
|
|||||||
<InvoiceList
|
<InvoiceList
|
||||||
invoices={invoices}
|
invoices={invoices}
|
||||||
onCancel={handleCancelInvoice}
|
onCancel={handleCancelInvoice}
|
||||||
|
paymentInfos={false}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -69,12 +69,12 @@ const MyInvoices = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<InvoiceList
|
<InvoiceList
|
||||||
invoices={invoices}
|
invoices={invoices}
|
||||||
onCancel={handleCancelInvoice}
|
onCancel={handleCancelInvoice}
|
||||||
|
paymentInfos={true}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user