Skip to content

Commit 12b93b9

Browse files
committed
撤回误提交到main的首页重构
1 parent db0dda2 commit 12b93b9

3 files changed

Lines changed: 9 additions & 405 deletions

File tree

‎web/src/main.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import './styles/sidebar-collapse.css'
3535
import './styles/personal-media-workspace.css'
3636
import './styles/series-detail-cinema.css'
3737
import './styles/mobile-bottom-nav.css'
38-
import './styles/home-detail-fusion.css'
3938

4039
const SW_DEV_RELOAD_KEY = 'nowen-sw-dev-cleanup-reload'
4140
const SW_UPDATE_RELOAD_KEY = 'nowen-sw-production-update-reload'

‎web/src/pages/HomePage.tsx‎

Lines changed: 9 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ function getContinueArtwork(item: WatchHistory): string | null {
3131
return null
3232
}
3333

34-
function HomeSectionAction({ to, children }: { to: string; children: ReactNode }) {
35-
return (
36-
<Link to={to} className="nv-home-section-action">
37-
<span>{children}</span>
38-
<ChevronRight size={14} aria-hidden="true" />
39-
</Link>
40-
)
41-
}
42-
4334
export default function HomePage() {
4435
const { on, off } = useWebSocket()
4536
const toast = useToast()
@@ -103,11 +94,9 @@ export default function HomePage() {
10394
}, [on, off, invalidate, silentRefresh])
10495

10596
return (
106-
<div className="nv-home-page nv-home-detail-language nv-section-stack">
97+
<div className="nv-home-page nv-section-stack">
10798
{(recommendations.length > 0 || recentItems.length > 0) && (
108-
<div className="nv-home-hero-shell">
109-
<HeroCarousel items={recommendations} fallbackItems={recentItems} maxItems={5} />
110-
</div>
99+
<HeroCarousel items={recommendations} fallbackItems={recentItems} maxItems={5} />
111100
)}
112101

113102
{continueList.length > 0 && (
@@ -122,14 +111,12 @@ export default function HomePage() {
122111
<MediaRail
123112
title={(
124113
<span className="inline-flex items-center gap-2">
125-
<Sparkles size={16} className="text-[var(--nv-action-muted)]" aria-hidden="true" />
114+
<Sparkles size={16} className="text-[var(--nv-text-tertiary)]" aria-hidden="true" />
126115
{t('home.recommended')}
127116
</span>
128117
)}
129118
ariaLabel={t('home.recommended')}
130119
itemCount={recommendations.length}
131-
action={<HomeSectionAction to="/browse">查看全部</HomeSectionAction>}
132-
className="nv-home-section-card--featured"
133120
>
134121
{recommendations.map((item) => (
135122
<div key={item.media.id} className="nv-home-poster-slot flex-shrink-0">
@@ -140,19 +127,14 @@ export default function HomePage() {
140127
)}
141128

142129
{loading && recentItems.length === 0 && continueList.length === 0 && recommendations.length === 0 && (
143-
<div className="nv-section-stack nv-home-loading-stack">
130+
<div className="nv-section-stack">
144131
<HomeRailSkeleton title={t('home.continueWatching')} landscape />
145132
<HomeRailSkeleton title={t('home.recentlyAdded')} />
146133
</div>
147134
)}
148135

149136
{recentItems.length > 0 && (
150-
<MediaRail
151-
title={t('home.recentlyAdded')}
152-
ariaLabel={t('home.recentlyAdded')}
153-
itemCount={recentItems.length}
154-
action={<HomeSectionAction to="/browse?sort=created_desc">更多</HomeSectionAction>}
155-
>
137+
<MediaRail title={t('home.recentlyAdded')} ariaLabel={t('home.recentlyAdded')} itemCount={recentItems.length}>
156138
{recentItems.map((item) => {
157139
const media = item.type === 'movie' ? item.media : item.series
158140
if (!media) return null
@@ -173,7 +155,6 @@ export default function HomePage() {
173155

174156
{!loading && recentItems.length === 0 && continueList.length === 0 && (
175157
<EmptyState
176-
className="nv-home-empty-card"
177158
icon={<Play size={22} aria-hidden="true" />}
178159
title={t('home.noContent')}
179160
description={t('home.noContentHint')}
@@ -187,15 +168,11 @@ function MediaRail({
187168
title,
188169
ariaLabel,
189170
itemCount,
190-
action,
191-
className,
192171
children,
193172
}: {
194173
title: ReactNode
195174
ariaLabel: string
196175
itemCount: number
197-
action?: ReactNode
198-
className?: string
199176
children: ReactNode
200177
}) {
201178
const scrollRef = useRef<HTMLDivElement>(null)
@@ -230,11 +207,7 @@ function MediaRail({
230207
}
231208

232209
return (
233-
<Section
234-
title={title}
235-
action={action}
236-
className={`nv-home-section-card${className ? ` ${className}` : ''}`}
237-
>
210+
<Section title={title}>
238211
<div className="nv-home-rail relative">
239212
{canScrollLeft && (
240213
<Button
@@ -287,14 +260,12 @@ function ContinueWatchingRow({
287260
<MediaRail
288261
title={(
289262
<span className="inline-flex items-center gap-2">
290-
<Clock size={16} className="text-[var(--nv-action-muted)]" aria-hidden="true" />
263+
<Clock size={16} className="text-[var(--nv-text-tertiary)]" aria-hidden="true" />
291264
{title}
292265
</span>
293266
)}
294267
ariaLabel={title}
295268
itemCount={items.length}
296-
action={<HomeSectionAction to="/history">查看全部</HomeSectionAction>}
297-
className="nv-home-section-card--continue"
298269
>
299270
{items.map((item) => {
300271
const percent = formatProgress(item.position, item.duration)
@@ -348,7 +319,7 @@ function ContinueWatchingRow({
348319

349320
function HomeRailSkeleton({ title, landscape = false }: { title: string; landscape?: boolean }) {
350321
return (
351-
<Section title={title} className="nv-home-section-card nv-home-section-card--skeleton">
322+
<Section title={title}>
352323
<div className="flex gap-[var(--nv-grid-gap-x)] overflow-hidden pb-3 pt-1">
353324
{Array.from({ length: landscape ? 5 : 8 }).map((_, index) => (
354325
<div key={index} className={landscape ? 'nv-continue-card flex-shrink-0' : 'nv-home-poster-slot flex-shrink-0'}>
@@ -396,13 +367,7 @@ function GenreRows({ items }: { items: MixedItem[] }) {
396367

397368
function GenreRow({ genre, items }: { genre: string; items: MixedItem[] }) {
398369
return (
399-
<MediaRail
400-
title={genre}
401-
ariaLabel={genre}
402-
itemCount={items.length}
403-
action={<HomeSectionAction to={`/browse?genres=${encodeURIComponent(genre)}`}>更多</HomeSectionAction>}
404-
className="nv-home-section-card--genre"
405-
>
370+
<MediaRail title={genre} ariaLabel={genre} itemCount={items.length}>
406371
{items.map((item) => {
407372
const media = item.type === 'movie' ? item.media : item.series
408373
if (!media) return null

0 commit comments

Comments
 (0)