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/molecules/forms/switch/switch.tsx | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

(limited to 'src/components/molecules/forms/switch/switch.tsx')

diff --git a/src/components/molecules/forms/switch/switch.tsx b/src/components/molecules/forms/switch/switch.tsx
index df2ba0c..ad3e514 100644
--- a/src/components/molecules/forms/switch/switch.tsx
+++ b/src/components/molecules/forms/switch/switch.tsx
@@ -55,9 +55,7 @@ const SwitchItem: FC<SwitchItemProps> = ({
   value,
   ...props
 }) => {
-  const selectedItemClass = isSelected ? styles['item--selected'] : '';
-  const disabledItemClass = isDisabled ? styles['item--disabled'] : '';
-  const itemClass = `${styles.item} ${selectedItemClass} ${disabledItemClass} ${className}`;
+  const itemClass = `${styles.item} ${className}`;
 
   return (
     <Label {...props} className={itemClass} htmlFor={id}>
-- 
cgit v1.2.3

