From 757201fdc5c04a3f15504f74bf8ab85bb6018c2b Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 27 Oct 2023 11:09:38 +0200
Subject: refactor(hooks,provider): move reduce motion setter

Since the local storage key is not meant to change between the
components, it should be set directly inside the app file. So
both the local storage and the data attribute should be handle
in a provider.
I also added a custom document because we need a script to
retrieve the stored value in local storage earlier to avoid
flashing on hydration.
---
 src/components/organisms/toolbar/settings.test.tsx | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

(limited to 'src/components/organisms/toolbar/settings.test.tsx')

diff --git a/src/components/organisms/toolbar/settings.test.tsx b/src/components/organisms/toolbar/settings.test.tsx
index 66fa6a6..6dbed2b 100644
--- a/src/components/organisms/toolbar/settings.test.tsx
+++ b/src/components/organisms/toolbar/settings.test.tsx
@@ -8,26 +8,14 @@ const doNothing = () => {
 
 describe('Settings', () => {
   it('renders a button to open settings modal', () => {
-    render(
-      <Settings
-        motionStorageKey="reduced-motion"
-        isActive={false}
-        setIsActive={doNothing}
-      />
-    );
+    render(<Settings isActive={false} setIsActive={doNothing} />);
     expect(
       rtlScreen.getByRole('checkbox', { name: 'Open settings' })
     ).toBeInTheDocument();
   });
 
   it('renders a button to close settings modal', () => {
-    render(
-      <Settings
-        motionStorageKey="reduced-motion"
-        isActive={true}
-        setIsActive={doNothing}
-      />
-    );
+    render(<Settings isActive={true} setIsActive={doNothing} />);
     expect(
       rtlScreen.getByRole('checkbox', { name: 'Close settings' })
     ).toBeInTheDocument();
-- 
cgit v1.2.3

