From faf4908a5e4e2deaf6e9d8f5d625ad9922dd10b5 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 13 Mar 2026 11:58:21 +0000 Subject: [PATCH] Update src/components/shared/SvgTextLogo/SvgTextLogo.tsx --- .../shared/SvgTextLogo/SvgTextLogo.tsx | 106 +++++++++++------- 1 file changed, 68 insertions(+), 38 deletions(-) diff --git a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx index f214190..11e9fc2 100644 --- a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx +++ b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx @@ -1,51 +1,81 @@ -"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; + fill?: string; + letterSpacing?: number; + animationDuration?: number; + animationDelay?: number; } -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 = 'Arial, sans-serif', + fontWeight = 700, + fill = 'currentColor', + letterSpacing = 0, + animationDuration = 1, + animationDelay = 0, +}) => { + const textLength = text.length; + const charWidth = fontSize * 0.6; + const totalWidth = textLength * charWidth + (textLength - 1) * letterSpacing; + const viewBoxWidth = totalWidth + fontSize; + const viewBoxHeight = fontSize * 1.5; + const xStart = fontSize / 2; + const yStart = fontSize; return ( - - {logoText} - + + + + {Array.from(text).map((char, index) => ( + + {char} + + ))} ); -}); - -SvgTextLogo.displayName = "SvgTextLogo"; +}; export default SvgTextLogo; -- 2.49.1