Skip to content

Commit 9b18a62

Browse files
matthprostlisalupi
authored andcommitted
feat(OrderSummary): add additional info prop on sub categories (#5683)
1 parent 7bd72c3 commit 9b18a62

File tree

6 files changed

+274
-80
lines changed

6 files changed

+274
-80
lines changed

.changeset/nasty-sides-smoke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ultraviolet/plus": minor
3+
---
4+
5+
Add parameter `additionalInfo` on `subCategories` in `<OrderSummary />`

packages/plus/src/components/OrderSummary/ScrollableContent.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,21 @@ const SubCategory = ({ subCategory }: { subCategory: SubCategoryType }) => {
135135
return (
136136
<Stack direction="column" gap={1}>
137137
<Stack alignItems="center" direction="row" justifyContent="space-between">
138-
{subCategory.title ? (
138+
{subCategory.additionalInfo ? (
139+
<Stack alignItems="center" direction="row" gap={1}>
140+
<Text
141+
as="span"
142+
prominence="strong"
143+
sentiment="neutral"
144+
variant="bodyStrong"
145+
>
146+
{subCategory.title}
147+
</Text>
148+
<Text as="span" italic sentiment="primary" variant="bodySmall">
149+
{subCategory.additionalInfo}
150+
</Text>
151+
</Stack>
152+
) : (
139153
<Text
140154
as="span"
141155
prominence="strong"
@@ -144,7 +158,7 @@ const SubCategory = ({ subCategory }: { subCategory: SubCategoryType }) => {
144158
>
145159
{subCategory.title}
146160
</Text>
147-
) : null}
161+
)}
148162
{subCategory.customContent ? (
149163
<Text
150164
as="span"

packages/plus/src/components/OrderSummary/__stories__/productsExample.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ export const categoryDefault = {
1414
additionalInfo: <AdditionalInfo />,
1515
category: 'Category',
1616
subCategories: [
17-
{ details: ['Detail 1', 'Detail 2'], price: 12.2, title: 'SubCategory' },
17+
{
18+
additionalInfo: <AdditionalInfo />,
19+
details: ['Detail 1', 'Detail 2'],
20+
price: 12.2,
21+
title: 'SubCategory',
22+
},
1823
],
1924
total: 0,
2025
}

0 commit comments

Comments
 (0)