From 0f5c73c1832fc985b4ce8d3291d5e58455327536 Mon Sep 17 00:00:00 2001 From: ner Date: Sat, 19 Jul 2025 12:16:35 +0300 Subject: [PATCH] fix: favourites pages -> clien side --- .../components/UsersLists/index.tsx | 4 ++-- app/(site)/(favorites)/favorites/page.tsx | 21 ++----------------- app/(site)/(favorites)/watchlist/page.tsx | 19 +---------------- tailwind.config.js | 2 +- 4 files changed, 6 insertions(+), 40 deletions(-) diff --git a/app/(site)/(favorites)/components/UsersLists/index.tsx b/app/(site)/(favorites)/components/UsersLists/index.tsx index 798c11e..af3a6b5 100644 --- a/app/(site)/(favorites)/components/UsersLists/index.tsx +++ b/app/(site)/(favorites)/components/UsersLists/index.tsx @@ -13,7 +13,7 @@ interface Props { } const UsersList: FC = ({ list, label, session }) => { - const movies = useUsersShows({ list, showType: 'movie', session }); + const movies = useUsersShows({ list, showType: 'movie', session, mode: 'default' }); const series = useUsersShows({ list, showType: 'tv', session, mode: 'default' }); const tabs = [ @@ -23,7 +23,7 @@ const UsersList: FC = ({ list, label, session }) => { return ( - + {tabs.map(({ title, key }) => ( {title} diff --git a/app/(site)/(favorites)/favorites/page.tsx b/app/(site)/(favorites)/favorites/page.tsx index fd7f0e8..241f460 100644 --- a/app/(site)/(favorites)/favorites/page.tsx +++ b/app/(site)/(favorites)/favorites/page.tsx @@ -1,10 +1,6 @@ -import { dehydrate, HydrationBoundary } from '@tanstack/react-query'; import { Metadata } from 'next'; -import { cookies } from 'next/headers'; -import usersShowsQuery from '@/data/queries/usersShows'; import { TITLE } from '@/env'; -import getQueryClient from '@/lib/queryClient'; import UsersList from '../components/UsersLists'; @@ -13,21 +9,8 @@ export const metadata: Metadata = { description: `View your favorite shows on ${TITLE}. Keep track of films you’ve added and revisit your top picks anytime.` }; -const Favorites = async () => { - const session = cookies().get('session')?.value; - const queryClient = getQueryClient(); - - const list = 'favorite'; - - if (session) { - await queryClient.prefetchInfiniteQuery(usersShowsQuery({ showType: 'movie', session, list })); - } - - return ( - - - - ); +const Favorites = () => { + return ; }; export default Favorites; diff --git a/app/(site)/(favorites)/watchlist/page.tsx b/app/(site)/(favorites)/watchlist/page.tsx index 4951ee5..a88e913 100644 --- a/app/(site)/(favorites)/watchlist/page.tsx +++ b/app/(site)/(favorites)/watchlist/page.tsx @@ -1,10 +1,6 @@ -import { dehydrate, HydrationBoundary } from '@tanstack/react-query'; import { Metadata } from 'next'; -import { cookies } from 'next/headers'; -import usersShowsQuery from '@/data/queries/usersShows'; import { TITLE } from '@/env'; -import getQueryClient from '@/lib/queryClient'; import UsersList from '../components/UsersLists'; @@ -14,20 +10,7 @@ export const metadata: Metadata = { }; const WatchList = async () => { - const session = cookies().get('session')?.value; - const queryClient = getQueryClient(); - - const list = 'watchlist'; - - if (session) { - await queryClient.prefetchInfiniteQuery(usersShowsQuery({ showType: 'movie', session, list })); - } - - return ( - - - - ); + return ; }; export default WatchList; diff --git a/tailwind.config.js b/tailwind.config.js index 7c52820..6f85bf3 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -64,7 +64,7 @@ module.exports = { to: { height: 0 } }, fadeInSlideIn: { - '0%': { opacity: 0, transform: 'translate3d(0, -30px, 0)' }, + '0%': { opacity: 0, transform: 'translate3d(0, 30px, 0)' }, '100%': { opacity: 1, transform: 'translate3d(0, 0, 0)' } }, fadeAsideSlideIn: {