-
Notifications
You must be signed in to change notification settings - Fork 6
refactor: isolate expand button logic into component #2303
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
| </IconButton> | ||
| <ExpandMore | ||
| expand={expanded} | ||
| onClick={handleExpandClick} |
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.
Expansion logic moved into handler function rather than modifying state directly.
| [`& .${classes.expandOpen}`]: { | ||
| transform: 'rotate(180deg)', | ||
| transition: 'transform 0.1s linear', | ||
| marginLeft: 'auto' |
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 styled component logic which was being used to replicate the animated behavior of the icon.
web-ui/src/components/feedback_request_card/FeedbackRequestCard.jsx
Outdated
Show resolved
Hide resolved
5ca1266 to
4357538
Compare
7c4dc96 to
fa14fa5
Compare
S78901
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 good!
jackkeller
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.
![]()
In support of #2212, which requires "expandable section with a summary" I found an opportunity to DRY up our codebase. This pull removes custom styling used in multiple places to produce an
ExpandMorebutton which abstracts away the animation logic, refactors current usage in the codebase and leverages Testing Library to perform snapshot-free tests on the component, to validate its core logic and capabilities.Screen.Recording.2024-04-30.at.1.44.08.PM.mov