aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/modals/settings-modal.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-09-28 18:03:43 +0200
committerArmand Philippot <git@armandphilippot.com>2023-10-24 12:25:00 +0200
commit837e0e904c40f7b87561c34ca3f49edd5d8d1c52 (patch)
tree37835dd2c84ed770b5719152aab0b74d93c0878c /src/components/organisms/modals/settings-modal.tsx
parentd17d894f398650209c0ddd29502308de8c07bd93 (diff)
feat(components): replace icons with a generic Icon component
Sizes are also predefined and can be set using the `size` prop, so the consumers should no longer adjust the size in CSS.
Diffstat (limited to 'src/components/organisms/modals/settings-modal.tsx')
-rw-r--r--src/components/organisms/modals/settings-modal.tsx14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/components/organisms/modals/settings-modal.tsx b/src/components/organisms/modals/settings-modal.tsx
index bb3d886..5a53bbd 100644
--- a/src/components/organisms/modals/settings-modal.tsx
+++ b/src/components/organisms/modals/settings-modal.tsx
@@ -1,6 +1,6 @@
-import { FC } from 'react';
+import { useCallback, type FC, type FormEvent } from 'react';
import { useIntl } from 'react-intl';
-import { Cog, Form, Heading, Modal, type ModalProps } from '../../atoms';
+import { Form, Heading, Icon, Modal, type ModalProps } from '../../atoms';
import {
AckeeToggle,
type AckeeToggleProps,
@@ -8,7 +8,7 @@ import {
type MotionToggleProps,
PrismThemeToggle,
ThemeToggle,
-} from '../../organisms';
+} from '../forms';
import styles from './settings-modal.module.scss';
export type SettingsModalProps = Pick<ModalProps, 'className'> & {
@@ -44,12 +44,16 @@ export const SettingsModal: FC<SettingsModalProps> = ({
description: 'SettingsModal: an accessible form name',
});
+ const submitHandler = useCallback((e: FormEvent) => {
+ e.preventDefault();
+ }, []);
+
return (
<Modal
className={`${styles.wrapper} ${className}`}
heading={
<Heading isFake level={3}>
- <Cog className={styles.icon} />
+ <Icon className={styles.icon} shape="cog" />
{title}
</Heading>
}
@@ -57,7 +61,7 @@ export const SettingsModal: FC<SettingsModalProps> = ({
<Form
aria-label={ariaLabel}
className={styles.form}
- onSubmit={() => null}
+ onSubmit={submitHandler}
>
<ThemeToggle className={styles.item} />
<PrismThemeToggle className={styles.item} />