Skip to content

Commit

Permalink
fix(): always show the comment box in follow up form
Browse files Browse the repository at this point in the history
  • Loading branch information
elektracodes committed May 16, 2023
1 parent c74ef9e commit d944588
Showing 1 changed file with 20 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const FollowUps: FC<{
form: {
mutators: { push: addField },
},
values,
}) => {
return (
<form
Expand Down Expand Up @@ -382,31 +381,26 @@ const FollowUps: FC<{
}}
</Field>
</FieldWrapper>
{values?.further_surgery_need?.value === 0 && (
<FieldWrapper>
<label>Comments</label>
<Field
name="surgery_comments_box"
initialValue={followUp?.surgery_comments_box}
>
{(props) => {
const hasError =
props.meta.touched && props.meta.invalid && !props.meta.active;
return (
<TextArea
id="surgery_comments_box"
required={canSubmit}
styleType="outlined"
status={hasError ? 'error' : 'hint'}
hintMsg={hasError ? props.meta.error : undefined}
disabled={!canSubmit}
{...props.input}
/>
);
}}
</Field>
</FieldWrapper>
)}
<FieldWrapper>
<label>Comments</label>
<Field name="surgery_comments_box" initialValue={followUp?.surgery_comments_box}>
{(props) => {
const hasError =
props.meta.touched && props.meta.invalid && !props.meta.active;
return (
<TextArea
id="surgery_comments_box"
required={canSubmit}
styleType="outlined"
status={hasError ? 'error' : 'hint'}
hintMsg={hasError ? props.meta.error : undefined}
disabled={!canSubmit}
{...props.input}
/>
);
}}
</Field>
</FieldWrapper>
<Button
color={'blue-200'}
buttonType="button"
Expand Down

0 comments on commit d944588

Please sign in to comment.