react-version #1
@ -1,7 +1,8 @@
|
||||
import { faTimes } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { weight } from "fontawesome";
|
||||
|
||||
const InvoiceItem = ({ invoice, onCancel }) => {
|
||||
const InvoiceItem = ({ invoice, onCancel, paymentInfos }) => {
|
||||
|
||||
const productTotal = (p) => {
|
||||
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 (
|
||||
|
||||
<div className="invoice-item-container">
|
||||
<div className="invoice-item-info">
|
||||
{invoice.status != null ?
|
||||
@ -94,12 +94,21 @@ const InvoiceItem = ({ invoice, onCancel }) => {
|
||||
null
|
||||
}
|
||||
<div className="invoice-item-expedition">
|
||||
<b>Adresse d'expédition:</b><br />
|
||||
<b>Adresse d'expédition :</b><br />
|
||||
{invoice.firstName} {invoice.lastName}<br />
|
||||
{invoice.shippingAddress.civicNumber} {invoice.shippingAddress.street} <br />
|
||||
{invoice.shippingAddress.appartment != null ? <>App: {invoice.shippingAddress.appartment} <br /></> : null}
|
||||
{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 className="invoice-item-products">
|
||||
|
@ -1,6 +1,6 @@
|
||||
import InvoiceItem from "./InvoiceItem";
|
||||
|
||||
const InvoiceList = ({ invoices, onCancel }) => {
|
||||
const InvoiceList = ({ invoices, onCancel, paymentInfos }) => {
|
||||
return (
|
||||
<div className="invoice-list-container">
|
||||
{invoices.map((invoice) => (
|
||||
@ -8,6 +8,7 @@ const InvoiceList = ({ invoices, onCancel }) => {
|
||||
key={invoice.id}
|
||||
invoice={invoice}
|
||||
onCancel={onCancel}
|
||||
paymentInfos={paymentInfos}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
@ -86,6 +86,7 @@ const Invoices = () => {
|
||||
<InvoiceList
|
||||
invoices={invoices}
|
||||
onCancel={handleCancelInvoice}
|
||||
paymentInfos={false}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
@ -69,12 +69,12 @@ const MyInvoices = () => {
|
||||
};
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<InvoiceList
|
||||
invoices={invoices}
|
||||
onCancel={handleCancelInvoice}
|
||||
paymentInfos={true}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user