-
Notifications
You must be signed in to change notification settings - Fork 345
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
RadioGroupButton: VR motion implementation #3797
Conversation
✅ Deploy Preview for gestalt ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
9ab0c5b
to
f55ebd5
Compare
@@ -186,7 +186,7 @@ const ButtonToggleWithForwardRef = forwardRef<HTMLButtonElement, Props>(function | |||
const isDarkModeRed = isDarkMode && color === 'red'; | |||
const { isFocusVisible } = useFocusVisible(); | |||
|
|||
const buttonToggleAnimation = useButtonToggleAnimation(); | |||
const buttonToggleAnimation = useTapScaleAnimation(); |
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.
is this expected?
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.
just renaming i guess
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, i renamed it cuz now they is shared
const styleSize = size === 'sm' ? controlStyles.sizeSm : controlStyles.sizeMd; | ||
|
||
const bgStyle = disabled && !checked ? styles.BgDisabled : styles.BgEnabled; | ||
|
||
const { isFocusVisible } = useFocusVisible(); | ||
|
||
const { parentName } = useRadioGroupContext(); | ||
|
||
const tapScaleAnimation = useTapScaleAnimation(); |
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.
nit
const { handleMouseDown, handleMouseUp, elementRef } = useTapScaleAnimation();
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 didn't destructure the object to keeps its context "visible" while reading the code. We may have other even handler functions in the future. But this one is just for the animation. That's why i think its better to keep it this way.
i assume we don't need to listen to useReducedMotion here... can you confirm that? |
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.
Few nits, but overall LGTM
I think so. There were no relevant specs. |
Summary
VR RadioGroupButton motion implementation WITHOUT other VR specific styles.
What changed?
BEFORE
AFTER
Links
Checklist