Update src/components/shared/SvgTextLogo/SvgTextLogo.tsx
This commit is contained in:
@@ -2,33 +2,27 @@ import React from 'react';
|
||||
|
||||
interface SvgTextLogoProps {
|
||||
text: string;
|
||||
fontSize?: number;
|
||||
fontFamily?: string;
|
||||
fill?: string;
|
||||
className?: string;
|
||||
textClassName?: string;
|
||||
}
|
||||
|
||||
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
|
||||
text,
|
||||
fontSize = 24,
|
||||
fontFamily = 'Arial, sans-serif',
|
||||
fill = 'currentColor',
|
||||
className = '',
|
||||
textClassName = '',
|
||||
}) => {
|
||||
return (
|
||||
<svg
|
||||
viewBox="0 0 200 100"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className={className}
|
||||
viewBox={`0 0 ${text.length * 60} 100`}
|
||||
className={`w-full h-auto ${className}`}
|
||||
preserveAspectRatio="xMidYMid meet"
|
||||
>
|
||||
<text
|
||||
x="50%"
|
||||
y="50%"
|
||||
fontSize={fontSize}
|
||||
fontFamily={fontFamily}
|
||||
fill={fill}
|
||||
textAnchor="middle"
|
||||
dominantBaseline="central"
|
||||
dominantBaseline="middle"
|
||||
className={`text-4xl font-bold fill-current ${textClassName}`}
|
||||
>
|
||||
{text}
|
||||
</text>
|
||||
@@ -36,4 +30,4 @@ const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default SvgTextLogo;
|
||||
export default SvgTextLogo;
|
||||
Reference in New Issue
Block a user