Skip to content
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

Add ReducedMotionConfig component #6164

Merged
merged 16 commits into from
Jul 15, 2024
Merged

Conversation

piaskowyk
Copy link
Member

Summary

This PR adds ReduceMotionConfig component that allows to determine the default animation behavior in response to the device's reduced motion accessibility setting. It affects application globally. The default behavior disables all animation if reduced motion is enabled on a device. You can utilize this component to override that behavior.

Usage

function App() {
  
  return (
    // ...
    <ReduceMotionConfig mode={ReduceMotion.Never} />
    // ...
  );
}

Demo

Screen.Recording.2024-06-24.at.18.25.37.mov

Test plan

Open Reduce Motion example from example app.

Copy link
Contributor

@szydlovsky szydlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of overriding it this simply!

Copy link
Contributor

@szydlovsky szydlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it lacks some logic

@szydlovsky szydlovsky self-requested a review June 27, 2024 15:00
Copy link
Contributor

@szydlovsky szydlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it's fine 👍

@szydlovsky szydlovsky self-requested a review June 27, 2024 16:08
Copy link
Contributor

@szydlovsky szydlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the refactor - just please tak a look at linter

Copy link
Member

@kacperkapusciak kacperkapusciak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@piaskowyk piaskowyk changed the title Add ReduceMotionConfig component Add ReducedMotionConfig component Jul 15, 2024
@piaskowyk piaskowyk added this pull request to the merge queue Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants