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.tsx | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

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

diff --git a/src/components/organisms/toolbar/settings.tsx b/src/components/organisms/toolbar/settings.tsx
index 124dd42..1b68db8 100644
--- a/src/components/organisms/toolbar/settings.tsx
+++ b/src/components/organisms/toolbar/settings.tsx
@@ -19,10 +19,7 @@ export type SettingsProps = SettingsModalProps & {
 const SettingsWithRef: ForwardRefRenderFunction<
   HTMLDivElement,
   SettingsProps
-> = (
-  { className = '', isActive = false, motionStorageKey, setIsActive },
-  ref
-) => {
+> = ({ className = '', isActive = false, setIsActive }, ref) => {
   const intl = useIntl();
   const label = isActive
     ? intl.formatMessage({
@@ -54,10 +51,7 @@ const SettingsWithRef: ForwardRefRenderFunction<
         isActive={isActive}
         label={label}
       />
-      <SettingsModal
-        className={`${styles.modal} ${className}`}
-        motionStorageKey={motionStorageKey}
-      />
+      <SettingsModal className={`${styles.modal} ${className}`} />
     </div>
   );
 };
-- 
cgit v1.2.3

