From 585094dd240fbce26cff42b9b50dc7147d4d4fc8 Mon Sep 17 00:00:00 2001 From: ner Date: Wed, 20 Mar 2024 16:01:25 +0200 Subject: [PATCH] fix: navigation --- .../Header/components/Navigation/index.tsx | 2 +- components/Header/index.tsx | 22 ++++++----- components/Movie/List.tsx | 24 +++++++----- .../Movie/Preview/components/Actions.tsx | 5 ++- components/Movie/Preview/index.tsx | 2 +- .../Movie/components/Torrents/index.tsx | 23 +++++++++-- components/ui/toggle.tsx | 38 ++++++++----------- lib/api/index.ts | 4 +- styles/index.css | 3 +- 9 files changed, 73 insertions(+), 50 deletions(-) diff --git a/components/Header/components/Navigation/index.tsx b/components/Header/components/Navigation/index.tsx index 84d4b66..a5b67a3 100644 --- a/components/Header/components/Navigation/index.tsx +++ b/components/Header/components/Navigation/index.tsx @@ -9,7 +9,7 @@ export default function Navigation() { const path = usePathname(); return ( - + {[ { path: '/', title: 'Random' }, diff --git a/components/Header/index.tsx b/components/Header/index.tsx index 29969f8..1fbcb2f 100644 --- a/components/Header/index.tsx +++ b/components/Header/index.tsx @@ -8,17 +8,21 @@ import ToggleSearch from './components/Search'; import ToggleTheme from './components/ThemeToggle'; const Header: FC = () => ( -
-
- - Movie advisor - -
- - +
+
+
+ + Movie advisor + +
+ +
+
+ + +
-
); diff --git a/components/Movie/List.tsx b/components/Movie/List.tsx index 324a21a..2858524 100644 --- a/components/Movie/List.tsx +++ b/components/Movie/List.tsx @@ -64,16 +64,20 @@ const List: FC = ({ pages, hasNextPage, fetchNextPage, withBottomGap = tr > {pages.map((page) => ( - {filterUnknownMovies(page.results)?.map((movie, index, array) => ( - setLoader(element!)} - > - setMovie(movie)} /> - - ))} + {filterUnknownMovies(page.results)?.map((movie, index, array) => { + const isAnchor = Math.round(array.length / 2) === index; + + return ( + setLoader(element!) : undefined} + > + setMovie(movie)} /> + + ); + })} ))} diff --git a/components/Movie/Preview/components/Actions.tsx b/components/Movie/Preview/components/Actions.tsx index 55e02e0..536af62 100644 --- a/components/Movie/Preview/components/Actions.tsx +++ b/components/Movie/Preview/components/Actions.tsx @@ -16,7 +16,10 @@ export default function Actions({ onClose, movie }: Props) { return ( <> -