diff --git a/locale/defaultMessages.json b/locale/defaultMessages.json index cb96186d0..4f97b338a 100644 --- a/locale/defaultMessages.json +++ b/locale/defaultMessages.json @@ -2599,6 +2599,10 @@ "src_dot_customers_dot_components_dot_CustomerAddressListPage_dot_noAddressToShow": { "string": "There is no address to show for this customer" }, + "src_dot_customers_dot_components_dot_CustomerAddressListPage_dot_noNameToShow": { + "context": "customer's address book when no customer name is available, header", + "string": "Address Book" + }, "src_dot_customers_dot_components_dot_CustomerAddress_dot_defaultAddress": { "string": "Default Address" }, diff --git a/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx b/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx index f29acc629..09939cc62 100644 --- a/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx +++ b/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx @@ -34,6 +34,11 @@ const messages = defineMessages({ defaultMessage: "{fullName}'s Address Book", description: "customer's address book, header" }, + noNameToShow: { + defaultMessage: "Address Book", + description: + "customer's address book when no customer name is available, header" + }, fullNameDetail: { defaultMessage: "{fullName} Details", description: "customer details, header" @@ -93,11 +98,17 @@ const CustomerAddressListPage: React.FC = props => return ( - {intl.formatMessage(messages.fullNameDetail, { fullName })} + {fullName.trim().length > 0 + ? intl.formatMessage(messages.fullNameDetail, { fullName }) + : intl.formatMessage(messages.noNameToShow)} {!isEmpty && ( 0 + ? intl.formatMessage(messages.fullNameAddress, { fullName }) + : intl.formatMessage(messages.noNameToShow) + } >