Skip to content

Commit

Permalink
fix: required fields label
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Mar 15, 2021
1 parent 9dc8545 commit 05da825
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/components/Field.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ const Field = ({
}) => {
const intl = useIntl();

const getLabel = () => {
return required ? label + ' *' : label;
};

const isInvalid = () => {
return !isOnEdit && !valid;
};
Expand All @@ -51,7 +47,7 @@ const Field = ({
<TextWidget
id={name}
name={name}
title={getLabel()}
title={label}
description={description}
required={required}
onChange={onChange}
Expand All @@ -64,7 +60,7 @@ const Field = ({
<TextareaWidget
id={name}
name={name}
title={getLabel()}
title={label}
description={description}
required={required}
onChange={onChange}
Expand All @@ -78,7 +74,7 @@ const Field = ({
<SelectWidget
id={name}
name={name}
title={getLabel()}
title={label}
description={description}
getVocabulary={() => {}}
getVocabularyTokenTitle={() => {}}
Expand All @@ -95,7 +91,7 @@ const Field = ({
{field_type === 'radio' && (
<RadioWidget
id={name}
title={getLabel()}
title={label}
description={description}
required={required}
onChange={onChange}
Expand All @@ -111,7 +107,7 @@ const Field = ({
<CheckboxWidget
id={name}
name={name}
title={getLabel()}
title={label}
description={description}
required={required}
onChange={onChange}
Expand All @@ -124,7 +120,7 @@ const Field = ({
<DatetimeWidget
id={name}
name={name}
title={getLabel()}
title={label}
description={description}
dateOnly={true}
noPastDates={false}
Expand All @@ -139,7 +135,7 @@ const Field = ({
<FileWidget
id={name}
name={name}
title={getLabel()}
title={label}
description={description}
type="file"
required={required}
Expand All @@ -153,7 +149,7 @@ const Field = ({
<EmailWidget
id={name}
name={name}
title={getLabel()}
title={label}
description={description}
required={required}
onChange={onChange}
Expand Down

0 comments on commit 05da825

Please sign in to comment.