Skip to content

Commit

Permalink
Address were being shown as N/A if a STATE wasn't present. This js ty…
Browse files Browse the repository at this point in the history
…pical behaviour in the States but not in other countries. (#778)
  • Loading branch information
dr-bizz committed Jul 19, 2023
1 parent 1f42f27 commit 1331aa6
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ export const ContactHeaderAddressSection = ({
} else if (envelope && primaryAddress) {
const { street, city, state, postalCode } = primaryAddress;

if (street && city && state && postalCode) {
const mapURL = `https://www.google.com/maps/search/?api=1&query=${street}%2C+${city}%2C+${state}+${postalCode}`;
if (street && city && postalCode) {
const additionalOptions = state ? `${state}+${postalCode}` : postalCode;
const mapURL = `https://www.google.com/maps/search/?api=1&query=${street}%2C+${city}%2C+${additionalOptions}`;

return (
<ContactHeaderSection icon={<LocationIcon />}>
Expand Down

0 comments on commit 1331aa6

Please sign in to comment.