From d0444233305fce90dfd00e62a961524943375fe1 Mon Sep 17 00:00:00 2001 From: jialin Date: Wed, 4 Dec 2024 21:02:23 +0800 Subject: [PATCH] fix: image handleonload callback --- src/components/auto-image/single-image.tsx | 30 +--------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/src/components/auto-image/single-image.tsx b/src/components/auto-image/single-image.tsx index 310a1328..cf9e6fcf 100644 --- a/src/components/auto-image/single-image.tsx +++ b/src/components/auto-image/single-image.tsx @@ -75,35 +75,7 @@ const SingleImage: React.FC = (props) => { [autoSize, props.width, props.height] ); - // const handleOnLoad = React.useCallback(async () => { - // if (!autoBgColor) { - // return; - // } - - // const img = imgWrapper.current?.querySelector('img'); - // if (!img) { - // return; - // } - - // Vibrant.from(img.src).getPalette((err: any, palette: any) => { - // if (err) { - // console.error(err); - // return; - // } - // const color = palette?.Vibrant?.rgb; - // const mutedColor = palette?.Muted?.rgb; - - // const startColor = color - // ? `rgba(${color[0]}, ${color[1]}, ${color[2]},0.7)` - // : ''; - // const stopColor = mutedColor - // ? `rgba(${mutedColor[0]}, ${mutedColor[1]}, ${mutedColor[2]},0.5)` - // : ''; - // setColor({ - // backgroundImage: `linear-gradient(135deg, ${startColor}, ${stopColor})` - // }); - // }); - // }, [autoBgColor]); + const handleOnLoad = React.useCallback(async () => {}, []); return (