From 235fe67d770f83131c9ec10b99012319440db690 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sun, 15 May 2022 16:36:58 +0200 Subject: chore: add Search page --- src/components/organisms/modals/search-modal.stories.tsx | 11 +++-------- src/components/organisms/modals/search-modal.test.tsx | 2 +- src/components/organisms/modals/search-modal.tsx | 8 ++++---- 3 files changed, 8 insertions(+), 13 deletions(-) (limited to 'src/components/organisms/modals') 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) => ( - - - - ), - ], } as ComponentMeta; const Template: ComponentStory = (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(); + render(); 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 & { /** * Set additional classnames to modal wrapper. */ @@ -16,7 +16,7 @@ export type SearchModalProps = { * * Render a search form modal. */ -const SearchModal: FC = ({ className }) => { +const SearchModal: FC = ({ className, searchPage }) => { const intl = useIntl(); const modalTitle = intl.formatMessage({ defaultMessage: 'Search', @@ -26,7 +26,7 @@ const SearchModal: FC = ({ className }) => { return ( - + ); }; -- cgit v1.2.3