summaryrefslogtreecommitdiffstats
path: root/src/components/molecules/forms/motion-toggle.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-04-08 22:36:24 +0200
committerArmand Philippot <git@armandphilippot.com>2022-04-08 23:31:58 +0200
commit0b3146f7278929c4d1b33dd8f94f34e351e5e5a9 (patch)
tree6a784b197a283a7da07c2e1df80a29fee8b3790a /src/components/molecules/forms/motion-toggle.tsx
parent61278678ea8a8febee0574cd0f6006492d7b15cb (diff)
chore: add a Settings modal component
Diffstat (limited to 'src/components/molecules/forms/motion-toggle.tsx')
-rw-r--r--src/components/molecules/forms/motion-toggle.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/components/molecules/forms/motion-toggle.tsx b/src/components/molecules/forms/motion-toggle.tsx
index 77291ed..d4f7d11 100644
--- a/src/components/molecules/forms/motion-toggle.tsx
+++ b/src/components/molecules/forms/motion-toggle.tsx
@@ -2,17 +2,17 @@ import Toggle, {
ToggleChoices,
ToggleProps,
} from '@components/atoms/forms/toggle';
-import { FC, useState } from 'react';
+import { useState, VFC } from 'react';
import { useIntl } from 'react-intl';
-export type MotionToggleProps = Pick<ToggleProps, 'value'>;
+export type MotionToggleProps = Pick<ToggleProps, 'labelClassName' | 'value'>;
/**
* MotionToggle component
*
* Render a Toggle component to set reduce motion.
*/
-const MotionToggle: FC<MotionToggleProps> = ({ value }) => {
+const MotionToggle: VFC<MotionToggleProps> = ({ value, ...props }) => {
const intl = useIntl();
const [isDeactivated, setIsDeactivated] = useState<boolean>(value);
const reduceMotionLabel = intl.formatMessage({
@@ -40,9 +40,11 @@ const MotionToggle: FC<MotionToggleProps> = ({ value }) => {
id="reduce-motion-settings"
name="reduce-motion-settings"
label={reduceMotionLabel}
+ labelSize="medium"
choices={reduceMotionChoices}
value={isDeactivated}
setValue={setIsDeactivated}
+ {...props}
/>
);
};