settings link, uneroll team server fn

This commit is contained in:
yohlo
2025-08-24 00:35:38 -05:00
parent 53276cc18e
commit 324e1742f1
9 changed files with 112 additions and 14 deletions

View File

@@ -12,10 +12,11 @@ export const Route = createFileRoute("/_authed/profile/$playerId")({
player
}
},
loader: ({ params }) => ({
loader: ({ params, context }) => ({
header: {
collapsed: true,
withBackButton: true
withBackButton: true,
settingsLink: context?.auth.user.id === params.playerId ? 'settings' : undefined
},
refresh: {
toRefresh: [playerQueries.details(params.playerId).queryKey],

View File

@@ -13,10 +13,11 @@ export const Route = createFileRoute('/_authed/tournaments/$tournamentId')({
const { queryClient } = context;
await queryClient.ensureQueryData(tournamentQueries.details(params.tournamentId))
},
loader: ({ params }) => ({
loader: ({ params, context }) => ({
header: {
collapsed: true,
withBackButton: true
withBackButton: true,
settingsLink: context.auth.roles.includes("Admin") ? `/admin/tournaments/${params.tournamentId}` : undefined
},
refresh: {
toRefresh: tournamentQueries.details(params.tournamentId).queryKey,