File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed
packages/plus/src/components/OfferList Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @ultraviolet/plus " : patch
3+ ---
4+
5+ ` OfferList ` : add prop "prominence" for badge
Original file line number Diff line number Diff line change @@ -3,14 +3,28 @@ import type { ComponentProps } from 'react'
33import { OfferList } from '../OfferList'
44import { columns , data } from './resources'
55
6+ const getTextBadge = ( index : number ) => {
7+ if ( index === 1 ) {
8+ return 'I am a primary badge'
9+ }
10+ if ( index === 2 ) {
11+ return 'I am a disabled badge'
12+ }
13+ if ( index === 3 ) {
14+ return 'I am a strong badge '
15+ }
16+
17+ return 'I am a badge'
18+ }
619export const Badge : StoryFn < ComponentProps < typeof OfferList > > = props => (
720 < OfferList { ...props } expandable >
821 { data . map ( ( planet , index ) =>
9- index < 3 ? (
22+ index < 4 ? (
1023 < OfferList . Row
1124 badge = { {
25+ prominence : index === 3 ? 'strong' : 'default' ,
1226 sentiment : index === 1 ? 'primary' : 'neutral' ,
13- text : 'I am a badge' ,
27+ text : getTextBadge ( index ) ,
1428 } }
1529 disabled = { index === 2 }
1630 expandable = "Some text"
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ type RowProps = ComponentProps<typeof List.Row> & {
3838 badge ?: {
3939 text : string
4040 sentiment ?: ComponentProps < typeof BadgeUV > [ 'sentiment' ]
41+ prominence ?: ComponentProps < typeof BadgeUV > [ 'prominence' ]
4142 }
4243 style ?: CSSProperties
4344}
@@ -158,6 +159,7 @@ export const Row = ({
158159 < BadgeUV
159160 className = { offerListBadge }
160161 disabled = { disabled }
162+ prominence = { badge . prominence }
161163 sentiment = { badge . sentiment }
162164 size = "small"
163165 >
You can’t perform that action at this time.
0 commit comments