From 584bd42f871d2e1618ca414749f09c38f0143a44 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 18 May 2022 22:40:59 +0200 Subject: chore: handle settings change --- src/components/organisms/forms/settings-form.tsx | 32 +++++++++++++++++++----- 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'src/components/organisms/forms/settings-form.tsx') diff --git a/src/components/organisms/forms/settings-form.tsx b/src/components/organisms/forms/settings-form.tsx index 0a34601..c897fa5 100644 --- a/src/components/organisms/forms/settings-form.tsx +++ b/src/components/organisms/forms/settings-form.tsx @@ -2,16 +2,31 @@ import Form from '@components/atoms/forms/form'; import AckeeSelect, { type AckeeSelectProps, } from '@components/molecules/forms/ackee-select'; -import MotionToggle from '@components/molecules/forms/motion-toggle'; +import MotionToggle, { + MotionToggleProps, +} from '@components/molecules/forms/motion-toggle'; import PrismThemeToggle from '@components/molecules/forms/prism-theme-toggle'; import ThemeToggle from '@components/molecules/forms/theme-toggle'; import { FC } from 'react'; import { useIntl } from 'react-intl'; import styles from './settings-form.module.scss'; -export type SettingsFormProps = Pick; +export type SettingsFormProps = Pick & { + /** + * The local storage key for Ackee settings. + */ + ackeeStorageKey: AckeeSelectProps['storageKey']; + /** + * The local storage key for Reduce motion settings. + */ + motionStorageKey: MotionToggleProps['storageKey']; +}; -const SettingsForm: FC = ({ tooltipClassName }) => { +const SettingsForm: FC = ({ + ackeeStorageKey, + motionStorageKey, + tooltipClassName, +}) => { const intl = useIntl(); const ariaLabel = intl.formatMessage({ defaultMessage: 'Settings form', @@ -21,13 +36,18 @@ const SettingsForm: FC = ({ tooltipClassName }) => { return (
null}> - - - + + + ); -- cgit v1.2.3