zendeskgarden/react-components

Avatar: extraneous `console.warn` about missing `statusLabel`

Closed this issue · 2 comments

tgohn commented

Expectations

No console.warn about missing statusLabel is logged when using <Avatar /> component without status or badge props.

Consumer of <Avatar /> should not need to add statusLabel props if they do not render avatar's badge or status icons.

Reality

When using a vanilla <Avatar /> component without status or badge props, there is a extraneous console.warn

Warning: you did not provide a customized/translated `statusLabel` text value for <Avatar>. Zendesk Garden is rendering <Avatar statusLabel="status"> by default. 
Screenshot 2023-04-21 at 11 09 38 AM

Steps to Reproduce

  1. Visit this codesandbox, which is the first example of <Avatar/> in the guide
  2. console.warn was printed out, similar to screenshot above

Fine Print

  • Component: Avatar
  • Version: v8.64.0
  • Browsers: all
tgohn commented

There is a relevant discussion here prior.

Thanks for the heads up @tgohn - this should be relatively straightforward. Will have a PR up shortly.