Merge version_1 into main

Merge version_1 into main
This commit was merged in pull request #1.
This commit is contained in:
2026-03-11 22:27:06 +00:00

View File

@@ -1,51 +1,37 @@
"use client";
import React, { SVGProps } from 'react';
import { memo } from "react";
import useSvgTextLogo from "./useSvgTextLogo";
import { cls } from "@/lib/utils";
interface SvgTextLogoProps {
logoText: string;
adjustHeightFactor?: number;
verticalAlign?: "top" | "center";
interface SvgTextLogoProps extends SVGProps<SVGSVGElement> {
text: string;
className?: string;
textClassName?: string;
}
const SvgTextLogo = memo<SvgTextLogoProps>(function SvgTextLogo({
logoText,
adjustHeightFactor,
verticalAlign = "top",
className = "",
}) {
const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor);
return (
<svg
ref={svgRef}
viewBox={viewBox}
className={cls("w-full", className)}
style={{ aspectRatio: aspectRatio }}
preserveAspectRatio="none"
role="img"
aria-label={`${logoText} logo`}
>
<text
ref={textRef}
x="0"
y={verticalAlign === "center" ? "50%" : "0"}
className="font-bold fill-current"
style={{
fontSize: "20px",
letterSpacing: "-0.02em",
dominantBaseline: verticalAlign === "center" ? "middle" : "text-before-edge"
}}
const SvgTextLogo = React.forwardRef<SVGSVGElement, SvgTextLogoProps>(
({ text, className = '', textClassName = '', ...props }, ref) => {
return (
<svg
ref={ref}
viewBox={`0 0 ${Math.max(text.length * 60, 200)} 100`}
preserveAspectRatio="xMidYMid meet"
className={className}
{...props}
>
{logoText}
</text>
</svg>
);
});
<text
x="50%"
y="50%"
dominantBaseline="central"
textAnchor="middle"
className={textClassName}
fontSize="48"
fontWeight="bold"
>
{text}
</text>
</svg>
);
}
);
SvgTextLogo.displayName = "SvgTextLogo";
SvgTextLogo.displayName = 'SvgTextLogo';
export default SvgTextLogo;