Skip to content

Commit

Permalink
fix: linter issue
Browse files Browse the repository at this point in the history
  • Loading branch information
leinelissen committed Apr 10, 2023
1 parent ba805e0 commit a8c0003
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/components/CoverImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ function CoverImage({
return { imageSize, canvasSize };
}, [blurRadius, margin]);

const skiaImage = useMemo(() => (image || fallback), [image, fallback]);

return (
<Container size={imageSize} style={style}>
<BlurContainer size={canvasSize} offset={blurRadius}>
Expand All @@ -65,18 +67,16 @@ function CoverImage({
<Shadow dx={0} dy={8} blur={16} color="#0000000d" />
<Shadow dx={0} dy={16} blur={32} color="#0000000d" />
</RoundedRect>
{(image || fallback) ? (
{skiaImage ? (
<>
<SkiaImage image={image || fallback} width={imageSize} height={imageSize} opacity={opacity}>
<SkiaImage image={skiaImage} width={imageSize} height={imageSize} opacity={opacity}>
<Offset x={blurRadius} y={blurRadius} />
<Blur blur={blurRadius / 2} />
</SkiaImage>
<Mask mask={<RoundedRect width={imageSize} height={imageSize} x={blurRadius} y={blurRadius} r={radius} />}>
{(image || fallback) ? (
<SkiaImage image={image || fallback} width={imageSize} height={imageSize}>
<Offset x={blurRadius} y={blurRadius} />
</SkiaImage>
) : null}
<SkiaImage image={skiaImage} width={imageSize} height={imageSize}>
<Offset x={blurRadius} y={blurRadius} />
</SkiaImage>
</Mask>
</>
) : null}
Expand Down

0 comments on commit a8c0003

Please sign in to comment.