@@ -18,6 +18,7 @@ import { Link } from "../components/Link";
1818import { PageHeading } from "../components/PageHeader" ;
1919import { Tooltip , TooltipContent , TooltipTrigger } from "../components/Tooltip" ;
2020import { getFilterValues , getSearchParamsFromValues } from "../filterUtils" ;
21+ import useAuth from "../useAuth" ;
2122import { capStr } from "../util" ;
2223
2324type ExpandedSectionProps = {
@@ -130,6 +131,8 @@ export function Leaderboard() {
130131 const [ searchParams ] = useSearchParams ( ) ;
131132 const values = getFilterValues ( searchParams ) ;
132133 const [ selectedUser , setSelectedUser ] = useState < User | null > ( null ) ;
134+ const [ includeDisabled , setIncludeDisabled ] = useState ( false ) ;
135+ const { user } = useAuth ( ) ;
133136
134137 const { data : leaderboardRows } = useQuery < LeaderboardRow [ ] > ( {
135138 queryKey : [
@@ -138,13 +141,15 @@ export function Leaderboard() {
138141 values . faction ,
139142 values . format ,
140143 values . tags ,
144+ includeDisabled ,
141145 ] ,
142146 queryFn : ( ) =>
143147 LeaderboardService . getGetLeaderboard (
144148 values . seasonId ,
145149 values . faction ,
146150 values . format ,
147151 values . tags ,
152+ includeDisabled ,
148153 ) ,
149154 } ) ;
150155
@@ -201,6 +206,25 @@ export function Leaderboard() {
201206 </ h1 >
202207 ) }
203208 </ PageHeading >
209+ { user ?. is_admin && (
210+ < div className = { "mb-4 flex items-center gap-2 px-4" } >
211+ < input
212+ type = "checkbox"
213+ id = "includeDisabled"
214+ checked = { includeDisabled }
215+ onChange = { ( e ) => setIncludeDisabled ( e . target . checked ) }
216+ className = {
217+ "h-4 w-4 cursor-pointer rounded border-gray-600 bg-gray-900 text-cyan-500 focus:ring-2 focus:ring-cyan-500"
218+ }
219+ />
220+ < label
221+ htmlFor = "includeDisabled"
222+ className = { "cursor-pointer text-gray-300 text-sm" }
223+ >
224+ Show all users (including disabled accounts)
225+ </ label >
226+ </ div >
227+ ) }
204228 < FilterSection hasSearchBar = { true } startSeason = { 3 } />
205229 < table
206230 className = {
@@ -277,9 +301,7 @@ export function Leaderboard() {
277301 ) }
278302 >
279303 { row . disabled ? (
280- < text className = "text-gray-500 opacity-30" >
281- { row . user_name }
282- </ text >
304+ < text className = "text-gray-500" > { row . user_name } </ text >
283305 ) : (
284306 < Link to = { getLinkToUserSearchParams ( row ) } >
285307 { row . user_name }
0 commit comments