2 Commits

Author SHA1 Message Date
e563b62ca1 Update src/components/shared/SvgTextLogo/SvgTextLogo.tsx 2026-03-12 01:43:36 +00:00
65ff0145dd Update src/app/styles/variables.css 2026-03-12 01:43:09 +00:00
2 changed files with 29 additions and 40 deletions

View File

@@ -10,15 +10,15 @@
--accent: #ffffff; --accent: #ffffff;
--background-accent: #ffffff; */ --background-accent: #ffffff; */
--background: #fde8f3; --background: #fef5f8;
--card: #ffffff; --card: #ffffff;
--foreground: #5a1f42; --foreground: #6b2d52;
--primary-cta: #d946a6; --primary-cta: #ec4899;
--primary-cta-text: #ffffff; --primary-cta-text: #ffffff;
--secondary-cta: #ffffff; --secondary-cta: #ffffff;
--secondary-cta-text: #5a1f42; --secondary-cta-text: #5a1f42;
--accent: #f472b6; --accent: #f472b6;
--background-accent: #ec4899; --background-accent: #fbcfe8;
/* text sizing - set by ThemeProvider */ /* text sizing - set by ThemeProvider */
/* --text-2xs: clamp(0.465rem, 0.62vw, 0.62rem); /* --text-2xs: clamp(0.465rem, 0.62vw, 0.62rem);

View File

@@ -1,51 +1,40 @@
"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;
} }
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); }) => {
return ( return (
<svg <svg
ref={svgRef} viewBox={`0 0 ${text.length * fontSize * 0.6} ${fontSize * 1.5}`}
viewBox={viewBox} className={className}
className={cls("w-full", className)} xmlns="http://www.w3.org/2000/svg"
style={{ aspectRatio: aspectRatio }}
preserveAspectRatio="none"
role="img"
aria-label={`${logoText} logo`}
> >
<text <text
ref={textRef} x="50%"
x="0" y="50%"
y={verticalAlign === "center" ? "50%" : "0"} textAnchor="middle"
className="font-bold fill-current" dominantBaseline="central"
style={{ fontSize={fontSize}
fontSize: "20px", fontWeight={fontWeight}
letterSpacing: "-0.02em", letterSpacing={letterSpacing}
dominantBaseline: verticalAlign === "center" ? "middle" : "text-before-edge" fill="currentColor"
}}
> >
{logoText} {text}
</text> </text>
</svg> </svg>
); );
}); };
SvgTextLogo.displayName = "SvgTextLogo";
export default SvgTextLogo; export default SvgTextLogo;