From 967b62daaa23f5258c635856a91109d4d4f8d807 Mon Sep 17 00:00:00 2001 From: bender Date: Thu, 12 Mar 2026 17:24:22 +0000 Subject: [PATCH 1/2] Update src/app/page.tsx --- src/app/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index e89a739..ffac3e0 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -15,7 +15,7 @@ export default function LandingPage() { return ( -- 2.49.1 From 832c46bc247f38c6bd97c6895da9c9ec55c44adb Mon Sep 17 00:00:00 2001 From: bender Date: Thu, 12 Mar 2026 17:24:22 +0000 Subject: [PATCH 2/2] Update src/components/shared/SvgTextLogo/SvgTextLogo.tsx --- .../shared/SvgTextLogo/SvgTextLogo.tsx | 104 +++++++++++------- 1 file changed, 63 insertions(+), 41 deletions(-) diff --git a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx index f214190..baf6dd0 100644 --- a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx +++ b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx @@ -1,51 +1,73 @@ -"use client"; - -import { memo } from "react"; -import useSvgTextLogo from "./useSvgTextLogo"; -import { cls } from "@/lib/utils"; +import React from 'react'; interface SvgTextLogoProps { - logoText: string; - adjustHeightFactor?: number; - verticalAlign?: "top" | "center"; + text: string; className?: string; + fontSize?: number; + fontFamily?: string; + fontWeight?: string | number; + letterSpacing?: number; + fill?: string; + dominantBaseline?: 'auto' | 'text-bottom' | 'alphabetic' | 'ideographic' | 'middle' | 'central' | 'mathematical' | 'hanging'; } -const SvgTextLogo = memo(function SvgTextLogo({ - logoText, - adjustHeightFactor, - verticalAlign = "top", - className = "", -}) { - const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor); +const SvgTextLogo = React.forwardRef( + ( + { + text, + className = '', + fontSize = 48, + fontFamily = 'system-ui, -apple-system, sans-serif', + fontWeight = 'bold', + letterSpacing = 0, + fill = 'currentColor', + dominantBaseline = 'middle', + }, + ref, + ) => { + const svgRef = React.useRef(null); + const [dimensions, setDimensions] = React.useState({ width: 400, height: 100 }); - return ( - - { + if (svgRef.current) { + const textElement = svgRef.current.querySelector('text'); + if (textElement) { + const bbox = textElement.getBBox(); + setDimensions({ + width: Math.ceil(bbox.width + 20), + height: Math.ceil(bbox.height + 20), + }); + } + } + }, [text, fontSize, fontFamily, fontWeight]); + + React.useImperativeHandle(ref, () => svgRef.current!); + + return ( + - {logoText} - - - ); -}); + + {text} + + + ); + }, +); -SvgTextLogo.displayName = "SvgTextLogo"; +SvgTextLogo.displayName = 'SvgTextLogo'; export default SvgTextLogo; -- 2.49.1