From cf1001302950302711447be56adeb198198f36f3 Mon Sep 17 00:00:00 2001 From: jmfrancois Date: Wed, 18 Oct 2023 15:43:02 +0200 Subject: [PATCH] fix: typings --- .../components/src/Layout/SkipLinks/SkipLinks.component.tsx | 5 ++--- packages/components/src/Skeleton/Skeleton.component.tsx | 2 +- packages/design-system/src/components/Icon/Icon.tsx | 6 +++--- packages/design-system/src/components/Icon/index.ts | 5 +---- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/packages/components/src/Layout/SkipLinks/SkipLinks.component.tsx b/packages/components/src/Layout/SkipLinks/SkipLinks.component.tsx index 3c9d8afc5eb..85bc2777d49 100644 --- a/packages/components/src/Layout/SkipLinks/SkipLinks.component.tsx +++ b/packages/components/src/Layout/SkipLinks/SkipLinks.component.tsx @@ -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'; @@ -16,7 +15,7 @@ function SkipTo({ href, label }: SkipToProps) { return ( - + {label} diff --git a/packages/components/src/Skeleton/Skeleton.component.tsx b/packages/components/src/Skeleton/Skeleton.component.tsx index 6d779ea0849..74a4b1e0c78 100644 --- a/packages/components/src/Skeleton/Skeleton.component.tsx +++ b/packages/components/src/Skeleton/Skeleton.component.tsx @@ -79,7 +79,7 @@ function Skeleton({ type: getTranslatedType(t, type), }); - if (type === 'icon') { + if (type === 'icon' && name) { return ; } return ; diff --git a/packages/design-system/src/components/Icon/Icon.tsx b/packages/design-system/src/components/Icon/Icon.tsx index 3822d3f25b6..eb3da6c0270 100644 --- a/packages/design-system/src/components/Icon/Icon.tsx +++ b/packages/design-system/src/components/Icon/Icon.tsx @@ -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, @@ -153,6 +153,6 @@ export const Icon = forwardRef( }, ); -export const IconMemo = memo(Icon); +export const Icon = memo(IconBase); -IconMemo.displayName = 'Icon'; +Icon.displayName = 'Icon'; diff --git a/packages/design-system/src/components/Icon/index.ts b/packages/design-system/src/components/Icon/index.ts index 1de4aa069b4..ca5d80d8ae4 100644 --- a/packages/design-system/src/components/Icon/index.ts +++ b/packages/design-system/src/components/Icon/index.ts @@ -1,5 +1,2 @@ -import { IconMemo } from './Icon'; - +export * from './Icon'; export * from './SizedIcon'; - -export const Icon = IconMemo;