Skip to content

Commit

Permalink
fix: typings
Browse files Browse the repository at this point in the history
  • Loading branch information
jmfrancois committed Oct 18, 2023
1 parent 8fff161 commit cf10013
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { TFunction } from 'i18next';
import { withTranslation } from 'react-i18next';

import Icon from '../../Icon';
import { Icon, SVG_TRANSFORMS } from '@talend/design-system';
import I18N_DOMAIN_COMPONENTS from '../../constants';
import getDefaultT from '../../translate';

Expand All @@ -16,7 +15,7 @@ function SkipTo({ href, label }: SkipToProps) {
return (
<a href={href}>
<span className={theme.icon}>
<Icon transform="rotate-270" name="talend-arrow-left" />
<Icon transform={SVG_TRANSFORMS.Rotate270} name="talend-arrow-left" />
</span>
<span className={theme.text}>{label}</span>
</a>
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/Skeleton/Skeleton.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function Skeleton({
type: getTranslatedType(t, type),
});

if (type === 'icon') {
if (type === 'icon' && name) {
return <Icon className={classes} name={name} aria-label={ariaLabel} />;
}
return <span style={{ width, height }} className={classes} aria-label={ariaLabel} />;
Expand Down
6 changes: 3 additions & 3 deletions packages/design-system/src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const accessibility = {
};

// eslint-disable-next-line react/display-name
export const Icon = forwardRef(
const IconBase = forwardRef(
(
{ className, name = 'talend-empty-space', transform, border, ...rest }: IconProps,
ref: Ref<SVGSVGElement>,
Expand Down Expand Up @@ -153,6 +153,6 @@ export const Icon = forwardRef(
},
);

export const IconMemo = memo(Icon);
export const Icon = memo(IconBase);

IconMemo.displayName = 'Icon';
Icon.displayName = 'Icon';
5 changes: 1 addition & 4 deletions packages/design-system/src/components/Icon/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
import { IconMemo } from './Icon';

export * from './Icon';
export * from './SizedIcon';

export const Icon = IconMemo;

0 comments on commit cf10013

Please sign in to comment.