Skip to content

Commit

Permalink
Merge pull request #497 from Lemoncode/fixaccessibilitybug/#486-9-li-…
Browse files Browse the repository at this point in the history
…Aria-label-issue

#486 9 li aria label issue
  • Loading branch information
brauliodiez authored May 23, 2024
2 parents 0cc30d2 + a1a459e commit ef3fe87
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@ interface Props {
}

export const Field: React.FC<Props> = props => {
const { field, listName } = props;
const { field } = props;

const renderNNElement = (NN?: boolean) => {
if (NN) return <span>NN</span>;
if (NN) return <span>Not Null</span>;
};
const renderArrayElement = (isArray?: boolean) => {
if (isArray)
return (
<>
<span>array</span>&nbsp;
</>
);
};

const renderChildrenElement = (name: string, children?: FieldVm[]) => {
Expand All @@ -20,9 +28,10 @@ export const Field: React.FC<Props> = props => {
};

return (
<li aria-label={`${listName} field`}>
<span>{field.name}</span>
<span>{field.type}</span>
<li>
<span>{field.name}</span>&nbsp;
<span>{field.type}</span>&nbsp;
{renderArrayElement(field.isArray)}
{renderNNElement(field.isNN)}
{renderChildrenElement(field.name, field.children)}
</li>
Expand Down

0 comments on commit ef3fe87

Please sign in to comment.