Merge version_3 into main #7
@@ -1,11 +1,7 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Inter } from "next/font/google";
|
||||
import "./globals.css";
|
||||
|
||||
const inter = Inter({ subsets: ["latin"], variable: "--font-inter" });
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Cerramientos Walter - Ventanas de Aluminio y Cerramientos a Medida", description: "Especialistas en ventanas de aluminio, cerramientos, rejas, mosquiteros y soluciones a medida. Trabajos prolijos con materiales de calidad."};
|
||||
title: "Cerramientos Walter", description: "Especialistas en ventanas de aluminio, cerramientos, rejas y soluciones a medida"};
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
@@ -14,7 +10,7 @@ export default function RootLayout({
|
||||
}) {
|
||||
return (
|
||||
<html lang="es">
|
||||
<body className={`${inter.variable} antialiased`}>
|
||||
<body>
|
||||
{children}
|
||||
|
||||
<script
|
||||
|
||||
@@ -11,6 +11,7 @@ import TestimonialCardTen from "@/components/sections/testimonial/TestimonialCar
|
||||
import ProductCardOne from "@/components/sections/product/ProductCardOne";
|
||||
import ContactSplit from "@/components/sections/contact/ContactSplit";
|
||||
import FooterBaseCard from "@/components/sections/footer/FooterBaseCard";
|
||||
import WhatsAppButton from "@/components/whatsapp/WhatsAppButton";
|
||||
import { Sparkles, CheckCircle, Shield, Wind, Wrench, Hammer } from "lucide-react";
|
||||
|
||||
export default function HomePage() {
|
||||
@@ -245,6 +246,12 @@ export default function HomePage() {
|
||||
copyrightText="© 2025 Cerramientos Walter. Todos los derechos reservados. Buenos Aires, Argentina."
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* WhatsApp Floating Button */}
|
||||
<WhatsAppButton
|
||||
phoneNumber="5491139493469"
|
||||
message="Hola, quiero consultar por un presupuesto."
|
||||
/>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
39
src/components/whatsapp/WhatsAppButton.tsx
Normal file
39
src/components/whatsapp/WhatsAppButton.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
"use client";
|
||||
|
||||
import { MessageCircle } from "lucide-react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
interface WhatsAppButtonProps {
|
||||
phoneNumber: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export default function WhatsAppButton({
|
||||
phoneNumber,
|
||||
message,
|
||||
}: WhatsAppButtonProps) {
|
||||
const [isVisible, setIsVisible] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setIsVisible(true);
|
||||
}, []);
|
||||
|
||||
const handleClick = () => {
|
||||
const encodedMessage = encodeURIComponent(message);
|
||||
const whatsappUrl = `https://wa.me/${phoneNumber}?text=${encodedMessage}`;
|
||||
window.open(whatsappUrl, "_blank");
|
||||
};
|
||||
|
||||
if (!isVisible) return null;
|
||||
|
||||
return (
|
||||
<button
|
||||
onClick={handleClick}
|
||||
aria-label="Contact us on WhatsApp"
|
||||
className="fixed bottom-8 right-8 z-50 flex items-center justify-center w-14 h-14 rounded-full bg-green-500 hover:bg-green-600 shadow-lg transition-all duration-300 hover:scale-110 active:scale-95"
|
||||
title="Chat on WhatsApp"
|
||||
>
|
||||
<MessageCircle className="w-6 h-6 text-white" strokeWidth={2} />
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user