8 Commits

Author SHA1 Message Date
6e5a2743d2 Update src/components/shared/SvgTextLogo/SvgTextLogo.tsx 2026-03-11 07:36:27 +00:00
62ba6ac72b Update src/components/shared/SvgTextLogo/SvgTextLogo.tsx 2026-03-11 07:34:28 +00:00
93d576027d Merge version_2 into main
Merge version_2 into main
2026-03-11 07:32:30 +00:00
ce9356d4c4 Merge version_1 into main
Merge version_1 into main
2026-03-11 07:30:08 +00:00
4501120059 Update src/components/shared/SvgTextLogo/SvgTextLogo.tsx 2026-03-11 07:30:04 +00:00
67d8b9b671 Merge version_1 into main
Merge version_1 into main
2026-03-11 07:29:40 +00:00
f5fb1a2f83 Update src/components/shared/SvgTextLogo/SvgTextLogo.tsx 2026-03-11 07:29:36 +00:00
270daddf39 Update src/app/page.tsx 2026-03-11 07:29:36 +00:00

View File

@@ -1,51 +1,48 @@
"use client"; import React from 'react';
import { memo } from "react";
import useSvgTextLogo from "./useSvgTextLogo";
import { cls } from "@/lib/utils";
interface SvgTextLogoProps { interface SvgTextLogoProps {
logoText: string; text: string;
adjustHeightFactor?: number;
verticalAlign?: "top" | "center";
className?: string; className?: string;
fontSize?: number;
fontWeight?: number | string;
letterSpacing?: number;
fill?: string;
textAnchor?: 'start' | 'middle' | 'end';
dominantBaseline?: 'auto' | 'inherit' | 'alphabetic' | 'hanging' | 'ideographic' | 'mathematical' | 'text-before-edge' | 'middle' | 'central' | 'text-after-edge' | 'use-script' | 'no-change' | 'reset-size';
} }
const SvgTextLogo = memo<SvgTextLogoProps>(function SvgTextLogo({ const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
logoText, text,
adjustHeightFactor, className = '',
verticalAlign = "top", fontSize = 48,
className = "", fontWeight = 700,
}) { letterSpacing = 0,
const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor); fill = 'currentColor',
textAnchor = 'middle',
dominantBaseline = 'middle',
}) => {
return ( return (
<svg <svg
ref={svgRef} viewBox="0 0 400 100"
viewBox={viewBox} xmlns="http://www.w3.org/2000/svg"
className={cls("w-full", className)} className={className}
style={{ aspectRatio: aspectRatio }}
preserveAspectRatio="none"
role="img" role="img"
aria-label={`${logoText} logo`} aria-label={text}
> >
<text <text
ref={textRef} x="50%"
x="0" y="50%"
y={verticalAlign === "center" ? "50%" : "0"} fontSize={fontSize}
className="font-bold fill-current" fontWeight={fontWeight}
style={{ letterSpacing={letterSpacing}
fontSize: "20px", fill={fill}
letterSpacing: "-0.02em", textAnchor={textAnchor}
dominantBaseline: verticalAlign === "center" ? "middle" : "text-before-edge" dominantBaseline={dominantBaseline}
}}
> >
{logoText} {text}
</text> </text>
</svg> </svg>
); );
}); };
SvgTextLogo.displayName = "SvgTextLogo";
export default SvgTextLogo; export default SvgTextLogo;