From 392579da40e9b50f2e6dc8040ef830bb251e4ad6 Mon Sep 17 00:00:00 2001 From: Clemens Beese Date: Thu, 17 Sep 2026 12:38:42 +0200 Subject: [PATCH] spacing cleanup, fjerne skuespillere --- src/components/Section.css | 8 ++++++++ src/components/Section.tsx | 5 +++-- src/layout/MainLayout.tsx | 9 +++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/components/Section.css b/src/components/Section.css index e5f7649..b9490ed 100644 --- a/src/components/Section.css +++ b/src/components/Section.css @@ -1,3 +1,11 @@ +.section { + margin-bottom: 3rem; +} + +.section > h2 { + margin: 0 0 1rem; +} + .section-skeleton { border-radius: 0.5rem; background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%); diff --git a/src/components/Section.tsx b/src/components/Section.tsx index 5e347b4..e925728 100644 --- a/src/components/Section.tsx +++ b/src/components/Section.tsx @@ -1,5 +1,6 @@ // denne filen eier overskrift + laster/feil-håndtering, tar innholdet som 'children': +import './Section.css'; import type { ReactNode } from 'react'; type SectionProps = { @@ -13,8 +14,8 @@ type SectionProps = { export function Section({ id, title, isLoading, error, children, skeletonHeight="300px"}: SectionProps) { return ( -
-

{title}

+
+ {title &&

{title}

} {isLoading &&
} {error &&

Noe gikk galt: {error.message}

} {!isLoading && !error && children} diff --git a/src/layout/MainLayout.tsx b/src/layout/MainLayout.tsx index 0e95337..a5618f6 100644 --- a/src/layout/MainLayout.tsx +++ b/src/layout/MainLayout.tsx @@ -1,9 +1,9 @@ import { MovieList } from "../components/MovieList"; -import { PersonList } from "../components/PersonList"; + import { Section } from "../components/Section"; import { TrendingPreview } from "../components/TrendingPreview"; import { useCurMovies, usePopMovies } from "../hooks/useMovies"; -import { usePopularPeople } from "../hooks/usePeople"; + import type { Movie } from "../types/tmdb"; import { sortAndFilterMovies, type SortOption } from "../utils/sortAndFilterMovies"; @@ -19,7 +19,7 @@ type MainLayoutProps = { export function MainLayout({ sortBy, minRating, isFavorite, toggleFavorite, onSelectMovie }: MainLayoutProps) { const popular = usePopMovies(); const current = useCurMovies(); - const people = usePopularPeople(); + return ( <> @@ -32,9 +32,6 @@ export function MainLayout({ sortBy, minRating, isFavorite, toggleFavorite, onSe
{current.data && }
-
- {people.data && } -
); } \ No newline at end of file