Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/EyeSeeTea/amr-surveys
Browse files Browse the repository at this point in the history
…into fix/remove-treatment-and-indication-action
  • Loading branch information
deeonwuli committed Dec 20, 2024
2 parents eb219f9 + 0a24903 commit a2b532e
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions src/webapp/components/survey/SurveyForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,25 +116,7 @@ export const SurveyForm: React.FC<SurveyFormProps> = props => {
return (
<PaddedDiv key={stage.id}>
<Typography>{i18n.t(`Stage - ${stage.title}`)}</Typography>
{stage.repeatable && (
<RightAlignedDiv>
<Button
variant="contained"
color="primary"
onClick={() => addProgramStage(stage.code)}
>
{i18n.t(`Add Another ${stage.title}`)}
</Button>
{stage.isAddedByUser && (
<CancelButton
variant="outlined"
onClick={() => removeProgramStage(stage.id)}
>
{i18n.t(`Remove ${stage.title}`)}
</CancelButton>
)}
</RightAlignedDiv>
)}

{stage.sections.map(section => {
if (!section.isVisible || section.isAntibioticSection) return null;

Expand Down Expand Up @@ -172,6 +154,26 @@ export const SurveyForm: React.FC<SurveyFormProps> = props => {
/>
);
})}

{stage.repeatable && (
<RightAlignedDiv>
<Button
variant="contained"
color="primary"
onClick={() => addProgramStage(stage.code)}
>
{i18n.t(`Add Another ${stage.title}`)}
</Button>
{stage.isAddedByUser && (
<CancelButton
variant="outlined"
onClick={() => removeProgramStage(stage.id)}
>
{i18n.t(`Remove ${stage.title}`)}
</CancelButton>
)}
</RightAlignedDiv>
)}
</PaddedDiv>
);
})}
Expand Down

0 comments on commit a2b532e

Please sign in to comment.