Skip to content

Commit

Permalink
fix: filter undefined from options
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed May 17, 2021
1 parent 17dcff0 commit 4724fc3
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions ui/blocks/src/PropsTable/BasePropsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,19 @@ export const BasePropsTable: FC<BasePropsTableProps> = ({
<Box variant="propstable.description.type">
<Themed.pre>
{Array.isArray(value) && value.length > 1
? value.map(({ name: typeName, value }) => (
<Tag
key={`${name}_${value || typeName}`}
color="grey"
transparentAmount={0.9}
borderSize={1}
variant="tag.rightmargin"
>
{value || typeName}
</Tag>
))
? value
.filter(({ value }) => value !== 'undefined')
.map(({ name: typeName, value }) => (
<Tag
key={`${name}_${value || typeName}`}
color="grey"
transparentAmount={0.9}
borderSize={1}
variant="tag.rightmargin"
>
{value || typeName}
</Tag>
))
: raw ?? typeName}
</Themed.pre>
</Box>
Expand Down

0 comments on commit 4724fc3

Please sign in to comment.