refactor(hero-section): 替换SealButton为Button组件并简化点击追踪

移除SealButton组件,使用更通用的Button组件替代
删除冗余的trackServiceInterest调用,简化点击事件追踪
This commit was merged in pull request #14.
This commit is contained in:
张翔
2026-04-23 21:30:52 +08:00
parent 5ed6ee4c76
commit 9650e56dcf
+7 -11
View File
@@ -3,12 +3,13 @@
import { useEffect, useState } from 'react';
import { motion } from 'framer-motion';
import { StaticLink } from '@/components/ui/static-link';
import { RippleButton, SealButton } from '@/components/ui/ripple-button';
import { RippleButton } from '@/components/ui/ripple-button';
import { Button } from '@/components/ui/button';
import { MagneticButton, BlurReveal, CounterWithEffect } from '@/lib/animations';
import { COMPANY_INFO, STATS } from '@/lib/constants';
import { ArrowRight, Shield, Zap, Award } from 'lucide-react';
import { useReducedMotion } from '@/hooks/use-reduced-motion';
import { trackButtonClick, trackServiceInterest } from '@/lib/analytics';
import { trackButtonClick } from '@/lib/analytics';
interface HeroContentProps {
isVisible: boolean;
@@ -95,11 +96,6 @@ export function HeroDescription(_props: HeroContentProps) {
export function HeroButtons({ isVisible }: HeroContentProps) {
const shouldReduceMotion = useReducedMotion();
const handleConsultClick = () => {
trackButtonClick('consult_now', 'hero_section');
trackServiceInterest('consultation');
};
const handleLearnMoreClick = () => {
trackButtonClick('learn_more', 'hero_section');
scrollTo('about');
@@ -113,12 +109,12 @@ export function HeroButtons({ isVisible }: HeroContentProps) {
className="flex flex-col sm:flex-row items-center justify-center gap-4 mb-8"
>
<MagneticButton strength={0.4}>
<StaticLink href="/contact" onClick={handleConsultClick}>
<SealButton size="lg" className="min-w-45">
<Button size="lg" className="min-w-45 bg-[#C41E3A] hover:bg-[#A01830] text-white shadow-[0_6px_20px_rgba(196,30,58,0.3)]" asChild>
<StaticLink href="/contact">
<ArrowRight className="w-4 h-4 ml-2" />
</SealButton>
</StaticLink>
</StaticLink>
</Button>
</MagneticButton>
<MagneticButton strength={0.4}>
<RippleButton