detail page updated , product name zustand clear
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { motion } from "framer-motion";
|
||||
import { X } from "lucide-react";
|
||||
import type { Product } from "@/lib/products";
|
||||
import { useLanguage } from "@/context/language-context";
|
||||
import Link from "next/link";
|
||||
import { useProduct, useProductStore } from "@/lib/productZustand";
|
||||
@@ -14,6 +12,13 @@ export default function DetailInfo() {
|
||||
const product = useProduct((state) => state.product);
|
||||
if (product === null) return null;
|
||||
|
||||
const handleScroll = (href: string) => {
|
||||
const element = document.querySelector(href);
|
||||
if (element) {
|
||||
element.scrollIntoView({ behavior: "smooth" });
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="bg-white">
|
||||
<div className="max-w-[1200px] mx-auto">
|
||||
@@ -46,7 +51,10 @@ export default function DetailInfo() {
|
||||
</div>
|
||||
{/* CTA Buttons */}
|
||||
<div className="space-y-3">
|
||||
<Link href={"#contact"}>
|
||||
<Link
|
||||
href={"#contact"}
|
||||
onClick={() => handleScroll("#contact")}
|
||||
>
|
||||
<motion.button
|
||||
whileHover={{ scale: 1.05 }}
|
||||
whileTap={{ scale: 0.95 }}
|
||||
|
||||
Reference in New Issue
Block a user