From f8f1eae86c5a7a4c0ece169a197fe3a3d0c08cc6 Mon Sep 17 00:00:00 2001 From: nhussein11 Date: Mon, 31 Jul 2023 15:45:08 -0300 Subject: [PATCH] fix: export component --- src/lib/components/image/index.tsx | 18 +++++++++--------- src/lib/components/index.ts | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lib/components/image/index.tsx b/src/lib/components/image/index.tsx index ca4acb4..7eb0417 100644 --- a/src/lib/components/image/index.tsx +++ b/src/lib/components/image/index.tsx @@ -27,31 +27,31 @@ export const ImageIPFS = ({ fallbackImage = DEFAULT_FALLBACK_IMAGE, ...props }: IpfsImageProps): JSX.Element => { - const imgLoading = lazy === true ? 'lazy' : 'eager' - const [imgSrc, setImgSrc] = useState('') + const lazyLoading = lazy === true ? 'lazy' : 'eager' + const [imageURL, setImageURL] = useState('') useEffect(() => { - const imgSrcCleaned = getIpfsURL(gateway, hash) - setImgSrc(imgSrcCleaned) + const cleanedImageURL = getIpfsURL(gateway, hash) + setImageURL(cleanedImageURL) }, [hash, gateway]) - const handleOnError = (event: SyntheticEvent): void => { + const handleImageError = (event: SyntheticEvent): void => { if (event.type === 'error') { - setImgSrc(fallbackImage) + setImageURL(fallbackImage) } } return ( {alt} { - handleOnError(event) + handleImageError(event) }} {...props} /> diff --git a/src/lib/components/index.ts b/src/lib/components/index.ts index cbe2b9d..556dbfd 100644 --- a/src/lib/components/index.ts +++ b/src/lib/components/index.ts @@ -1 +1 @@ -export * from './dummy' +export * from './image'