-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EmployeeWebClient - CreateFacilityMultiStepForm - add summary step
- Loading branch information
Showing
5 changed files
with
86 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...les/facility/presentation/CreateFacilityMultiStepForm/SummaryStep/SummaryStep.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
import { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
|
||
import { FacilityFixture } from 'utils'; | ||
|
||
import { SummaryStep as SummaryStepComponent } from './index'; | ||
import { useFacilityFormStore } from '../createFacilityFormStore'; | ||
import { CreateFacilityMapper } from '../../../application'; | ||
|
||
export default { | ||
title: 'modules/facility/AddFacilityForm/SummaryStep', | ||
component: SummaryStepComponent, | ||
decorators: [ | ||
Story => { | ||
useFacilityFormStore.setState({ data: CreateFacilityMapper.modelToForm(FacilityFixture.toStructure()) }); | ||
|
||
return <Story />; | ||
}, | ||
], | ||
} as ComponentMeta<typeof SummaryStepComponent>; | ||
|
||
const Template: ComponentStory<typeof SummaryStepComponent> = () => { | ||
return <SummaryStepComponent />; | ||
}; | ||
|
||
export const SummaryStep = Template.bind({}); |
30 changes: 30 additions & 0 deletions
30
...lient/src/modules/facility/presentation/CreateFacilityMultiStepForm/SummaryStep/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import { useIntl } from 'react-intl'; | ||
|
||
import { ListItem } from 'shared/DescriptionListV2'; | ||
|
||
import { useFacilityFormStore } from '../createFacilityFormStore'; | ||
import { CreateFacilityFormDto } from '../../../application/types'; | ||
import { CreateFacilityMapper } from '../../../application'; | ||
import { FacilityBody } from '../../FacilityBody'; | ||
import { FormStepHeader } from '../FormStepHeader'; | ||
|
||
const SummaryStep = () => { | ||
const { formatMessage } = useIntl(); | ||
const data = useFacilityFormStore(store => store.data); | ||
|
||
return ( | ||
<FacilityBody facility={CreateFacilityMapper.formToModel(data as CreateFacilityFormDto)}> | ||
<ListItem> | ||
<FormStepHeader> | ||
{formatMessage({ | ||
id: 'summary-facility-step-three', | ||
defaultMessage: 'Step 4: Summary', | ||
})} | ||
</FormStepHeader> | ||
</ListItem> | ||
</FacilityBody> | ||
); | ||
}; | ||
|
||
export { SummaryStep }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters