@@ -205,13 +205,12 @@ export const Avatars: Story = {
205205const NotificationBadgesExample = ( args ) => {
206206 let badgeValue = 10 ;
207207 let formattedValue = useNumberFormatter ( ) . format ( badgeValue ) ;
208-
209208 return (
210209 < div style = { { display : 'flex' , gap : 8 , padding : 8 , justifyContent : 'center' } } >
211210 < ActionButton aria-label = "Messages has new activity" { ...args } > < CommentIcon /> < NotificationBadge /> </ ActionButton >
212211 < ActionButton aria-label = { `${ formattedValue } notifications` } { ...args } > < BellIcon /> < NotificationBadge value = { badgeValue } /> </ ActionButton >
213212 < ActionButton { ...args } > < CommentIcon /> < Text > Messages</ Text > < NotificationBadge value = { 5 } /> </ ActionButton >
214- < ActionButton { ...args } > < Text > Notifications</ Text > < NotificationBadge value = { 105 } /> </ ActionButton >
213+ { ! args . isQuiet && < ActionButton { ...args } > < Text > Notifications</ Text > < NotificationBadge value = { 105 } /> </ ActionButton > }
215214 </ div >
216215 ) ;
217216} ;
@@ -224,16 +223,18 @@ NotificationBadges.parameters = {
224223 docs : {
225224 source : {
226225 transform : ( ) => {
227- return `let badgeValue = 10;
228- let formattedValue = useNumberFormatter().format(badgeValue);
229-
230- return (
231- <div style={{display: 'flex', gap: 8, padding: 8, justifyContent: 'center'}}>
232- <ActionButton aria-label="Messages has new activity" {...props}><CommentIcon /><NotificationBadge /></ActionButton>
233- <ActionButton aria-label={\`\${formattedValue} notifications\`} {...props}><BellIcon /><NotificationBadge value={badgeValue} /></ActionButton>
234- <ActionButton {...props}><CommentIcon /><Text>Messages</Text><NotificationBadge value={5} /></ActionButton>
235- <ActionButton {...props}><Text>Notifications</Text><NotificationBadge value={105} /></ActionButton>
236- </div>
226+ return `
227+ let badgeValue = 10;
228+ let formattedValue = useNumberFormatter().format(badgeValue);
229+
230+ return (
231+ <div style={{display: 'flex', gap: 8, padding: 8, justifyContent: 'center'}}>
232+ <ActionButton aria-label="Messages has new activity"><CommentIcon /><NotificationBadge /></ActionButton>
233+ <ActionButton aria-label={\`\${formattedValue} notifications\`} ><BellIcon /><NotificationBadge value={badgeValue} /></ActionButton>
234+ <ActionButton><CommentIcon /><Text>Messages</Text><NotificationBadge value={5} /></ActionButton>
235+ {/* Cannot have an label-only quiet Action Button with a Notification Badge */}
236+ {!isQuiet && <ActionButton><Text>Notifications</Text><NotificationBadge value={105} /></ActionButton>}
237+ </div>
237238 )` ;
238239 }
239240 }
0 commit comments