From 5d3e8a4d0c2ce2ad8f22df857ab3ce54fcfc38ac Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 3 Nov 2023 12:22:47 +0100 Subject: refactor(components): replace Toolbar with Navbar component * remove SearchModal and SettingsModal components * add a generic NavbarItem component (instead of the previous toolbar items to avoid unreadable styles...) * move FlippingLabel component logic into NavbarItem since it is only used here --- src/components/organisms/toolbar/settings.tsx | 62 --------------------------- 1 file changed, 62 deletions(-) delete mode 100644 src/components/organisms/toolbar/settings.tsx (limited to 'src/components/organisms/toolbar/settings.tsx') diff --git a/src/components/organisms/toolbar/settings.tsx b/src/components/organisms/toolbar/settings.tsx deleted file mode 100644 index a0aad8c..0000000 --- a/src/components/organisms/toolbar/settings.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import { forwardRef, type ForwardRefRenderFunction } from 'react'; -import { useIntl } from 'react-intl'; -import { BooleanField, type BooleanFieldProps, Icon } from '../../atoms'; -import { FlippingLabel } from '../../molecules'; -import { SettingsModal, type SettingsModalProps } from '../modals'; -import styles from './settings.module.scss'; -import sharedStyles from './toolbar-items.module.scss'; - -export type SettingsProps = SettingsModalProps & { - /** - * The button state. - */ - isActive: BooleanFieldProps['isChecked']; - /** - * A callback function to handle button state. - */ - setIsActive: BooleanFieldProps['onChange']; -}; - -const SettingsWithRef: ForwardRefRenderFunction< - HTMLDivElement, - SettingsProps -> = ({ className = '', isActive = false, setIsActive }, ref) => { - const intl = useIntl(); - const label = isActive - ? intl.formatMessage({ - defaultMessage: 'Close settings', - id: '+viX9b', - description: 'Settings: Close label', - }) - : intl.formatMessage({ - defaultMessage: 'Open settings', - id: 'QCW3cy', - description: 'Settings: Open label', - }); - - return ( -
- - } - isActive={isActive} - label={label} - /> - -
- ); -}; - -export const Settings = forwardRef(SettingsWithRef); -- cgit v1.2.3