diff --git a/src/components/scrollLink/index.tsx b/src/components/scrollLink/index.tsx new file mode 100644 index 0000000..a31dd0d --- /dev/null +++ b/src/components/scrollLink/index.tsx @@ -0,0 +1,22 @@ +// components/SmoothScrollLink.tsx +import React from 'react'; +import { ScrollLinkProps } from '../../types/props'; + + +const SmoothScrollLink: React.FC = ({ to, children }) => { + const handleClick = (event: React.MouseEvent) => { + event.preventDefault(); + const targetElement = document.querySelector(to); + if (targetElement) { + targetElement.scrollIntoView({ behavior: 'smooth' }); + } + }; + + return ( + + {children} + + ); +}; + +export default SmoothScrollLink; diff --git a/src/pages/shop/section/intro/Intro.tsx b/src/pages/shop/section/intro/Intro.tsx index 497499d..53bda0f 100644 --- a/src/pages/shop/section/intro/Intro.tsx +++ b/src/pages/shop/section/intro/Intro.tsx @@ -1,6 +1,7 @@ import Button from "../../../../components/button"; import Rocket3D from "../../../../assets/ui/Rocket.png"; +import SmoothScrollLink from "../../../../components/scrollLink"; const Intro = () => { return ( @@ -15,7 +16,9 @@ const Intro = () => {

سال ها تجربه پشت یک کانفیگ شماست

- + + +
{ }, }); return ( -
+
-

- برای انتخاب پلن مورد نظر کلیک کنید تا پلن و سرویس ها براتون نمایش داده +

+ برای انتخاب سرویس مورد نظر کلیک کنید تا براتون نمایش داده شود