summaryrefslogtreecommitdiffstats
path: root/src/components/organisms/modals
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/organisms/modals')
-rw-r--r--src/components/organisms/modals/search-modal.stories.tsx11
-rw-r--r--src/components/organisms/modals/search-modal.test.tsx2
-rw-r--r--src/components/organisms/modals/search-modal.tsx8
3 files changed, 8 insertions, 13 deletions
diff --git a/src/components/organisms/modals/search-modal.stories.tsx b/src/components/organisms/modals/search-modal.stories.tsx
index 3ad6abd..f40696c 100644
--- a/src/components/organisms/modals/search-modal.stories.tsx
+++ b/src/components/organisms/modals/search-modal.stories.tsx
@@ -1,5 +1,4 @@
import { ComponentMeta, ComponentStory } from '@storybook/react';
-import { IntlProvider } from 'react-intl';
import SearchModal from './search-modal';
/**
@@ -8,6 +7,9 @@ import SearchModal from './search-modal';
export default {
title: 'Organisms/Modals',
component: SearchModal,
+ args: {
+ searchPage: '#',
+ },
argTypes: {
className: {
control: {
@@ -23,13 +25,6 @@ export default {
},
},
},
- decorators: [
- (Story) => (
- <IntlProvider locale="en">
- <Story />
- </IntlProvider>
- ),
- ],
} as ComponentMeta<typeof SearchModal>;
const Template: ComponentStory<typeof SearchModal> = (args) => (
diff --git a/src/components/organisms/modals/search-modal.test.tsx b/src/components/organisms/modals/search-modal.test.tsx
index 249c523..7ba08c0 100644
--- a/src/components/organisms/modals/search-modal.test.tsx
+++ b/src/components/organisms/modals/search-modal.test.tsx
@@ -3,7 +3,7 @@ import SearchModal from './search-modal';
describe('SearchModal', () => {
it('renders a search modal', () => {
- render(<SearchModal />);
+ render(<SearchModal searchPage="#" />);
expect(screen.getByText('Search')).toBeInTheDocument();
});
});
diff --git a/src/components/organisms/modals/search-modal.tsx b/src/components/organisms/modals/search-modal.tsx
index 0e0ceed..866bc25 100644
--- a/src/components/organisms/modals/search-modal.tsx
+++ b/src/components/organisms/modals/search-modal.tsx
@@ -1,10 +1,10 @@
import Modal, { type ModalProps } from '@components/molecules/modals/modal';
import { FC } from 'react';
import { useIntl } from 'react-intl';
-import SearchForm from '../forms/search-form';
+import SearchForm, { SearchFormProps } from '../forms/search-form';
import styles from './search-modal.module.scss';
-export type SearchModalProps = {
+export type SearchModalProps = Pick<SearchFormProps, 'searchPage'> & {
/**
* Set additional classnames to modal wrapper.
*/
@@ -16,7 +16,7 @@ export type SearchModalProps = {
*
* Render a search form modal.
*/
-const SearchModal: FC<SearchModalProps> = ({ className }) => {
+const SearchModal: FC<SearchModalProps> = ({ className, searchPage }) => {
const intl = useIntl();
const modalTitle = intl.formatMessage({
defaultMessage: 'Search',
@@ -26,7 +26,7 @@ const SearchModal: FC<SearchModalProps> = ({ className }) => {
return (
<Modal title={modalTitle} className={`${styles.wrapper} ${className}`}>
- <SearchForm hideLabel={true} />
+ <SearchForm hideLabel={true} searchPage={searchPage} />
</Modal>
);
};