diff --git a/src/components/home/TrustedByMarquee.tsx b/src/components/home/TrustedByMarquee.tsx index 215f02acf..4c6538987 100644 --- a/src/components/home/TrustedByMarquee.tsx +++ b/src/components/home/TrustedByMarquee.tsx @@ -37,6 +37,7 @@ interface TrustedByItem { image?: string; title: string; svg?: string; + height?: number | string; } const TrustedByMarquee = ({ @@ -56,37 +57,72 @@ const TrustedByMarquee = ({ ...trustedBySection, ]; + // Process SVG string to fix height attribute + const processSvg = (svgString: string) => { + return svgString.replace(/height="100%"/g, "").replace(/width="100%"/g, ""); + }; + + useEffect(() => { + // Use a small delay to ensure DOM is ready + const timer = setTimeout(() => { + if (trackRef.current) { + const svgs = trackRef.current.querySelectorAll("svg"); + svgs.forEach((svg, index) => { + const itemIndex = index % trustedBySection.length; + const item = trustedBySection[itemIndex]; + const height = item.height + ? typeof item.height === "number" + ? `${item.height}px` + : item.height + : "34px"; + + svg.removeAttribute("width"); + svg.removeAttribute("height"); + svg.style.height = height; + svg.style.width = "auto"; + svg.style.display = "block"; + }); + } + }, 100); + + return () => clearTimeout(timer); + }, [trustedBySection, isLoaded]); + return (