Skip to content

Commit

Permalink
Don't show empty arg tables in doc pages
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpeulen committed Feb 26, 2024
1 parent 8c027ac commit e05cae9
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions code/ui/blocks/src/blocks/Controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,21 @@ export const Controls: FC<ControlsProps> = (props) => {

const hasSubcomponents = Boolean(subcomponents) && Object.keys(subcomponents).length > 0;

console.log(Object.keys(filteredArgTypes).length > 0 || Object.keys(args).length > 0);
if (!hasSubcomponents) {
return (
<PureArgsTable
rows={filteredArgTypes}
sort={sort}
args={args}
globals={globals}
updateArgs={updateArgs}
resetArgs={resetArgs}
/>
);
if (Object.keys(filteredArgTypes).length > 0 || Object.keys(args).length > 0) {
return (
<PureArgsTable
rows={filteredArgTypes}
sort={sort}
args={args}
globals={globals}
updateArgs={updateArgs}
resetArgs={resetArgs}
/>
);
}
return null;
}

const mainComponentName = getComponentName(component);
Expand Down

0 comments on commit e05cae9

Please sign in to comment.