-
Notifications
You must be signed in to change notification settings - Fork 377
chore(DataList): convert examples to TypeScript #7154
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
Conversation
|
Preview: https://patternfly-react-pr-7154.surge.sh A11y report: https://patternfly-react-pr-7154-a11y.surge.sh |
thatblindgeye
left a comment
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.
Only a few comments below, a couple of requested changes and one nitpick. Also the comment I left on the DatePicker conversion PR applies here, so depending on your response to that (regarding the export names from each example) that may apply here, too.
| if (allExpanded) { | ||
| setExpanded(['ex-toggle1', 'ex-toggle2', 'ex-toggle3']); | ||
| } else { | ||
| setExpanded([]); | ||
| } |
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 if...else block would work better in a useEffect I believe. Currently the arrow icon for the expand/collapse all toggle doesn't really match the actual allExpanded state; if all items are expanded the expand/collapse all toggle has a right arrow when it should have a down arrow, for example.
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.
Nice catch! Great idea.
| return ( | ||
| <> | ||
| <div key="example-1"> | ||
| <h2>Default fitting - example 1</h2> |
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 think it'd be worth updating this (and the other sub-examples in this section) to an <h4> element
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! Definitely looks better - thanks!
| Array.from({ length: count }, (v, k) => k).map(k => ({ | ||
| id: `item-${k}`, | ||
| content: `item ${k} `.repeat(k === 4 ? 20 : 1) |
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.
Nitpick: may be something worth fixing in another issue, but I think it'd be worth giving these v and k params more meaningful names
thatblindgeye
left a comment
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.
Updates look great!
nicolethoen
left a comment
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.
Looks great!
Could you rebase your PR? I think there is a new Data List example that we should be sure we don't leave out of the typescript conversions :)
tlabaj
left a comment
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.
You are just missing one file in your MD file. Looks good otherwise.
tlabaj
left a comment
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.
LGTM
|
Your changes have been released in:
Thanks for your contribution! 🎉 |
What: Closes #7139
Additional issues: