diff --git a/src/app/page.tsx b/src/app/page.tsx index 462e87f..8e9b2a9 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -60,15 +60,15 @@ export default function LandingPage() { features={[ { id: 1, - title: "Κάνει περίεργους θορύβους", description: "Ο ανελκυστήρας σας μουσικολογεί περισσότερο από το αναμενόμενο;", imageSrc: "http://img.b2bpic.net/free-photo/experts-check-warehouse-inventory_482257-75354.jpg?_wi=1", imageAlt: "elevator installation construction workers building" + title: "Κάνει περίεργους θορύβους", description: "Ο ανελκυστήρας σας μουσικολογεί περισσότερο από το αναμενόμενο;", imageSrc: "http://img.b2bpic.net/free-photo/experts-check-warehouse-inventory_482257-75354.jpg", imageAlt: "elevator installation construction workers building" }, { id: 2, - title: "Σταματάει στον 3ο όροφο για… διακοπές", description: "Φαίνεται να έχει δημιουργήσει τη δική του στάση διακοπών;", imageSrc: "http://img.b2bpic.net/free-photo/male-electrician-works-switchboard-with-electrical-connecting-cable_169016-53033.jpg?_wi=1", imageAlt: "elevator maintenance inspection professional technician" + title: "Σταματάει στον 3ο όροφο για… διακοπές", description: "Φαίνεται να έχει δημιουργήσει τη δική του στάση διακοπών;", imageSrc: "http://img.b2bpic.net/free-photo/male-electrician-works-switchboard-with-electrical-connecting-cable_169016-53033.jpg", imageAlt: "elevator maintenance inspection professional technician" }, { id: 3, - title: "Αρνείται να κατέβει", description: "Ο ανελκυστήρας σας έχει αναπτύξει μια ιδιοσυγκρασία κατά της κατόπιν κινήσεως;", imageSrc: "http://img.b2bpic.net/free-photo/electrician-installing-laying-electrical-cables-ceiling-inside-house_169016-53070.jpg?_wi=1", imageAlt: "elevator repair technician professional fixing" + title: "Αρνείται να κατέβει", description: "Ο ανελκυστήρας σας έχει αναπτύξει μια ιδιοσυγκρασία κατά της κατόπιν κινήσεως;", imageSrc: "http://img.b2bpic.net/free-photo/electrician-installing-laying-electrical-cables-ceiling-inside-house_169016-53070.jpg", imageAlt: "elevator repair technician professional fixing" } ]} /> @@ -85,15 +85,15 @@ export default function LandingPage() { products={[ { id: "1", brand: "Εγκατάσταση", name: "Εγκατάσταση Ανελκυστήρων", price: "Επαγγελματική εγκατάσταση", rating: 5, - reviewCount: "50+", imageSrc: "http://img.b2bpic.net/free-photo/experts-check-warehouse-inventory_482257-75354.jpg?_wi=2", imageAlt: "Εγκατάσταση ανελκυστήρα" + reviewCount: "50+", imageSrc: "http://img.b2bpic.net/free-photo/experts-check-warehouse-inventory_482257-75354.jpg", imageAlt: "Εγκατάσταση ανελκυστήρα" }, { id: "2", brand: "Συντήρηση", name: "Τακτική Συντήρηση", price: "Ασφάλεια και απόδοση", rating: 5, - reviewCount: "100+", imageSrc: "http://img.b2bpic.net/free-photo/male-electrician-works-switchboard-with-electrical-connecting-cable_169016-53033.jpg?_wi=2", imageAlt: "Συντήρηση ανελκυστήρα" + reviewCount: "100+", imageSrc: "http://img.b2bpic.net/free-photo/male-electrician-works-switchboard-with-electrical-connecting-cable_169016-53033.jpg", imageAlt: "Συντήρηση ανελκυστήρα" }, { id: "3", brand: "Επισκευές", name: "Γρήγορες Επισκευές", price: "Άμεση αποκατάσταση", rating: 5, - reviewCount: "150+", imageSrc: "http://img.b2bpic.net/free-photo/electrician-installing-laying-electrical-cables-ceiling-inside-house_169016-53070.jpg?_wi=2", imageAlt: "Επισκευή ανελκυστήρα" + reviewCount: "150+", imageSrc: "http://img.b2bpic.net/free-photo/electrician-installing-laying-electrical-cables-ceiling-inside-house_169016-53070.jpg", imageAlt: "Επισκευή ανελκυστήρα" } ]} /> @@ -103,6 +103,7 @@ export default function LandingPage() { diff --git a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx index f214190..1ad9248 100644 --- a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx +++ b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx @@ -1,51 +1,71 @@ -"use client"; - -import { memo } from "react"; -import useSvgTextLogo from "./useSvgTextLogo"; -import { cls } from "@/lib/utils"; +import React, { useEffect, useRef, useState } from 'react'; interface SvgTextLogoProps { - logoText: string; - adjustHeightFactor?: number; - verticalAlign?: "top" | "center"; + text: string; className?: string; + fontSize?: number; + fontFamily?: string; + fill?: string; + strokeWidth?: number; + animationDuration?: number; } -const SvgTextLogo = memo(function SvgTextLogo({ - logoText, - adjustHeightFactor, - verticalAlign = "top", - className = "", -}) { - const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor); +const SvgTextLogo: React.FC = ({ + text, + className = '', + fontSize = 48, + fontFamily = 'Arial, sans-serif', + fill = 'currentColor', + strokeWidth = 0, + animationDuration = 2, +}) => { + const svgRef = useRef(null); + const [textWidth, setTextWidth] = useState(0); + + useEffect(() => { + if (svgRef.current) { + const textElement = svgRef.current.querySelector('text'); + if (textElement) { + const bbox = textElement.getBBox(); + setTextWidth(bbox.width + 20); + } + } + }, [text]); return ( + + + - {logoText} + {text} ); -}); +}; -SvgTextLogo.displayName = "SvgTextLogo"; - -export default SvgTextLogo; +export default SvgTextLogo; \ No newline at end of file