skeletons, tournament stats, polish, bug fixes
This commit is contained in:
@@ -3,6 +3,8 @@ import { tournamentQueries } from '@/features/tournaments/queries';
|
||||
import Profile from '@/features/tournaments/components/profile';
|
||||
import { z } from "zod";
|
||||
import { prefetchServerQuery } from '@/lib/tanstack-query/utils/prefetch';
|
||||
import { Suspense } from 'react';
|
||||
import ProfileSkeleton from '@/features/tournaments/components/profile/skeleton';
|
||||
|
||||
const searchSchema = z.object({
|
||||
tab: z.string().optional(),
|
||||
@@ -10,9 +12,9 @@ const searchSchema = z.object({
|
||||
|
||||
export const Route = createFileRoute('/_authed/tournaments/$tournamentId')({
|
||||
validateSearch: searchSchema,
|
||||
beforeLoad: async ({ context, params }) => {
|
||||
beforeLoad: ({ context, params }) => {
|
||||
const { queryClient } = context;
|
||||
await prefetchServerQuery(queryClient, tournamentQueries.details(params.tournamentId))
|
||||
prefetchServerQuery(queryClient, tournamentQueries.details(params.tournamentId))
|
||||
},
|
||||
loader: ({ params, context }) => ({
|
||||
header: {
|
||||
@@ -28,5 +30,7 @@ export const Route = createFileRoute('/_authed/tournaments/$tournamentId')({
|
||||
|
||||
function RouteComponent() {
|
||||
const tournamentId = Route.useParams().tournamentId;
|
||||
return <Profile id={tournamentId} />
|
||||
return <Suspense fallback={<ProfileSkeleton />}>
|
||||
<Profile id={tournamentId} />
|
||||
</Suspense>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user