Skip to content

Commit

Permalink
improve storybook to show names by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Dec 6, 2024
1 parent c27e29b commit 7195636
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions superset-frontend/src/components/Icons/Icons.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,19 @@ const IconBlock = styled.div`
flex-direction: column;
align-items: center;
padding: ${({ theme }) => theme.gridUnit * 2}px;
span {
margin-top: ${({ theme }) =>
2 * theme.gridUnit}px; // Add spacing between icon and name
font-size: ${({ theme }) =>
theme.typography.sizes.m}; // Optional: adjust font size for elegance
color: ${({ theme }) =>
theme.colors.grayscale.base}; // Optional: subtle color for the name
}
`;

export const InteractiveIcons = ({
showNames,
showNames = true,
...rest
}: IconType & { showNames: boolean }) => (
<IconSet>
Expand All @@ -56,7 +65,7 @@ export const InteractiveIcons = ({
return (
<IconBlock key={k}>
<IconComponent {...rest} />
{showNames && k}
{showNames && <span>{k}</span>}
</IconBlock>
);
})}
Expand Down

0 comments on commit 7195636

Please sign in to comment.