Merge version_1 into main #2
@@ -52,10 +52,10 @@ export default function LandingPage() {
|
||||
imageSrc: "http://img.b2bpic.net/free-photo/front-view-little-cute-boys-hiding-with-checkered-sheet_179666-45446.jpg", imageAlt: "Adorable baby onesie collection"
|
||||
},
|
||||
{
|
||||
imageSrc: "http://img.b2bpic.net/free-photo/flat-lay-beautiful-baby-shower-concept_23-2148731362.jpg?_wi=1", imageAlt: "Cute baby apparel design"
|
||||
imageSrc: "http://img.b2bpic.net/free-photo/flat-lay-beautiful-baby-shower-concept_23-2148731362.jpg", imageAlt: "Cute baby apparel design"
|
||||
},
|
||||
{
|
||||
imageSrc: "http://img.b2bpic.net/free-vector/everything-will-be-ok-spanish_23-2148483407.jpg?_wi=1", imageAlt: "Playful kids shirt design"
|
||||
imageSrc: "http://img.b2bpic.net/free-vector/everything-will-be-ok-spanish_23-2148483407.jpg", imageAlt: "Playful kids shirt design"
|
||||
}
|
||||
]}
|
||||
autoplayDelay={5000}
|
||||
@@ -84,13 +84,13 @@ export default function LandingPage() {
|
||||
tag="Bestsellers"
|
||||
products={[
|
||||
{
|
||||
id: "1", name: "Sunshine Onesie", price: "$24.99", imageSrc: "http://img.b2bpic.net/free-photo/flat-lay-beautiful-baby-shower-concept_23-2148731362.jpg?_wi=2", imageAlt: "Sunshine Onesie"
|
||||
id: "1", name: "Sunshine Onesie", price: "$24.99", imageSrc: "http://img.b2bpic.net/free-photo/flat-lay-beautiful-baby-shower-concept_23-2148731362.jpg", imageAlt: "Sunshine Onesie"
|
||||
},
|
||||
{
|
||||
id: "2", name: "Mint Dream Onesie", price: "$24.99", imageSrc: "http://img.b2bpic.net/free-photo/baby-shoes-romper_23-2147698699.jpg", imageAlt: "Mint Dream Onesie"
|
||||
},
|
||||
{
|
||||
id: "3", name: "Adventure Kids Tee", price: "$19.99", imageSrc: "http://img.b2bpic.net/free-vector/everything-will-be-ok-spanish_23-2148483407.jpg?_wi=2", imageAlt: "Adventure Kids Tee"
|
||||
id: "3", name: "Adventure Kids Tee", price: "$19.99", imageSrc: "http://img.b2bpic.net/free-vector/everything-will-be-ok-spanish_23-2148483407.jpg", imageAlt: "Adventure Kids Tee"
|
||||
},
|
||||
{
|
||||
id: "4", name: "Dreamer Toddler Shirt", price: "$21.99", imageSrc: "http://img.b2bpic.net/free-photo/medium-shot-boy-with-toy-hat_23-2148350077.jpg", imageAlt: "Dreamer Toddler Shirt"
|
||||
@@ -200,4 +200,4 @@ export default function LandingPage() {
|
||||
</div>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,51 +1,45 @@
|
||||
"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;
|
||||
fontWeight?: number | string;
|
||||
fontFamily?: string;
|
||||
letterSpacing?: number;
|
||||
textAnchor?: 'start' | 'middle' | 'end';
|
||||
dominantBaseline?: 'auto' | 'middle' | 'hanging' | 'baseline' | 'central' | 'text-bottom' | 'alphabetic' | 'ideographic' | 'mathematical';
|
||||
}
|
||||
|
||||
const SvgTextLogo = memo<SvgTextLogoProps>(function SvgTextLogo({
|
||||
logoText,
|
||||
adjustHeightFactor,
|
||||
verticalAlign = "top",
|
||||
className = "",
|
||||
}) {
|
||||
const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor);
|
||||
|
||||
export default function SvgTextLogo({
|
||||
text,
|
||||
className = '',
|
||||
fontSize = 48,
|
||||
fontWeight = 700,
|
||||
fontFamily = 'Arial, sans-serif',
|
||||
letterSpacing = 0,
|
||||
textAnchor = 'middle',
|
||||
dominantBaseline = 'middle',
|
||||
}: SvgTextLogoProps) {
|
||||
return (
|
||||
<svg
|
||||
ref={svgRef}
|
||||
viewBox={viewBox}
|
||||
className={cls("w-full", className)}
|
||||
style={{ aspectRatio: aspectRatio }}
|
||||
preserveAspectRatio="none"
|
||||
role="img"
|
||||
aria-label={`${logoText} logo`}
|
||||
viewBox="0 0 300 100"
|
||||
className={`w-full h-auto ${className}`}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<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"
|
||||
}}
|
||||
x="150"
|
||||
y="50"
|
||||
fontSize={fontSize}
|
||||
fontWeight={fontWeight}
|
||||
fontFamily={fontFamily}
|
||||
letterSpacing={letterSpacing}
|
||||
textAnchor={textAnchor}
|
||||
dominantBaseline={dominantBaseline}
|
||||
fill="currentColor"
|
||||
>
|
||||
{logoText}
|
||||
{text}
|
||||
</text>
|
||||
</svg>
|
||||
);
|
||||
});
|
||||
|
||||
SvgTextLogo.displayName = "SvgTextLogo";
|
||||
|
||||
export default SvgTextLogo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user