@tanstack/router-devtools 1.112.5 → 1.112.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseTanStackRouterDevtoolsPanel.cjs +12 -29
- package/dist/cjs/BaseTanStackRouterDevtoolsPanel.cjs.map +1 -1
- package/dist/cjs/BaseTanStackRouterDevtoolsPanel.d.cts +1 -3
- package/dist/cjs/Explorer.cjs +1 -1
- package/dist/cjs/Explorer.cjs.map +1 -1
- package/dist/cjs/TanStackRouterDevtools.cjs +2 -2
- package/dist/cjs/TanStackRouterDevtools.cjs.map +1 -1
- package/dist/cjs/TanStackRouterDevtoolsPanel.cjs +5 -7
- package/dist/cjs/TanStackRouterDevtoolsPanel.cjs.map +1 -1
- package/dist/cjs/TanStackRouterDevtoolsPanel.d.cts +1 -3
- package/dist/cjs/context.cjs +1 -1
- package/dist/cjs/context.cjs.map +1 -1
- package/dist/cjs/useStyles.cjs +1 -1
- package/dist/cjs/useStyles.cjs.map +1 -1
- package/dist/cjs/utils.cjs.map +1 -1
- package/dist/cjs/utils.d.cts +1 -3
- package/dist/esm/BaseTanStackRouterDevtoolsPanel.d.ts +1 -3
- package/dist/esm/BaseTanStackRouterDevtoolsPanel.js +12 -29
- package/dist/esm/BaseTanStackRouterDevtoolsPanel.js.map +1 -1
- package/dist/esm/Explorer.js +1 -1
- package/dist/esm/Explorer.js.map +1 -1
- package/dist/esm/TanStackRouterDevtools.js +2 -2
- package/dist/esm/TanStackRouterDevtools.js.map +1 -1
- package/dist/esm/TanStackRouterDevtoolsPanel.d.ts +1 -3
- package/dist/esm/TanStackRouterDevtoolsPanel.js +5 -7
- package/dist/esm/TanStackRouterDevtoolsPanel.js.map +1 -1
- package/dist/esm/context.js +1 -1
- package/dist/esm/context.js.map +1 -1
- package/dist/esm/useStyles.js +1 -1
- package/dist/esm/useStyles.js.map +1 -1
- package/dist/esm/utils.d.ts +1 -3
- package/dist/esm/utils.js.map +1 -1
- package/package.json +2 -2
- package/src/BaseTanStackRouterDevtoolsPanel.tsx +311 -322
- package/src/Explorer.tsx +1 -1
- package/src/TanStackRouterDevtools.tsx +4 -4
- package/src/TanStackRouterDevtoolsPanel.tsx +17 -18
- package/src/context.ts +1 -1
- package/src/theme.tsx +2 -2
- package/src/useStyles.tsx +1 -1
- package/src/utils.ts +31 -38
|
@@ -121,273 +121,228 @@ function RouteComp({
|
|
|
121
121
|
)
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
export const BaseTanStackRouterDevtoolsPanel =
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
shadowDOMTarget,
|
|
137
|
-
...panelProps
|
|
138
|
-
} = props
|
|
124
|
+
export const BaseTanStackRouterDevtoolsPanel = React.forwardRef<
|
|
125
|
+
HTMLDivElement,
|
|
126
|
+
DevtoolsPanelOptions
|
|
127
|
+
>(function BaseTanStackRouterDevtoolsPanel(props, ref): React.ReactElement {
|
|
128
|
+
const {
|
|
129
|
+
isOpen = true,
|
|
130
|
+
setIsOpen,
|
|
131
|
+
handleDragStart,
|
|
132
|
+
router: userRouter,
|
|
133
|
+
shadowDOMTarget,
|
|
134
|
+
...panelProps
|
|
135
|
+
} = props
|
|
139
136
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
137
|
+
const { onCloseClick } = useDevtoolsOnClose()
|
|
138
|
+
const styles = useStyles()
|
|
139
|
+
const { className, ...otherPanelProps } = panelProps
|
|
143
140
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
const contextRouter = useRouter({ warn: false })
|
|
142
|
+
const router = userRouter ?? contextRouter
|
|
143
|
+
const routerState = useRouterState({
|
|
144
|
+
router,
|
|
145
|
+
} as any)
|
|
149
146
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
147
|
+
invariant(
|
|
148
|
+
router,
|
|
149
|
+
'No router was found for the TanStack Router Devtools. Please place the devtools in the <RouterProvider> component tree or pass the router instance to the devtools manually.',
|
|
150
|
+
)
|
|
154
151
|
|
|
155
|
-
|
|
152
|
+
// useStore(router.__store)
|
|
156
153
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
154
|
+
const [showMatches, setShowMatches] = useLocalStorage(
|
|
155
|
+
'tanstackRouterDevtoolsShowMatches',
|
|
156
|
+
true,
|
|
157
|
+
)
|
|
161
158
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
159
|
+
const [activeId, setActiveId] = useLocalStorage(
|
|
160
|
+
'tanstackRouterDevtoolsActiveRouteId',
|
|
161
|
+
'',
|
|
162
|
+
)
|
|
166
163
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
164
|
+
const activeMatch = React.useMemo(() => {
|
|
165
|
+
const matches = [
|
|
166
|
+
...(routerState.pendingMatches ?? []),
|
|
167
|
+
...routerState.matches,
|
|
168
|
+
...routerState.cachedMatches,
|
|
169
|
+
]
|
|
170
|
+
return matches.find((d) => d.routeId === activeId || d.id === activeId)
|
|
171
|
+
}, [
|
|
172
|
+
activeId,
|
|
173
|
+
routerState.cachedMatches,
|
|
174
|
+
routerState.matches,
|
|
175
|
+
routerState.pendingMatches,
|
|
176
|
+
])
|
|
180
177
|
|
|
181
|
-
|
|
178
|
+
const hasSearch = Object.keys(routerState.location.search).length
|
|
182
179
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
180
|
+
const explorerState = {
|
|
181
|
+
...router,
|
|
182
|
+
state: router.state,
|
|
183
|
+
}
|
|
187
184
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
185
|
+
return (
|
|
186
|
+
<div
|
|
187
|
+
ref={ref}
|
|
188
|
+
className={cx(
|
|
189
|
+
styles.devtoolsPanel,
|
|
190
|
+
'TanStackRouterDevtoolsPanel',
|
|
191
|
+
className,
|
|
192
|
+
)}
|
|
193
|
+
{...otherPanelProps}
|
|
194
|
+
>
|
|
195
|
+
{handleDragStart ? (
|
|
196
|
+
<div className={styles.dragHandle} onMouseDown={handleDragStart}></div>
|
|
197
|
+
) : null}
|
|
198
|
+
<button
|
|
199
|
+
className={styles.panelCloseBtn}
|
|
200
|
+
onClick={(e) => {
|
|
201
|
+
setIsOpen(false)
|
|
202
|
+
onCloseClick(e)
|
|
203
|
+
}}
|
|
197
204
|
>
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
className={styles.panelCloseBtn}
|
|
206
|
-
onClick={(e) => {
|
|
207
|
-
setIsOpen(false)
|
|
208
|
-
onCloseClick(e)
|
|
209
|
-
}}
|
|
205
|
+
<svg
|
|
206
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
207
|
+
width="10"
|
|
208
|
+
height="6"
|
|
209
|
+
fill="none"
|
|
210
|
+
viewBox="0 0 10 6"
|
|
211
|
+
className={styles.panelCloseBtnIcon}
|
|
210
212
|
>
|
|
211
|
-
<
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
213
|
+
<path
|
|
214
|
+
stroke="currentColor"
|
|
215
|
+
strokeLinecap="round"
|
|
216
|
+
strokeLinejoin="round"
|
|
217
|
+
strokeWidth="1.667"
|
|
218
|
+
d="M1 1l4 4 4-4"
|
|
219
|
+
></path>
|
|
220
|
+
</svg>
|
|
221
|
+
</button>
|
|
222
|
+
<div className={styles.firstContainer}>
|
|
223
|
+
<div className={styles.row}>
|
|
224
|
+
<Logo
|
|
225
|
+
aria-hidden
|
|
226
|
+
onClick={(e) => {
|
|
227
|
+
setIsOpen(false)
|
|
228
|
+
onCloseClick(e)
|
|
229
|
+
}}
|
|
230
|
+
/>
|
|
231
|
+
</div>
|
|
232
|
+
<div className={styles.routerExplorerContainer}>
|
|
233
|
+
<div className={styles.routerExplorer}>
|
|
234
|
+
<Explorer
|
|
235
|
+
label="Router"
|
|
236
|
+
value={Object.fromEntries(
|
|
237
|
+
multiSortBy(
|
|
238
|
+
Object.keys(explorerState),
|
|
239
|
+
(
|
|
240
|
+
[
|
|
241
|
+
'state',
|
|
242
|
+
'routesById',
|
|
243
|
+
'routesByPath',
|
|
244
|
+
'flatRoutes',
|
|
245
|
+
'options',
|
|
246
|
+
'manifest',
|
|
247
|
+
] as const
|
|
248
|
+
).map((d) => (dd) => dd !== d),
|
|
249
|
+
)
|
|
250
|
+
.map((key) => [key, (explorerState as any)[key]])
|
|
251
|
+
.filter(
|
|
252
|
+
(d) =>
|
|
253
|
+
typeof d[1] !== 'function' &&
|
|
254
|
+
![
|
|
255
|
+
'__store',
|
|
256
|
+
'basepath',
|
|
257
|
+
'injectedHtml',
|
|
258
|
+
'subscribers',
|
|
259
|
+
'latestLoadPromise',
|
|
260
|
+
'navigateTimeout',
|
|
261
|
+
'resetNextScroll',
|
|
262
|
+
'tempLocationKey',
|
|
263
|
+
'latestLocation',
|
|
264
|
+
'routeTree',
|
|
265
|
+
'history',
|
|
266
|
+
].includes(d[0]),
|
|
267
|
+
),
|
|
268
|
+
)}
|
|
269
|
+
defaultExpanded={{
|
|
270
|
+
state: {} as any,
|
|
271
|
+
context: {} as any,
|
|
272
|
+
options: {} as any,
|
|
273
|
+
}}
|
|
274
|
+
filterSubEntries={(subEntries) => {
|
|
275
|
+
return subEntries.filter((d) => typeof d.value !== 'function')
|
|
235
276
|
}}
|
|
236
277
|
/>
|
|
237
278
|
</div>
|
|
238
|
-
<div className={styles.routerExplorerContainer}>
|
|
239
|
-
<div className={styles.routerExplorer}>
|
|
240
|
-
<Explorer
|
|
241
|
-
label="Router"
|
|
242
|
-
value={Object.fromEntries(
|
|
243
|
-
multiSortBy(
|
|
244
|
-
Object.keys(explorerState),
|
|
245
|
-
(
|
|
246
|
-
[
|
|
247
|
-
'state',
|
|
248
|
-
'routesById',
|
|
249
|
-
'routesByPath',
|
|
250
|
-
'flatRoutes',
|
|
251
|
-
'options',
|
|
252
|
-
'manifest',
|
|
253
|
-
] as const
|
|
254
|
-
).map((d) => (dd) => dd !== d),
|
|
255
|
-
)
|
|
256
|
-
.map((key) => [key, (explorerState as any)[key]])
|
|
257
|
-
.filter(
|
|
258
|
-
(d) =>
|
|
259
|
-
typeof d[1] !== 'function' &&
|
|
260
|
-
![
|
|
261
|
-
'__store',
|
|
262
|
-
'basepath',
|
|
263
|
-
'injectedHtml',
|
|
264
|
-
'subscribers',
|
|
265
|
-
'latestLoadPromise',
|
|
266
|
-
'navigateTimeout',
|
|
267
|
-
'resetNextScroll',
|
|
268
|
-
'tempLocationKey',
|
|
269
|
-
'latestLocation',
|
|
270
|
-
'routeTree',
|
|
271
|
-
'history',
|
|
272
|
-
].includes(d[0]),
|
|
273
|
-
),
|
|
274
|
-
)}
|
|
275
|
-
defaultExpanded={{
|
|
276
|
-
state: {} as any,
|
|
277
|
-
context: {} as any,
|
|
278
|
-
options: {} as any,
|
|
279
|
-
}}
|
|
280
|
-
filterSubEntries={(subEntries) => {
|
|
281
|
-
return subEntries.filter((d) => typeof d.value !== 'function')
|
|
282
|
-
}}
|
|
283
|
-
/>
|
|
284
|
-
</div>
|
|
285
|
-
</div>
|
|
286
279
|
</div>
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
</
|
|
295
|
-
) : null}
|
|
296
|
-
</div>
|
|
297
|
-
<div className={styles.detailsContent}>
|
|
298
|
-
<code>{routerState.location.pathname}</code>
|
|
299
|
-
{routerState.location.maskedLocation ? (
|
|
300
|
-
<code className={styles.maskedLocation}>
|
|
301
|
-
{routerState.location.maskedLocation.pathname}
|
|
302
|
-
</code>
|
|
303
|
-
) : null}
|
|
304
|
-
</div>
|
|
305
|
-
<div className={styles.detailsHeader}>
|
|
306
|
-
<div className={styles.routeMatchesToggle}>
|
|
307
|
-
<button
|
|
308
|
-
type="button"
|
|
309
|
-
onClick={() => {
|
|
310
|
-
setShowMatches(false)
|
|
311
|
-
}}
|
|
312
|
-
disabled={!showMatches}
|
|
313
|
-
className={cx(
|
|
314
|
-
styles.routeMatchesToggleBtn(!showMatches, true),
|
|
315
|
-
)}
|
|
316
|
-
>
|
|
317
|
-
Routes
|
|
318
|
-
</button>
|
|
319
|
-
<button
|
|
320
|
-
type="button"
|
|
321
|
-
onClick={() => {
|
|
322
|
-
setShowMatches(true)
|
|
323
|
-
}}
|
|
324
|
-
disabled={showMatches}
|
|
325
|
-
className={cx(
|
|
326
|
-
styles.routeMatchesToggleBtn(!!showMatches, false),
|
|
327
|
-
)}
|
|
328
|
-
>
|
|
329
|
-
Matches
|
|
330
|
-
</button>
|
|
331
|
-
</div>
|
|
332
|
-
<div className={styles.detailsHeaderInfo}>
|
|
333
|
-
<div>age / staleTime / gcTime</div>
|
|
280
|
+
</div>
|
|
281
|
+
<div className={styles.secondContainer}>
|
|
282
|
+
<div className={styles.matchesContainer}>
|
|
283
|
+
<div className={styles.detailsHeader}>
|
|
284
|
+
<span>Pathname</span>
|
|
285
|
+
{routerState.location.maskedLocation ? (
|
|
286
|
+
<div className={styles.maskedBadgeContainer}>
|
|
287
|
+
<span className={styles.maskedBadge}>masked</span>
|
|
334
288
|
</div>
|
|
289
|
+
) : null}
|
|
290
|
+
</div>
|
|
291
|
+
<div className={styles.detailsContent}>
|
|
292
|
+
<code>{routerState.location.pathname}</code>
|
|
293
|
+
{routerState.location.maskedLocation ? (
|
|
294
|
+
<code className={styles.maskedLocation}>
|
|
295
|
+
{routerState.location.maskedLocation.pathname}
|
|
296
|
+
</code>
|
|
297
|
+
) : null}
|
|
298
|
+
</div>
|
|
299
|
+
<div className={styles.detailsHeader}>
|
|
300
|
+
<div className={styles.routeMatchesToggle}>
|
|
301
|
+
<button
|
|
302
|
+
type="button"
|
|
303
|
+
onClick={() => {
|
|
304
|
+
setShowMatches(false)
|
|
305
|
+
}}
|
|
306
|
+
disabled={!showMatches}
|
|
307
|
+
className={cx(styles.routeMatchesToggleBtn(!showMatches, true))}
|
|
308
|
+
>
|
|
309
|
+
Routes
|
|
310
|
+
</button>
|
|
311
|
+
<button
|
|
312
|
+
type="button"
|
|
313
|
+
onClick={() => {
|
|
314
|
+
setShowMatches(true)
|
|
315
|
+
}}
|
|
316
|
+
disabled={showMatches}
|
|
317
|
+
className={cx(
|
|
318
|
+
styles.routeMatchesToggleBtn(!!showMatches, false),
|
|
319
|
+
)}
|
|
320
|
+
>
|
|
321
|
+
Matches
|
|
322
|
+
</button>
|
|
335
323
|
</div>
|
|
336
|
-
<div className={
|
|
337
|
-
|
|
338
|
-
<RouteComp
|
|
339
|
-
router={router}
|
|
340
|
-
route={router.routeTree}
|
|
341
|
-
isRoot
|
|
342
|
-
activeId={activeId}
|
|
343
|
-
setActiveId={setActiveId}
|
|
344
|
-
/>
|
|
345
|
-
) : (
|
|
346
|
-
<div>
|
|
347
|
-
{(routerState.pendingMatches?.length
|
|
348
|
-
? routerState.pendingMatches
|
|
349
|
-
: routerState.matches
|
|
350
|
-
).map((match, i) => {
|
|
351
|
-
return (
|
|
352
|
-
<div
|
|
353
|
-
key={match.id || i}
|
|
354
|
-
role="button"
|
|
355
|
-
aria-label={`Open match details for ${match.id}`}
|
|
356
|
-
onClick={() =>
|
|
357
|
-
setActiveId(activeId === match.id ? '' : match.id)
|
|
358
|
-
}
|
|
359
|
-
className={cx(styles.matchRow(match === activeMatch))}
|
|
360
|
-
>
|
|
361
|
-
<div
|
|
362
|
-
className={cx(
|
|
363
|
-
styles.matchIndicator(getStatusColor(match)),
|
|
364
|
-
)}
|
|
365
|
-
/>
|
|
366
|
-
|
|
367
|
-
<code
|
|
368
|
-
className={styles.matchID}
|
|
369
|
-
>{`${match.routeId === rootRouteId ? rootRouteId : match.pathname}`}</code>
|
|
370
|
-
<AgeTicker match={match} router={router} />
|
|
371
|
-
</div>
|
|
372
|
-
)
|
|
373
|
-
})}
|
|
374
|
-
</div>
|
|
375
|
-
)}
|
|
324
|
+
<div className={styles.detailsHeaderInfo}>
|
|
325
|
+
<div>age / staleTime / gcTime</div>
|
|
376
326
|
</div>
|
|
377
327
|
</div>
|
|
378
|
-
{
|
|
379
|
-
|
|
380
|
-
<
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
328
|
+
<div className={cx(styles.routesContainer)}>
|
|
329
|
+
{!showMatches ? (
|
|
330
|
+
<RouteComp
|
|
331
|
+
router={router}
|
|
332
|
+
route={router.routeTree}
|
|
333
|
+
isRoot
|
|
334
|
+
activeId={activeId}
|
|
335
|
+
setActiveId={setActiveId}
|
|
336
|
+
/>
|
|
337
|
+
) : (
|
|
386
338
|
<div>
|
|
387
|
-
{routerState.
|
|
339
|
+
{(routerState.pendingMatches?.length
|
|
340
|
+
? routerState.pendingMatches
|
|
341
|
+
: routerState.matches
|
|
342
|
+
).map((match, i) => {
|
|
388
343
|
return (
|
|
389
344
|
<div
|
|
390
|
-
key={match.id}
|
|
345
|
+
key={match.id || i}
|
|
391
346
|
role="button"
|
|
392
347
|
aria-label={`Open match details for ${match.id}`}
|
|
393
348
|
onClick={() =>
|
|
@@ -401,99 +356,133 @@ export const BaseTanStackRouterDevtoolsPanel =
|
|
|
401
356
|
)}
|
|
402
357
|
/>
|
|
403
358
|
|
|
404
|
-
<code
|
|
405
|
-
|
|
359
|
+
<code
|
|
360
|
+
className={styles.matchID}
|
|
361
|
+
>{`${match.routeId === rootRouteId ? rootRouteId : match.pathname}`}</code>
|
|
406
362
|
<AgeTicker match={match} router={router} />
|
|
407
363
|
</div>
|
|
408
364
|
)
|
|
409
365
|
})}
|
|
410
366
|
</div>
|
|
411
|
-
|
|
412
|
-
|
|
367
|
+
)}
|
|
368
|
+
</div>
|
|
413
369
|
</div>
|
|
414
|
-
{
|
|
415
|
-
<div className={styles.
|
|
416
|
-
<div className={styles.detailsHeader}>
|
|
370
|
+
{routerState.cachedMatches.length ? (
|
|
371
|
+
<div className={styles.cachedMatchesContainer}>
|
|
372
|
+
<div className={styles.detailsHeader}>
|
|
373
|
+
<div>Cached Matches</div>
|
|
374
|
+
<div className={styles.detailsHeaderInfo}>
|
|
375
|
+
age / staleTime / gcTime
|
|
376
|
+
</div>
|
|
377
|
+
</div>
|
|
417
378
|
<div>
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
379
|
+
{routerState.cachedMatches.map((match) => {
|
|
380
|
+
return (
|
|
381
|
+
<div
|
|
382
|
+
key={match.id}
|
|
383
|
+
role="button"
|
|
384
|
+
aria-label={`Open match details for ${match.id}`}
|
|
385
|
+
onClick={() =>
|
|
386
|
+
setActiveId(activeId === match.id ? '' : match.id)
|
|
387
|
+
}
|
|
388
|
+
className={cx(styles.matchRow(match === activeMatch))}
|
|
389
|
+
>
|
|
390
|
+
<div
|
|
391
|
+
className={cx(
|
|
392
|
+
styles.matchIndicator(getStatusColor(match)),
|
|
393
|
+
)}
|
|
394
|
+
/>
|
|
395
|
+
|
|
396
|
+
<code className={styles.matchID}>{`${match.id}`}</code>
|
|
397
|
+
|
|
398
|
+
<AgeTicker match={match} router={router} />
|
|
435
399
|
</div>
|
|
400
|
+
)
|
|
401
|
+
})}
|
|
402
|
+
</div>
|
|
403
|
+
</div>
|
|
404
|
+
) : null}
|
|
405
|
+
</div>
|
|
406
|
+
{activeMatch ? (
|
|
407
|
+
<div className={styles.thirdContainer}>
|
|
408
|
+
<div className={styles.detailsHeader}>Match Details</div>
|
|
409
|
+
<div>
|
|
410
|
+
<div className={styles.matchDetails}>
|
|
411
|
+
<div
|
|
412
|
+
className={styles.matchStatus(
|
|
413
|
+
activeMatch.status,
|
|
414
|
+
activeMatch.isFetching,
|
|
415
|
+
)}
|
|
416
|
+
>
|
|
417
|
+
<div>
|
|
418
|
+
{activeMatch.status === 'success' && activeMatch.isFetching
|
|
419
|
+
? 'fetching'
|
|
420
|
+
: activeMatch.status}
|
|
436
421
|
</div>
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
)
|
|
443
|
-
? 'Pending'
|
|
444
|
-
: routerState.matches.find((d) => d.id === activeMatch.id)
|
|
445
|
-
? 'Active'
|
|
446
|
-
: 'Cached'}
|
|
447
|
-
</div>
|
|
422
|
+
</div>
|
|
423
|
+
<div className={styles.matchDetailsInfoLabel}>
|
|
424
|
+
<div>ID:</div>
|
|
425
|
+
<div className={styles.matchDetailsInfo}>
|
|
426
|
+
<code>{activeMatch.id}</code>
|
|
448
427
|
</div>
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
428
|
+
</div>
|
|
429
|
+
<div className={styles.matchDetailsInfoLabel}>
|
|
430
|
+
<div>State:</div>
|
|
431
|
+
<div className={styles.matchDetailsInfo}>
|
|
432
|
+
{routerState.pendingMatches?.find(
|
|
433
|
+
(d) => d.id === activeMatch.id,
|
|
434
|
+
)
|
|
435
|
+
? 'Pending'
|
|
436
|
+
: routerState.matches.find((d) => d.id === activeMatch.id)
|
|
437
|
+
? 'Active'
|
|
438
|
+
: 'Cached'}
|
|
456
439
|
</div>
|
|
457
440
|
</div>
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
label="loaderData"
|
|
465
|
-
value={activeMatch.loaderData}
|
|
466
|
-
defaultExpanded={{}}
|
|
467
|
-
/>
|
|
441
|
+
<div className={styles.matchDetailsInfoLabel}>
|
|
442
|
+
<div>Last Updated:</div>
|
|
443
|
+
<div className={styles.matchDetailsInfo}>
|
|
444
|
+
{activeMatch.updatedAt
|
|
445
|
+
? new Date(activeMatch.updatedAt).toLocaleTimeString()
|
|
446
|
+
: 'N/A'}
|
|
468
447
|
</div>
|
|
469
|
-
|
|
470
|
-
) : null}
|
|
471
|
-
<div className={styles.detailsHeader}>Explorer</div>
|
|
472
|
-
<div className={styles.detailsContent}>
|
|
473
|
-
<Explorer
|
|
474
|
-
label="Match"
|
|
475
|
-
value={activeMatch}
|
|
476
|
-
defaultExpanded={{}}
|
|
477
|
-
/>
|
|
448
|
+
</div>
|
|
478
449
|
</div>
|
|
479
450
|
</div>
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
451
|
+
{activeMatch.loaderData ? (
|
|
452
|
+
<>
|
|
453
|
+
<div className={styles.detailsHeader}>Loader Data</div>
|
|
454
|
+
<div className={styles.detailsContent}>
|
|
455
|
+
<Explorer
|
|
456
|
+
label="loaderData"
|
|
457
|
+
value={activeMatch.loaderData}
|
|
458
|
+
defaultExpanded={{}}
|
|
459
|
+
/>
|
|
460
|
+
</div>
|
|
461
|
+
</>
|
|
462
|
+
) : null}
|
|
463
|
+
<div className={styles.detailsHeader}>Explorer</div>
|
|
464
|
+
<div className={styles.detailsContent}>
|
|
465
|
+
<Explorer label="Match" value={activeMatch} defaultExpanded={{}} />
|
|
466
|
+
</div>
|
|
467
|
+
</div>
|
|
468
|
+
) : null}
|
|
469
|
+
{hasSearch ? (
|
|
470
|
+
<div className={styles.fourthContainer}>
|
|
471
|
+
<div className={styles.detailsHeader}>Search Params</div>
|
|
472
|
+
<div className={styles.detailsContent}>
|
|
473
|
+
<Explorer
|
|
474
|
+
value={routerState.location.search}
|
|
475
|
+
defaultExpanded={Object.keys(routerState.location.search).reduce(
|
|
476
|
+
(obj: any, next) => {
|
|
490
477
|
obj[next] = {}
|
|
491
478
|
return obj
|
|
492
|
-
},
|
|
493
|
-
|
|
494
|
-
|
|
479
|
+
},
|
|
480
|
+
{},
|
|
481
|
+
)}
|
|
482
|
+
/>
|
|
495
483
|
</div>
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
484
|
+
</div>
|
|
485
|
+
) : null}
|
|
486
|
+
</div>
|
|
487
|
+
)
|
|
488
|
+
})
|