From f861e6a269ba9f62700776d3cd13b644a9e836d4 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 20 Sep 2023 16:38:54 +0200 Subject: refactor: use named export for everything except pages Next expect a default export for pages so only those components should use default exports. Everything else should use named exports to reduce the number of import statements. --- src/components/organisms/modals/search-modal.tsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/components/organisms/modals/search-modal.tsx') diff --git a/src/components/organisms/modals/search-modal.tsx b/src/components/organisms/modals/search-modal.tsx index 08b28cb..7ba770f 100644 --- a/src/components/organisms/modals/search-modal.tsx +++ b/src/components/organisms/modals/search-modal.tsx @@ -1,7 +1,7 @@ import { forwardRef, ForwardRefRenderFunction } from 'react'; import { useIntl } from 'react-intl'; -import Modal, { type ModalProps } from '../../molecules/modals/modal'; -import SearchForm, { type SearchFormProps } from '../forms/search-form'; +import { Modal, type ModalProps } from '../../molecules'; +import { SearchForm, type SearchFormProps } from '../forms'; import styles from './search-modal.module.scss'; export type SearchModalProps = SearchFormProps & { @@ -11,12 +11,7 @@ export type SearchModalProps = SearchFormProps & { className?: ModalProps['className']; }; -/** - * SearchModal - * - * Render a search form modal. - */ -const SearchModal: ForwardRefRenderFunction< +const SearchModalWithRef: ForwardRefRenderFunction< HTMLInputElement, SearchModalProps > = ({ className, searchPage }, ref) => { @@ -28,10 +23,15 @@ const SearchModal: ForwardRefRenderFunction< }); return ( - + ); }; -export default forwardRef(SearchModal); +/** + * SearchModal + * + * Render a search form modal. + */ +export const SearchModal = forwardRef(SearchModalWithRef); -- cgit v1.2.3