From 686a02b23396047cefd51395ee41628e0c17f172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BF=94?= Date: Thu, 26 Feb 2026 21:24:38 +0800 Subject: [PATCH] refactor: remove modal, add link navigation for services --- src/components/sections/services-section.tsx | 54 +++++++++----------- 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/src/components/sections/services-section.tsx b/src/components/sections/services-section.tsx index d12b266..537679e 100644 --- a/src/components/sections/services-section.tsx +++ b/src/components/sections/services-section.tsx @@ -2,12 +2,12 @@ import { motion } from 'framer-motion'; import { useInView } from 'framer-motion'; -import { useRef, useState } from 'react'; +import { useRef } from 'react'; +import Link from 'next/link'; import { Code, Cloud, BarChart3, Shield, ArrowRight } from 'lucide-react'; import { Card, CardContent } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { SERVICES } from '@/lib/constants'; -import { ServiceDetailModal } from '@/components/services/service-detail-modal'; const iconMap: Record> = { Code, @@ -19,17 +19,10 @@ const iconMap: Record> = { export function ServicesSection() { const ref = useRef(null); const isInView = useInView(ref, { once: true, margin: '-100px' }); - const [selectedServiceId, setSelectedServiceId] = useState(null); - const [isModalOpen, setIsModalOpen] = useState(false); - - const handleServiceClick = (serviceId: string) => { - setSelectedServiceId(serviceId); - setIsModalOpen(true); - }; return (
-
+
@@ -57,17 +50,22 @@ export function ServicesSection() { whileInView={{ opacity: 1, y: 0 }} viewport={{ once: true }} transition={{ duration: 0.5, delay: index * 0.1 }} - onClick={() => handleServiceClick(service.id)} > - - -
- {Icon && } -
-

{service.title}

-

{service.description}

-
-
+ + + +
+ {Icon && } +
+

{service.title}

+

{service.description}

+
+ 了解详情 + +
+
+
+ ); })} @@ -79,20 +77,14 @@ export function ServicesSection() { transition={{ duration: 0.6, delay: 0.4 }} className="text-center mt-12" > -
- - {selectedServiceId && ( - - )}
); }