From a63922ba2f41a59dcc34ea8a67d96c7a8846a8c8 Mon Sep 17 00:00:00 2001 From: Ysrbolles Date: Thu, 12 Dec 2024 12:00:03 +0100 Subject: [PATCH] fix: enhance partner details display and add pagination to business base URL --- src/redux/services/partners.ts | 6 +- src/views/partners/Partner.tsx | 171 ++++++++++++++++++--------------- 2 files changed, 98 insertions(+), 79 deletions(-) diff --git a/src/redux/services/partners.ts b/src/redux/services/partners.ts index 628ada60..fc006f36 100644 --- a/src/redux/services/partners.ts +++ b/src/redux/services/partners.ts @@ -190,11 +190,11 @@ const getBaseUrl = () => { const getBusinessBaseUrl = () => { const currentPath = typeof window !== 'undefined' ? window.location.hostname : '' if (currentPath === 'localhost' || currentPath.includes('dev')) { - return BUSINESS_BASE_URLS.dev + return BUSINESS_BASE_URLS.dev + '?pagination[pageSize]=1000' } else if (currentPath) { - return BUSINESS_BASE_URLS.prod + return BUSINESS_BASE_URLS.prod + '?pagination[pageSize]=1000' } else { - return BUSINESS_BASE_URLS.prod + return BUSINESS_BASE_URLS.prod + '?pagination[pageSize]=1000' } } diff --git a/src/views/partners/Partner.tsx b/src/views/partners/Partner.tsx index 5a1fbca7..7d953157 100644 --- a/src/views/partners/Partner.tsx +++ b/src/views/partners/Partner.tsx @@ -584,12 +584,14 @@ const Partner = () => { isPartnerView={true} /> - - Description - - {partner.attributes.companyLongDescription} - - + {partner.attributes.companyLongDescription && ( + + Description + + {partner.attributes.companyLongDescription} + + + )} { /> - - {partner.attributes.country_flag && - partner.attributes.country_flag.data?.attributes && ( - - )} - - - - theme.palette.card.text, - fontSize: '16px', - fontStyle: 'normal', - fontWeight: 400, - lineHeight: '150%', - }} - > - {partner.attributes.contactFirstname + - ' ' + - partner.attributes.contactLastname} - - + {partner.attributes.country_flag.data.attributes && ( + + {partner.attributes.country_flag && + partner.attributes.country_flag.data?.attributes && ( + + )} + + )} - - + {(partner?.attributes?.contactFirstname || + partner?.attributes?.contactLastname) && ( + theme.palette.card.text, @@ -752,51 +739,83 @@ const Partner = () => { lineHeight: '150%', }} > - {partner.attributes.contactEmail} + {[ + partner?.attributes?.contactFirstname, + partner?.attributes?.contactLastname, + ] + .filter(Boolean) + .join(' ')} - - + + )} + - - - theme.palette.card.text, - fontSize: '16px', - fontStyle: 'normal', - fontWeight: 400, - lineHeight: '150%', - }} + {partner.attributes.contactEmail && ( + + - {partner.attributes.contactPhone} - - - + theme.palette.card.text, + fontSize: '16px', + fontStyle: 'normal', + fontWeight: 400, + lineHeight: '150%', + }} + > + {partner.attributes.contactEmail} + + + + )} - - - theme.palette.card.text, - fontSize: '16px', - fontStyle: 'normal', - fontWeight: 400, - lineHeight: '150%', - }} + {partner.attributes.contactPhone && ( + + - {partner.attributes.companyWebsite} - - - + theme.palette.card.text, + fontSize: '16px', + fontStyle: 'normal', + fontWeight: 400, + lineHeight: '150%', + }} + > + {partner.attributes.contactPhone} + + + + )} + + {partner.attributes.companyWebsite && ( + + + theme.palette.card.text, + fontSize: '16px', + fontStyle: 'normal', + fontWeight: 400, + lineHeight: '150%', + }} + > + {partner.attributes.companyWebsite} + + + + )}