From 1daad071ccd7cc6dcf3f759eafd1f0d90b80011c Mon Sep 17 00:00:00 2001 From: bender Date: Thu, 12 Mar 2026 19:14:26 +0000 Subject: [PATCH] Update src/components/shared/SvgTextLogo/SvgTextLogo.tsx --- .../shared/SvgTextLogo/SvgTextLogo.tsx | 79 +++++++++++-------- 1 file changed, 44 insertions(+), 35 deletions(-) diff --git a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx index f214190..e3b3ec8 100644 --- a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx +++ b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx @@ -1,51 +1,60 @@ -"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?: number | string; + letterSpacing?: number; + dominantBaseline?: 'auto' | 'middle' | 'hanging' | 'ideographic' | 'text-top' | 'text-bottom'; + textAnchor?: 'start' | 'middle' | 'end'; } -const SvgTextLogo = memo(function SvgTextLogo({ - logoText, - adjustHeightFactor, - verticalAlign = "top", - className = "", -}) { - const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor); +const SvgTextLogo: React.FC = ({ + text, + className = '', + fontSize = 48, + fontFamily = 'sans-serif', + fontWeight = 700, + letterSpacing = 0, + dominantBaseline = 'middle', + textAnchor = 'middle', +}) => { + // Calculate approximate text width for viewBox + const charWidth = fontSize * 0.6; + const textWidth = text.length * charWidth + letterSpacing * (text.length - 1); + const padding = fontSize * 0.5; + const viewBoxWidth = textWidth + padding * 2; + const viewBoxHeight = fontSize * 1.5; + const xPos = viewBoxWidth / 2; + const yPos = viewBoxHeight / 2; return ( - {logoText} + {text} ); -}); +}; -SvgTextLogo.displayName = "SvgTextLogo"; - -export default SvgTextLogo; +export default SvgTextLogo; \ No newline at end of file -- 2.49.1