Skip to content

Commit

Permalink
fix(Icon): fix storybook iconList (#3342)
Browse files Browse the repository at this point in the history
  • Loading branch information
mainframev committed Apr 27, 2022
1 parent cb10efc commit 3009190
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions packages/orbit-components/src/Icon/IconList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,24 @@ const IconImport = styled.div`

const IconList = (): React.Node => (
<List>
{Object.keys(Icons).map(icon => {
const Icon = styled(Icons[icon])`
padding: 0 ${defaultTokens.spaceLarge};
flex-shrink: 0;
`;
const iconName = `${icon}`;
return (
<Container key={icon}>
<Icon size="large" color="primary" />
<IconImport>
{`import ${iconName} from "@kiwicom/orbit-components/lib/icons/${iconName}"`}
</IconImport>
</Container>
);
})}
{Object.keys(Icons)
.filter(n => n !== "__namedExportsOrder")
.map(icon => {
const Icon = styled(Icons[icon])`
padding: 0 ${defaultTokens.spaceLarge};
flex-shrink: 0;
`;

const iconName = `${icon}`;
return (
<Container key={icon}>
<Icon size="large" color="primary" />
<IconImport>
{`import ${iconName} from "@kiwicom/orbit-components/lib/icons/${iconName}"`}
</IconImport>
</Container>
);
})}
</List>
);

Expand Down

0 comments on commit 3009190

Please sign in to comment.