add fallback page title for nameless customers
This commit is contained in:
parent
9329277268
commit
afd2b1dddb
2 changed files with 17 additions and 2 deletions
|
@ -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"
|
||||
},
|
||||
|
|
|
@ -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<CustomerAddressListPageProps> = props =>
|
|||
return (
|
||||
<Container>
|
||||
<Backlink onClick={onBack}>
|
||||
{intl.formatMessage(messages.fullNameDetail, { fullName })}
|
||||
{fullName.trim().length > 0
|
||||
? intl.formatMessage(messages.fullNameDetail, { fullName })
|
||||
: intl.formatMessage(messages.noNameToShow)}
|
||||
</Backlink>
|
||||
{!isEmpty && (
|
||||
<PageHeader
|
||||
title={intl.formatMessage(messages.fullNameAddress, { fullName })}
|
||||
title={
|
||||
fullName.trim().length > 0
|
||||
? intl.formatMessage(messages.fullNameAddress, { fullName })
|
||||
: intl.formatMessage(messages.noNameToShow)
|
||||
}
|
||||
>
|
||||
<Button color="primary" variant="contained" onClick={onAdd}>
|
||||
{intl.formatMessage(messages.addAddress)}
|
||||
|
|
Loading…
Reference in a new issue