-
Notifications
You must be signed in to change notification settings - Fork 166
[terra-avatar] Changed Shared user variant to Generic Avatar variant #2620
Conversation
genericIconClassNames = cx(['icon', GENERIC_VARIANTS.SHARED_USER]); | ||
} else if (variant === GENERIC_VARIANTS.PROVIDER) { | ||
genericIconClassNames = cx(['icon', GENERIC_VARIANTS.PROVIDER]); | ||
} | ||
|
||
/* eslint-disable react/forbid-dom-props */ | ||
return ( | ||
<div {...attributes} className={multiUserClassNames} style={customStyles}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rename multiUserClassNames
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated here
packages/terra-avatar/CHANGELOG.md
Outdated
@@ -3,6 +3,8 @@ ChangeLog | |||
|
|||
Unreleased | |||
---------- | |||
### Changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a MVB, right? Removing a variant altogether is a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes this will be MVB..
|
||
### Added | ||
* `Generic` Variant with props same as `Shared User` and with `Variant` prop to support sub-variants like `single-user`, `shared-user` and `provider`. | ||
* `variant` prop. this will take values for sub-variants `single-user`, `shared-user` and `provider`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is confusing to me as I understand that you are probably talking about the variant
prop of Generic
sub-component but at first glance, I felt this is in contradiction to what was mentioned earlier.
I'd remove this line altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced line with suggested line below..!
* `Shared User` Variant From Avatar Variants | ||
|
||
### Added | ||
* `Generic` Variant with props same as `Shared User` and with `Variant` prop to support sub-variants like `single-user`, `shared-user` and `provider`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `Generic` Variant with props same as `Shared User` and with `Variant` prop to support sub-variants like `single-user`, `shared-user` and `provider`. | |
* the `generic` subcomponent that replaces the `sharedUser` subcomponent with a new `variant` prop that can be `single-user`, `shared-user`, or `provider`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @nramamurth. yes that sounds more appropriate. updated here : 5f17135
<div {...attributes} className={multiUserClassNames} style={customStyles}> | ||
{multiUserContent} | ||
<div {...attributes} className={GenericUserClassNames} style={customStyles}> | ||
<span className={genericIconClassNames} role="img" aria-label={alt} alt={alt} aria-hidden={isAriaHidden} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need aria-hidden attribute also here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok got it, this is actually a prop
|
||
const cx = classNames.bind(styles); | ||
|
||
const GENERIC_VARIANTS = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@supreethmr we will have to export this separately so that consumer can access it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added export : 4a470cf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have identical single, multi, and provider examples. Let's eliminate some redundancy.
Want to add an example that toggles between the three generic variants? Then, remove all multi and provider examples.
UX Input |
packages/terra-avatar/CHANGELOG.md
Outdated
@@ -3,6 +3,9 @@ ChangeLog | |||
|
|||
Unreleased | |||
---------- | |||
### Breaking Changes | |||
* `generic` subcomponent replaces the `sharedUser` subcomponent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a rationale for this breaking change? We're trying to make sure we provide that for breaking changes going forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have modified the change log for this code changes: 128dd37 . Let me know if any changes needs to be made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested: PR #2620
Resolves: Issue #2026
Reviewed:
- Follows pattern considerations documented in the current Cerner Design Standards: Avatar - User Experience - Cerner Wiki
- Follows UX defined design implementation for Avatar
- Follows defined theme designs: terra-theme
Verified by @jeremyfuksa, Marking as Verified, Ready for Release.
Pass |
---|
UX Review |
…iant # Conflicts: # packages/terra-avatar/docs/generic.md # packages/terra-avatar/package.json # packages/terra-avatar/src/terra-dev-site/doc/avatar/About.1.doc.mdx
Summary
Resolves #2026
Additional Details
Replaced Shared user variant with Generic Variant and added sub-variants single-user, shared-user, provider variants for Generic variant.