@@ -245,31 +245,34 @@ function DataSummary(formattedResults: FormattedCDBEstimator) {
245
245
return (
246
246
< div className = "my-8 rounded bg-stone-100 p-5 md:mt-0 md:max-w-[360px]" >
247
247
< h3 className = "font-lato text-xl font-bold" > { t ( 'estimator:results.form-data-summary.title' ) } </ h3 >
248
- < div >
248
+ < dl >
249
249
< DataSummaryItem
250
- className = ""
250
+ classNameDt = "pt-4"
251
+ classNameDd = "pb-4"
251
252
title = { t ( 'estimator:results.form-data-summary.field-labels.marital-status' ) }
252
253
editAriaLabel = { t ( 'estimator:results.form-data-summary.edit-aria-labels.marital-status' ) }
253
254
editRoute = { 'routes/estimator/step-marital-status.tsx' }
254
255
value = { formattedResults . maritalStatus }
255
- showBorder = { false }
256
+ showBorder = { true }
256
257
showEditButton = { true }
257
258
data-gc-analytics-customclick = { adobeAnalytics . getCustomClick ( 'Results:Edit marital status button' ) }
258
259
/>
259
260
< DataSummaryItem
260
- className = "pb-2"
261
+ classNameDt = "pt-4"
262
+ classNameDd = { formattedResults . income . kind === 'married' ? 'pb-2' : 'pb-4' }
261
263
title = { t ( 'estimator:results.form-data-summary.field-labels.total-income' ) }
262
264
editAriaLabel = { t ( 'estimator:results.form-data-summary.edit-aria-labels.income' ) }
263
265
editRoute = { 'routes/estimator/step-income.tsx' }
264
266
value = { formattedResults . income . individualIncome . totalIncome }
265
- showBorder = { true }
267
+ showBorder = { false }
266
268
showEditButton = { formattedResults . income . kind !== 'married' }
267
269
data-gc-analytics-customclick = { adobeAnalytics . getCustomClick ( 'Results:Edit income button' ) }
268
270
/>
269
271
270
272
{ formattedResults . income . kind === 'married' && (
271
273
< DataSummaryItem
272
- className = "pt-0"
274
+ classNameDt = { undefined }
275
+ classNameDd = { undefined }
273
276
title = { t ( 'estimator:results.form-data-summary.field-labels.partner-total-income' ) }
274
277
editAriaLabel = { t ( 'estimator:results.form-data-summary.edit-aria-labels.income' ) }
275
278
editRoute = { 'routes/estimator/step-income.tsx' }
@@ -279,7 +282,7 @@ function DataSummary(formattedResults: FormattedCDBEstimator) {
279
282
data-gc-analytics-customclick = { adobeAnalytics . getCustomClick ( 'Results:Edit income button' ) }
280
283
/>
281
284
) }
282
- </ div >
285
+ </ dl >
283
286
</ div >
284
287
) ;
285
288
}
@@ -290,7 +293,8 @@ interface DataSummaryItemProps {
290
293
value : string ;
291
294
showEditButton : boolean ;
292
295
showBorder : boolean ;
293
- className : string ;
296
+ classNameDt : string | undefined ;
297
+ classNameDd : string | undefined ;
294
298
}
295
299
function DataSummaryItem ( {
296
300
title,
@@ -299,27 +303,28 @@ function DataSummaryItem({
299
303
value,
300
304
showBorder,
301
305
showEditButton,
302
- className,
306
+ classNameDt,
307
+ classNameDd,
303
308
...rest
304
309
} : DataSummaryItemProps ) {
305
310
const { t } = useTranslation ( handle . i18nNamespace ) ;
306
311
307
312
return (
308
- < div className = { cn ( 'py-4' , className , showBorder ? 'border-t border-stone-600' : '' ) } >
309
- < div > { title } </ div >
310
- < div className = "grid grid-cols-3 gap-0" >
311
- < div className = "col-span-2" >
312
- < strong > { value } </ strong >
313
- </ div >
313
+ < >
314
+ < dt className = { cn ( classNameDt ) } > { title } </ dt >
315
+ < dd className = { cn ( classNameDd , showBorder ? 'border-b border-stone-600' : '' ) } >
316
+ < div className = "flex justify-end" >
317
+ < strong className = "mr-auto" > { value } </ strong >
314
318
315
- { showEditButton && (
316
- < div className = "self-end justify-self-end" >
317
- < InlineLink { ...rest } file = { editRoute } aria-label = { editAriaLabel } >
318
- { t ( 'common:edit' ) }
319
- </ InlineLink >
320
- </ div >
321
- ) }
322
- </ div >
323
- </ div >
319
+ { showEditButton && (
320
+ < div className = "mt-auto ml-auto" >
321
+ < InlineLink { ...rest } file = { editRoute } aria-label = { editAriaLabel } >
322
+ { t ( 'common:edit' ) }
323
+ </ InlineLink >
324
+ </ div >
325
+ ) }
326
+ </ div >
327
+ </ dd >
328
+ </ >
324
329
) ;
325
330
}
0 commit comments