working but sheet styling is ugly
This commit is contained in:
@@ -16,6 +16,7 @@ import { Route as AuthedRouteImport } from './routes/_authed'
|
||||
import { Route as AuthedIndexRouteImport } from './routes/_authed/index'
|
||||
import { Route as AuthedStatsRouteImport } from './routes/_authed/stats'
|
||||
import { Route as AuthedSettingsRouteImport } from './routes/_authed/settings'
|
||||
import { Route as AuthedBadgesRouteImport } from './routes/_authed/badges'
|
||||
import { Route as AuthedAdminRouteImport } from './routes/_authed/admin'
|
||||
import { Route as AuthedTournamentsIndexRouteImport } from './routes/_authed/tournaments/index'
|
||||
import { Route as AuthedAdminIndexRouteImport } from './routes/_authed/admin/index'
|
||||
@@ -76,6 +77,11 @@ const AuthedSettingsRoute = AuthedSettingsRouteImport.update({
|
||||
path: '/settings',
|
||||
getParentRoute: () => AuthedRoute,
|
||||
} as any)
|
||||
const AuthedBadgesRoute = AuthedBadgesRouteImport.update({
|
||||
id: '/badges',
|
||||
path: '/badges',
|
||||
getParentRoute: () => AuthedRoute,
|
||||
} as any)
|
||||
const AuthedAdminRoute = AuthedAdminRouteImport.update({
|
||||
id: '/admin',
|
||||
path: '/admin',
|
||||
@@ -215,6 +221,7 @@ export interface FileRoutesByFullPath {
|
||||
'/logout': typeof LogoutRoute
|
||||
'/refresh-session': typeof RefreshSessionRoute
|
||||
'/admin': typeof AuthedAdminRouteWithChildren
|
||||
'/badges': typeof AuthedBadgesRoute
|
||||
'/settings': typeof AuthedSettingsRoute
|
||||
'/stats': typeof AuthedStatsRoute
|
||||
'/': typeof AuthedIndexRoute
|
||||
@@ -247,6 +254,7 @@ export interface FileRoutesByTo {
|
||||
'/login': typeof LoginRoute
|
||||
'/logout': typeof LogoutRoute
|
||||
'/refresh-session': typeof RefreshSessionRoute
|
||||
'/badges': typeof AuthedBadgesRoute
|
||||
'/settings': typeof AuthedSettingsRoute
|
||||
'/stats': typeof AuthedStatsRoute
|
||||
'/': typeof AuthedIndexRoute
|
||||
@@ -282,6 +290,7 @@ export interface FileRoutesById {
|
||||
'/logout': typeof LogoutRoute
|
||||
'/refresh-session': typeof RefreshSessionRoute
|
||||
'/_authed/admin': typeof AuthedAdminRouteWithChildren
|
||||
'/_authed/badges': typeof AuthedBadgesRoute
|
||||
'/_authed/settings': typeof AuthedSettingsRoute
|
||||
'/_authed/stats': typeof AuthedStatsRoute
|
||||
'/_authed/': typeof AuthedIndexRoute
|
||||
@@ -317,6 +326,7 @@ export interface FileRouteTypes {
|
||||
| '/logout'
|
||||
| '/refresh-session'
|
||||
| '/admin'
|
||||
| '/badges'
|
||||
| '/settings'
|
||||
| '/stats'
|
||||
| '/'
|
||||
@@ -349,6 +359,7 @@ export interface FileRouteTypes {
|
||||
| '/login'
|
||||
| '/logout'
|
||||
| '/refresh-session'
|
||||
| '/badges'
|
||||
| '/settings'
|
||||
| '/stats'
|
||||
| '/'
|
||||
@@ -383,6 +394,7 @@ export interface FileRouteTypes {
|
||||
| '/logout'
|
||||
| '/refresh-session'
|
||||
| '/_authed/admin'
|
||||
| '/_authed/badges'
|
||||
| '/_authed/settings'
|
||||
| '/_authed/stats'
|
||||
| '/_authed/'
|
||||
@@ -481,6 +493,13 @@ declare module '@tanstack/react-router' {
|
||||
preLoaderRoute: typeof AuthedSettingsRouteImport
|
||||
parentRoute: typeof AuthedRoute
|
||||
}
|
||||
'/_authed/badges': {
|
||||
id: '/_authed/badges'
|
||||
path: '/badges'
|
||||
fullPath: '/badges'
|
||||
preLoaderRoute: typeof AuthedBadgesRouteImport
|
||||
parentRoute: typeof AuthedRoute
|
||||
}
|
||||
'/_authed/admin': {
|
||||
id: '/_authed/admin'
|
||||
path: '/admin'
|
||||
@@ -687,6 +706,7 @@ const AuthedAdminRouteWithChildren = AuthedAdminRoute._addFileChildren(
|
||||
|
||||
interface AuthedRouteChildren {
|
||||
AuthedAdminRoute: typeof AuthedAdminRouteWithChildren
|
||||
AuthedBadgesRoute: typeof AuthedBadgesRoute
|
||||
AuthedSettingsRoute: typeof AuthedSettingsRoute
|
||||
AuthedStatsRoute: typeof AuthedStatsRoute
|
||||
AuthedIndexRoute: typeof AuthedIndexRoute
|
||||
@@ -699,6 +719,7 @@ interface AuthedRouteChildren {
|
||||
|
||||
const AuthedRouteChildren: AuthedRouteChildren = {
|
||||
AuthedAdminRoute: AuthedAdminRouteWithChildren,
|
||||
AuthedBadgesRoute: AuthedBadgesRoute,
|
||||
AuthedSettingsRoute: AuthedSettingsRoute,
|
||||
AuthedStatsRoute: AuthedStatsRoute,
|
||||
AuthedIndexRoute: AuthedIndexRoute,
|
||||
|
||||
33
src/app/routes/_authed/badges.tsx
Normal file
33
src/app/routes/_authed/badges.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import BadgeStatsTable from '@/features/badges/components/badge-stats-table';
|
||||
import { badgeQueries, useAllBadges } from '@/features/badges/queries';
|
||||
import PlayerStatsTableSkeleton from '@/features/players/components/player-stats-table-skeleton';
|
||||
import { prefetchServerQuery } from '@/lib/tanstack-query/utils/prefetch';
|
||||
import { createFileRoute } from '@tanstack/react-router';
|
||||
import { Suspense } from 'react';
|
||||
|
||||
export const Route = createFileRoute('/_authed/badges')({
|
||||
component: Badges,
|
||||
beforeLoad: ({ context }) => {
|
||||
const queryClient = context.queryClient;
|
||||
prefetchServerQuery(queryClient, badgeQueries.allBadges());
|
||||
},
|
||||
loader: () => ({
|
||||
withPadding: false,
|
||||
fullWidth: true,
|
||||
header: {
|
||||
title: 'All Badges',
|
||||
},
|
||||
refresh: [badgeQueries.allBadges().queryKey],
|
||||
}),
|
||||
});
|
||||
|
||||
function Badges() {
|
||||
//TODO: CHANGE FALLBACK
|
||||
return (
|
||||
<Suspense fallback={<PlayerStatsTableSkeleton />}>
|
||||
<div>
|
||||
<BadgeStatsTable />
|
||||
</div>
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user