From 386bd85c8d1085d9188076d824b3935af9ab79b5 Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Sun, 22 Mar 2026 23:18:37 +0100 Subject: [PATCH] fix: attach svgRef to SVG elements in Mascot sub-components The svgRef was created but never passed to the sub-component SVG elements, meaning it would always be null when the animation hook tries to use it. Now passed via SvgProps interface. --- packages/web/src/components/ui/Mascot.tsx | 30 ++++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/packages/web/src/components/ui/Mascot.tsx b/packages/web/src/components/ui/Mascot.tsx index 0209b111..01bc0087 100644 --- a/packages/web/src/components/ui/Mascot.tsx +++ b/packages/web/src/components/ui/Mascot.tsx @@ -15,9 +15,15 @@ interface MascotProps { className?: string; } -function IdleSvg({ palette, gradientId }: { palette: typeof MASCOT_PALETTES.idle; gradientId: string }) { +interface SvgProps { + palette: (typeof MASCOT_PALETTES)[MascotState]; + gradientId: string; + svgRef: React.RefObject; +} + +function IdleSvg({ palette, gradientId, svgRef }: SvgProps) { return ( -
- {state === 'idle' && } - {state === 'sleeping' && } - {state === 'excited' && } - {state === 'lonely' && } + {state === 'idle' && } + {state === 'sleeping' && } + {state === 'excited' && } + {state === 'lonely' && } {state === 'sleeping' && (