Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Commit

Permalink
feat(docz): render [Empty String] on PropsTable (#427)
Browse files Browse the repository at this point in the history
* Updates the PropsTable to render '[Empty String]' instead of nothing.
* Add the code to print [No Default]
  • Loading branch information
Jared-Dev authored and pedronauck committed Oct 27, 2018
1 parent 8b4c09c commit 4669e34
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions packages/docz/src/components/PropsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,20 @@ const BasePropsTable: SFC<PropsTable> = ({ of: component, components }) => {
<Td>{name}</Td>
<Td>{getPropType(prop, Tooltip)}</Td>
<Td>{String(prop.required)}</Td>
<Td>
{prop.defaultValue &&
prop.defaultValue.value.replace(/\'/g, '')}
</Td>
{!prop.defaultValue ? (
<Td>
<em>[No Default]</em>
</Td>
) : (
<Td>
{prop.defaultValue.value === "''" ? (
<em>[Empty String]</em>
) : (
prop.defaultValue &&
prop.defaultValue.value.replace(/\'/g, '')
)}
</Td>
)}
<Td>{prop.description && prop.description}</Td>
</Tr>
)
Expand Down

0 comments on commit 4669e34

Please sign in to comment.