@@ -124,23 +124,22 @@ invoiceSummaries invoices =
124
124
125
125
customerHtml :: ∀ m . MonadAff m => Stripe.Customer -> ComponentHTML Action ChildSlots m
126
126
customerHtml c =
127
- table []
127
+ table [] $
128
128
[ tr [] [ th [] [ text " name" ]
129
129
, td [] [ text $ fold c.name ]
130
130
]
131
+ , tr [] [ th [] [ text " description" ]
132
+ , td [] [ text $ fold c.description ]
133
+ ]
131
134
, tr [] [ th [] [ text " email" ]
132
135
, td [] [ text $ fold c.email ]
133
136
]
134
137
, tr [] [ th [] [ text " phone" ]
135
138
, td [] [ text $ fold c.phone ]
136
139
]
137
- , tr [] [ th [] [ text " description" ]
138
- , td [] [ text $ fold c.description ]
139
- ]
140
- , tr [] [ th [] [ text " address" ]
141
- , td [] [ maybe (text " no address" ) addressHtml c.address ]
142
- ]
143
- , tr [] [ th [] [ text " balance" ]
140
+ ] <>
141
+ foldMap addressRowsHtml c.address <>
142
+ [ tr [] [ th [] [ text " balance" ]
144
143
, td [] [ text $ c.currency <> " " <> show c.balance <> " cents" ]
145
144
]
146
145
, tr [] [ th [] [ text " tax ids" ]
@@ -174,7 +173,7 @@ billingDetailsHtml bd = nameAddressPhoneHtml bd
174
173
175
174
nameAddressPhoneHtml :: ∀ r m . MonadAff m => { | Stripe.NameAddressPhoneRow () } -> ComponentHTML Action ChildSlots m
176
175
nameAddressPhoneHtml x =
177
- table []
176
+ table [] $
178
177
[ tr [] [ th [] [ text " name" ]
179
178
, td [] [ text $ fold x.name ]
180
179
]
@@ -184,30 +183,31 @@ nameAddressPhoneHtml x =
184
183
, tr [] [ th [] [ text " phone" ]
185
184
, td [] [ text $ fold x.phone ]
186
185
]
187
- , tr [] [ th [] [ text " address" ]
188
- , td [] [ maybe (text " no address" ) addressHtml x.address ]
189
- ]
190
- ]
186
+ ] <>
187
+ foldMap addressRowsHtml x.address
191
188
192
189
addressHtml :: ∀ m . MonadAff m => Stripe.Address -> ComponentHTML Action ChildSlots m
193
- addressHtml a =
194
- table []
195
- [ tr [] [ th [] [ text " address" ]
196
- , td [] [ text $ fold a.line1, br [] , text $ fold a.line2 ]
197
- ]
198
- , tr [] [ th [] [ text " city" ]
199
- , td [] [ text $ fold a.city ]
200
- ]
201
- , tr [] [ th [] [ text " postal code" ]
202
- , td [] [ text $ fold a.postal_code ]
203
- ]
204
- , tr [] [ th [] [ text " state" ]
205
- , td [] [ text $ fold a.state ]
206
- ]
207
- , tr [] [ th [] [ text " country" ]
208
- , td [] [ text $ fold a.country ]
209
- ]
210
- ]
190
+ addressHtml a = table [] (addressRowsHtml a)
191
+
192
+ addressRowsHtml :: ∀ m . MonadAff m => Stripe.Address -> Array (ComponentHTML Action ChildSlots m )
193
+ addressRowsHtml a =
194
+ [ tr [] [ th [] [ text " address" ]
195
+ , td [] [ text $ fold a.line1, br [] , text $ fold a.line2 ]
196
+ ]
197
+ , tr [] [ th [] [ text " city" ]
198
+ , td [] [ text $ fold a.city ]
199
+ ]
200
+ , tr [] [ th [] [ text " postal code" ]
201
+ , td [] [ text $ fold a.postal_code ]
202
+ ]
203
+ , tr [] [ th [] [ text " state" ]
204
+ , td [] [ text $ fold a.state ]
205
+ ]
206
+ , tr [] [ th [] [ text " country" ]
207
+ , td [] [ text $ fold a.country ]
208
+ ]
209
+ ]
210
+
211
211
212
212
cardHtml :: ∀ m . MonadAff m => Stripe.Card -> ComponentHTML Action ChildSlots m
213
213
cardHtml c =
0 commit comments