refactor: P1 - remove unused legacy components

- Delete old homepage components
- Delete unused UI components
This commit is contained in:
张翔
2026-04-30 22:04:07 +08:00
parent fe6e4b1c54
commit f513d9da20
15 changed files with 0 additions and 2140 deletions
-122
View File
@@ -1,122 +0,0 @@
"use client";
import { useEffect } from 'react';
import { useSearchParams } from 'next/navigation';
import dynamic from 'next/dynamic';
import { HeroSection } from "@/components/sections/hero-section";
import { SectionSkeleton } from "@/components/ui/loading-skeleton";
import type { ReactNode } from 'react';
declare global {
interface Window {
__isProgrammaticScroll?: boolean;
}
}
const ServicesSection = dynamic(
() => import('@/components/sections/services-section').then(mod => ({ default: mod.ServicesSection })),
{
loading: () => <SectionSkeleton />,
ssr: false
}
);
const HomeSolutionsSection = dynamic(
() => import('@/components/sections/home-solutions-section').then(mod => ({ default: mod.HomeSolutionsSection })),
{
loading: () => <SectionSkeleton />,
ssr: false
}
);
const ProductsSection = dynamic(
() => import('@/components/sections/products-section').then(mod => ({ default: mod.ProductsSection })),
{
loading: () => <SectionSkeleton />,
ssr: false
}
);
const CasesSection = dynamic(
() => import('@/components/sections/cases-section').then(mod => ({ default: mod.CasesSection })),
{
loading: () => <SectionSkeleton />,
ssr: false
}
);
const AboutSection = dynamic(
() => import('@/components/sections/about-section').then(mod => ({ default: mod.AboutSection })),
{
loading: () => <SectionSkeleton />,
ssr: false
}
);
const TeamSection = dynamic(
() => import('@/components/sections/team-section').then(mod => ({ default: mod.TeamSection })),
{
loading: () => <SectionSkeleton />,
ssr: false
}
);
const NewsSection = dynamic(
() => import('@/components/sections/news-section').then(mod => ({ default: mod.NewsSection })),
{
loading: () => <SectionSkeleton />,
ssr: false
}
);
function HomeContent({ heroStats }: { heroStats: ReactNode }) {
const searchParams = useSearchParams();
useEffect(() => {
const section = searchParams.get('section');
if (!section) {return;}
const maxAttempts = 50;
const interval = 100;
let attempts = 0;
const scrollToSection = () => {
const targetElement = document.getElementById(section);
if (targetElement) {
window.__isProgrammaticScroll = true;
targetElement.scrollIntoView({ behavior: 'smooth', block: 'start' });
setTimeout(() => {
window.__isProgrammaticScroll = false;
}, 2000);
return true;
}
return false;
};
if (scrollToSection()) {return;}
const timer = setInterval(() => {
attempts++;
if (scrollToSection() || attempts >= maxAttempts) {
clearInterval(timer);
}
}, interval);
return () => clearInterval(timer);
}, [searchParams]);
return (
<main id="main-content" className="min-h-screen bg-white dark:bg-(--color-bg-primary)">
<HeroSection heroStats={heroStats} />
<ServicesSection />
<HomeSolutionsSection />
<ProductsSection />
<CasesSection />
<AboutSection />
<TeamSection />
<NewsSection />
</main>
);
}
export { HomeContent };