Skip to content

Commit

Permalink
feat(demo-canvas-app): Add scalable icons demo
Browse files Browse the repository at this point in the history
  • Loading branch information
neretin-trike committed Mar 31, 2022
1 parent 21a0d81 commit cd36664
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/demo-canvas-app/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const menu = [
{ href: '/test/components/tabs/', title: 'Tabs' },
{ href: '/test/components/text-field/', title: 'TextField' },
{ href: '/test/components/toast/', title: 'Toast' },
{ href: '/test/components/icons/', title: 'Icons' },
];

const StyledCard = styled.a`
Expand Down
31 changes: 31 additions & 0 deletions examples/demo-canvas-app/pages/test/components/icons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { iconSet16, iconSet24, iconSet36, IconRootScalable } from '@sberdevices/plasma-icons';
import { IconSetUnionSize } from '@sberdevices/plasma-icons/scalable/IconRoot';
import { ParagraphText1 } from '@sberdevices/plasma-ui';

export default function IconsPage() {
const iconSets = {
...iconSet16,
...iconSet24,
...iconSet36,
};

return (
<>
{Object.keys(iconSets).map((iconName) => (
<div key={iconName} style={{ display: 'flex', alignItems: 'center' }}>
<IconRootScalable size="s" iconName={iconName as IconSetUnionSize} color="inherit" />
<ParagraphText1> - {iconName}</ParagraphText1>
</div>
))}
</>
);
}

export function getStaticProps() {
return {
props: {
title: 'Icons',
back: true,
},
};
}
5 changes: 5 additions & 0 deletions packages/plasma-icons/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,8 @@ export type { IconProps, IconSize } from './IconRoot';

export { Icon, iconSectionsSet } from './Icon';
export type { IconName } from './Icon';

export { iconSet16 } from './scalable/Icon.assets.16';
export { iconSet24 } from './scalable/Icon.assets.24';
export { iconSet36 } from './scalable/Icon.assets.36';
export { IconRoot as IconRootScalable } from './scalable';

0 comments on commit cd36664

Please sign in to comment.