refactoring: first render improvements

This commit is contained in:
ner committed 2024-10-21 18:57:49 +03:00
1 parent 38aebcbe28
commit 0cface89bf
13 files changed
+38 -33

No files matched your search

+2 -2
View File
@@ -5,10 +5,10 @@ import getQueryClient from '@/lib/queryClient';
import Container from './container';
const Random = async () => {
const Random = () => {
const queryClient = getQueryClient();
await queryClient.prefetchInfiniteQuery({
queryClient.prefetchInfiniteQuery({
queryKey: ['random-movie'],
queryFn: randomMovies,
initialPageParam: '1'
+2 -2
View File
@@ -12,10 +12,10 @@ export const metadata: Metadata = {
'Check out the most popular movies right now on Movie Advisor. See what’s trending and don’t miss out on the latest hits.'
};
const Popular = async () => {
const Popular = () => {
const queryClient = getQueryClient();
await queryClient.prefetchInfiniteQuery({
queryClient.prefetchInfiniteQuery({
queryKey: ['popular'],
queryFn: () => popularMovies(),
initialPageParam: '1'
+2 -2
View File
@@ -5,12 +5,12 @@ import getQueryClient from '@/lib/queryClient';
import Container from './container';
const Similar = async ({ searchParams }: { searchParams: Record<string, string> }) => {
const Similar = ({ searchParams }: { searchParams: Record<string, string> }) => {
const queryClient = getQueryClient();
const { id, type } = searchParams || {};
await queryClient.prefetchInfiniteQuery({
queryClient.prefetchInfiniteQuery({
queryKey: ['similar', id, type],
queryFn: () => similarShows({ showId: id, showType: type as Show['type'] }),
initialPageParam: '1'
+2 -2
View File
@@ -5,12 +5,12 @@ import getQueryClient from '@/lib/queryClient';
import Container from './container';
const Starring = async ({ searchParams }: { searchParams: Record<string, string> }) => {
const Starring = ({ searchParams }: { searchParams: Record<string, string> }) => {
const queryClient = getQueryClient();
const { actorId } = searchParams || {};
await queryClient.prefetchInfiniteQuery({
queryClient.prefetchInfiniteQuery({
queryKey: ['starring', actorId],
queryFn: () => topMovies({ starring: actorId }),
initialPageParam: '1'
+2 -2
View File
@@ -12,10 +12,10 @@ export const metadata: Metadata = {
'Discover the top-rated movies on Movie Advisor. Find the highest-rated films and make informed viewing choices.'
};
const Top = async () => {
const Top = () => {
const queryClient = getQueryClient();
await queryClient.prefetchInfiniteQuery({
queryClient.prefetchInfiniteQuery({
queryKey: ['top'],
queryFn: () => topMovies(),
initialPageParam: '1'