-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EuiCommentList] Convert to Emotion
, allow custom
children and new event
props
#6030
Conversation
custom
children and new event
propsEmotion
, allow custom
children and new event
props
Preview documentation changes for this PR: https://eui.elastic.co/pr_6030/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_6030/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_6030/ |
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.
Initial review for src-docs
changes.
One suggested change doesn't fit the PR feedback format well, so I've opened a PR for that one - elizabetdev#30
Should eventColor=plain
cause this drop shadow?
src-docs/src/views/notification_event/notification_event_example.js
Outdated
Show resolved
Hide resolved
…_flexible [comment flexible example] remove 'any' type usage
Preview documentation changes for this PR: https://eui.elastic.co/pr_6030/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_6030/ |
Co-authored-by: Chandler Prall <[email protected]>
Preview documentation changes for this PR: https://eui.elastic.co/pr_6030/ |
Thanks, @chandlerprall. I went through your review and pushed 7e31abc and 2bc273f. Let me know if there is anything missing. |
Preview documentation changes for this PR: https://eui.elastic.co/pr_6030/ |
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.
Changes LGTM!
Summary
This PR adds new props and other enhancements to
EuiCommentList/EuiComment
. Part of the discussions that led to these enhancements can be found here: #5692.Other enhancements are a result of our consumer's feedback on the usage of this component:
This is the Figma file where you can find all the research and design ideas:
https://www.figma.com/file/OlPQKfamN8WzA7jT7dI16z/CommentList?node-id=0%3A1
Converted to
Emotion
The
EuiCommentList
andEuiComment
were updated to useEuiTimeline
andEuiTimelineItem
respectively. So this reduces a lot of the custom styles. At the end, there was only one component that required custom styles and it was converted to emotion:comment_event.styles.ts
Custom children
Now consumers can add custom components without the
username
and a panel appearing.New props
New props
eventIcon
,eventIconAriaLabel
, andeventColor
:.
Also, a new
gutterSize
prop which is inherited fromEuiTimeline
was added.Timeline icon
The
timelineIcon
is now only for avatars. To display an icon for an update/event consumers should be using the neweventIcon
prop.If no
timelineIcon
is provided, it will default to theusername's
initials. Before this update, thetimelineIcon
was defaulting to auser
avatar. Using avatars withusername's
initials makes more sense for a comment list because it makes it easier to distinguish different users by initials/colors.EuiComment.actions now accepts
ReactNode[]
Updated
EuiComment.actions
type to acceptReactNode[]
New docs examples
Two new section were added to the docs:
Breaking changes
EuiCommentEvent.username
type fromReactNode
tostring
The reason for that is that now the timeline icon defaults to an avatar with an initial username letter. So we need to make sure the username is a string to pass to theEuiAvatar.name
.EuiCommentList
andEuiComment
to useEuiTimeline
andEuiTimelineItem
respectively. This change makes theEuiCommentList
to be always required. It also improves the a11y by using better semantic elements (ol > li)EuiComment.type
. It is no longer required to say what is thetype
of comment. The comment is now flexible enough and adapts to the props passed.Checklist
Checked Code Sandbox works for any docs examplesChecked for accessibility including keyboard-only and screenreader modes