From 24bb92944849ac2ddf2f777d52c23a150eedffe8 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Tue, 27 Sep 2022 16:07:39 +0530 Subject: Created fully functioning ClientTable --- src/components/tables/client-table.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/components/tables/client-table.js') diff --git a/src/components/tables/client-table.js b/src/components/tables/client-table.js index 8249003..0060184 100644 --- a/src/components/tables/client-table.js +++ b/src/components/tables/client-table.js @@ -17,8 +17,6 @@ import './scss/client-table.scss'; import { deleteClient } from './../../classes/client'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faPencil, faTrashCan } from '@fortawesome/free-solid-svg-icons' const ClientTable = (props) => { const handleEdit = (i) => { @@ -49,9 +47,8 @@ const ClientTable = (props) => {
-

Contact: {i.Contact.Name}

+

Contact: {i.Contact.Name}

-
Phone Number{i.Contact.Phones.length === 1 ? '' : 's'}: {i.Contact.Phones.map((j, id) => ` ${j}${id + 1 === i.Contact.Phones.length ? '' : ','}`)}
@@ -68,16 +65,16 @@ const ClientTable = (props) => {

-

Billing Address:

+

Billing Address:

{i.BillingAddress.Text}

{i.BillingAddress.City}, {i.BillingAddress.State} - {i.BillingAddress.PostalCode} ({i.BillingAddress.Country})

{i.ShippingAddresses.length > 0 && // if billing address != shipping address JSON.stringify(i.ShippingAddresses[0]) !== JSON.stringify(i.BillingAddress) &&
- {i.ShippingAddresses.map(j => -
-

Shipping Address:

+ {i.ShippingAddresses.map((j, id) => +
+

{`Shipping Address ${i.ShippingAddresses.length === 1 ? '' : id + 1}`}

{j.Text}

{j.City}, {j.State} - {j.PostalCode} ({j.Country})

@@ -87,8 +84,8 @@ const ClientTable = (props) => {
- handleEdit(i)}/> - handleDelete(i)}/> + handleEdit(i)}/> + handleDelete(i)}/>

-- cgit v1.2.3