summaryrefslogtreecommitdiffstats
path: root/src/components/organisms/modals/search-modal.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-05-18 14:27:11 +0200
committerArmand Philippot <git@armandphilippot.com>2022-05-18 14:27:11 +0200
commitb214baab3e17d92f784b4f782863deafc5558ee4 (patch)
treecdc20c7e77ba6926285917eead8bb088bdc843f8 /src/components/organisms/modals/search-modal.tsx
parent54883bb5c36cf21462a421605a709fdd6f04b150 (diff)
chore: close toolbar modals on click/focus outside
Diffstat (limited to 'src/components/organisms/modals/search-modal.tsx')
-rw-r--r--src/components/organisms/modals/search-modal.tsx13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/components/organisms/modals/search-modal.tsx b/src/components/organisms/modals/search-modal.tsx
index 866bc25..e92bf1b 100644
--- a/src/components/organisms/modals/search-modal.tsx
+++ b/src/components/organisms/modals/search-modal.tsx
@@ -1,9 +1,18 @@
+import Spinner from '@components/atoms/loaders/spinner';
import Modal, { type ModalProps } from '@components/molecules/modals/modal';
+import dynamic from 'next/dynamic';
import { FC } from 'react';
import { useIntl } from 'react-intl';
-import SearchForm, { SearchFormProps } from '../forms/search-form';
+import { type SearchFormProps } from '../forms/search-form';
import styles from './search-modal.module.scss';
+const DynamicSearchForm = dynamic(
+ () => import('@components/organisms/forms/search-form'),
+ {
+ loading: () => <Spinner />,
+ }
+);
+
export type SearchModalProps = Pick<SearchFormProps, 'searchPage'> & {
/**
* Set additional classnames to modal wrapper.
@@ -26,7 +35,7 @@ const SearchModal: FC<SearchModalProps> = ({ className, searchPage }) => {
return (
<Modal title={modalTitle} className={`${styles.wrapper} ${className}`}>
- <SearchForm hideLabel={true} searchPage={searchPage} />
+ <DynamicSearchForm hideLabel={true} searchPage={searchPage} />
</Modal>
);
};