playbook_ui 14.19.0.pre.alpha.PLAY2172homeaddressstreetundefinedstatebug7716 → 14.19.0.pre.alpha.PLAY2172homeaddressstreetundefinedstatebug7733

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 179c2af6fd3485ed04bdcf2e4dba6c201309860e7ebab6bc27f3c5bdf78b4119
4
- data.tar.gz: baeae47fc2895f60c94a0240255545fbd130754b0aaea296d52e06c991fa5df4
3
+ metadata.gz: 709909c013e2e156a203d422ab5104339b05b8fd5736a3dde4366b0778662bb4
4
+ data.tar.gz: 8adf52a05b5c0340d2db99605df968b81444bfaabe75c4bc6a1c1d90abcaa24a
5
5
  SHA512:
6
- metadata.gz: 0ee00f8f9f6c6a289588dff01b1b0d549287fad06a680bff17000ca5f9f69b5425fd91c6773a0466b92e94ac5c2339c01afba1177b7cf90434314363cd9f7310
7
- data.tar.gz: 83978c3f1cc2cf665eaf15c9fc25637c67115d7956793356e72c5512f4ceac85b6354d8140d92041486abd61252caa0ac30693c1a2e61046b4af145f5b92b62e
6
+ metadata.gz: 8ac1160445aa7401de3e70d9c9b5fb05ed96307b264e7b0d7248c3da4300f210de309bd669babe654ff6150a6fcd827c267203a8ab3c7c9c39974e89ef7983b8
7
+ data.tar.gz: f3a2c1c6675cfe06579702fbe8a79eab436329f99239b503b7003dda102b5941a40b4e92d0821722a771d869ea73a0045b6efdd416f28d73fe6fcf0171574d70
@@ -83,6 +83,9 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
83
83
 
84
84
  const uppercaseState = state?.toUpperCase() ?? ''
85
85
 
86
+ const fields = [address, addressCont, city, homeId, homeUrl, houseStyle, state, territory, zipcode]
87
+ const hasAllEmptyProps = fields.every(field => field === undefined || field === null || field === '')
88
+
86
89
  return (
87
90
  <div
88
91
  className={classes(className, dark)}
@@ -90,7 +93,8 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
90
93
  {...dataProps}
91
94
  {...htmlProps}
92
95
  >
93
- {emphasis == 'street' &&
96
+ {hasAllEmptyProps && ''}
97
+ {emphasis == 'street' && !hasAllEmptyProps &&
94
98
  <div>
95
99
  <Title
96
100
  className="pb_home_address_street_address"
@@ -111,7 +115,7 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
111
115
  </Body>
112
116
  </div>
113
117
  }
114
- {emphasis == 'city' &&
118
+ {emphasis == 'city' && !hasAllEmptyProps &&
115
119
  <div>
116
120
  <Body color="light">
117
121
  {joinPresent([formatStreetAdr(address), houseStyle], ' · ')}
@@ -135,7 +139,7 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
135
139
  </div>
136
140
  </div>
137
141
  }
138
- {emphasis == 'none' &&
142
+ {emphasis == 'none' && !hasAllEmptyProps &&
139
143
  <div>
140
144
  <Body dark={dark}>
141
145
  {joinPresent([formatStreetAdr(address), houseStyle], ' · ')}
@@ -41,6 +41,16 @@ const Person = (props: PersonProps): React.ReactElement => {
41
41
  className
42
42
  )
43
43
 
44
+ const hasAllEmptyProps = [firstName, lastName].every(field => field === undefined || field === null || field === '')
45
+
46
+ if (hasAllEmptyProps) {
47
+ return (
48
+ <>
49
+
50
+ </>
51
+ )
52
+ }
53
+
44
54
  return (
45
55
  <div
46
56
  {...ariaProps}
@@ -53,13 +63,13 @@ const Person = (props: PersonProps): React.ReactElement => {
53
63
  className="pb_person_first"
54
64
  tag="span"
55
65
  >
56
- {firstName}
66
+ {firstName ?? ''}
57
67
  </Body>
58
68
  {lastName &&
59
69
  <Title
60
70
  className="pb_person_first"
61
71
  size={4}
62
- text={` ${lastName}`}
72
+ text={lastName ? ` ${lastName}` : ''}
63
73
  />
64
74
  }
65
75
  </div>