refactor: 精简首页和项目列表页,移除重复内容
- 首页删除"按标签浏览"区块,功能与项目列表页重复 - 项目列表页删除顶部标题、副标题及装饰元素 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import { getProjects, getAllTags } from '@/hooks/useProjects'
|
||||
import { getProjects } from '@/hooks/useProjects'
|
||||
import { ProjectList } from '@/components/project/ProjectList'
|
||||
import { TagCloud } from '@/components/project/TagCloud'
|
||||
import { SearchBar } from '@/components/search/SearchBar'
|
||||
import { Suspense } from 'react'
|
||||
|
||||
@@ -14,10 +13,7 @@ export default async function HomePage({ params }: HomePageProps) {
|
||||
const t = await getTranslations('home')
|
||||
const tCommon = await getTranslations('common')
|
||||
|
||||
const [projectsData, tags] = await Promise.all([
|
||||
getProjects({ limit: 6 }),
|
||||
getAllTags(),
|
||||
])
|
||||
const projectsData = await getProjects({ limit: 6 })
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -42,14 +38,6 @@ export default async function HomePage({ params }: HomePageProps) {
|
||||
</Suspense>
|
||||
</section>
|
||||
|
||||
{/* Browse by Tags Section */}
|
||||
<section className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-16">
|
||||
<h2 className="font-display text-xl font-bold mb-6 border-b-2 border-black dark:border-gray-700 pb-2 inline-block">
|
||||
{t('browseByTagsSection')}
|
||||
</h2>
|
||||
<TagCloud tags={tags} locale={locale} />
|
||||
</section>
|
||||
|
||||
{/* Featured Projects Section */}
|
||||
<section className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pb-24">
|
||||
<div className="flex items-end justify-between mb-8">
|
||||
|
||||
@@ -29,22 +29,7 @@ export default async function ProjectsPage({
|
||||
])
|
||||
|
||||
return (
|
||||
<main className="container mx-auto px-4 py-12 md:py-16 max-w-7xl relative">
|
||||
{/* Decorative shapes */}
|
||||
<div className="absolute top-10 left-0 w-24 h-24 border-2 border-black dark:border-white/20 rounded-full opacity-20 pointer-events-none hidden lg:block"></div>
|
||||
<div className="absolute top-20 right-10 w-32 h-20 border-2 border-black dark:border-white/20 rounded-[2rem] opacity-20 pointer-events-none transform rotate-12 hidden lg:block"></div>
|
||||
|
||||
{/* Page Header */}
|
||||
<div className="text-center mb-16 relative z-10">
|
||||
<h1 className="font-display text-5xl md:text-7xl font-bold mb-6 leading-tight tracking-tighter">
|
||||
PROJECT <br className="md:hidden" />NAVIGATOR
|
||||
</h1>
|
||||
<p className="text-lg md:text-xl text-gray-600 dark:text-gray-300 max-w-2xl mx-auto font-light leading-relaxed">
|
||||
Discover and explore high-quality AI projects from across the web. <br className="hidden md:inline" />
|
||||
Curated for developers and enthusiasts.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<main className="container mx-auto px-4 py-12 md:py-16 max-w-7xl">
|
||||
{/* Search and Filter Section */}
|
||||
<div className="bg-surface-light dark:bg-surface-dark border-2 border-black dark:border-white/20 p-6 md:p-8 mb-12 shadow-neo dark:shadow-none">
|
||||
<Suspense fallback={<div className="h-20"></div>}>
|
||||
|
||||
Reference in New Issue
Block a user