Skip to content

Commit 9247ab8

Browse files
committed
fix(devtools): filtering, hide sorting while filtering, show logo when open
1 parent b60ee0e commit 9247ab8

File tree

2 files changed

+37
-32
lines changed

2 files changed

+37
-32
lines changed

media/logo.sketch

16 Bytes
Binary file not shown.

src/devtools/devtools.tsx

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ export const ReactQueryDevtoolsPanel = React.forwardRef(
364364
sorted.reverse()
365365
}
366366

367+
if (!filter) {
368+
return sorted
369+
}
370+
367371
return matchSorter(sorted, filter, { keys: ['queryHash'] }).filter(
368372
d => d.queryHash
369373
)
@@ -450,15 +454,12 @@ export const ReactQueryDevtoolsPanel = React.forwardRef(
450454
alignItems: 'center',
451455
}}
452456
>
453-
<QueryCountStyles>
454-
<div
455-
style={{
456-
fontWeight: 'bold',
457-
}}
458-
>
459-
Queries ({queries.length})
460-
</div>
461-
</QueryCountStyles>
457+
<Logo
458+
aria-hidden
459+
style={{
460+
marginRight: '.5rem',
461+
}}
462+
/>
462463
<div
463464
style={{
464465
display: 'flex',
@@ -519,29 +520,33 @@ export const ReactQueryDevtoolsPanel = React.forwardRef(
519520
marginRight: '.5rem',
520521
}}
521522
/>
522-
<Select
523-
value={sort}
524-
onChange={e => setSort(e.target.value)}
525-
style={{
526-
flex: '1',
527-
minWidth: 75,
528-
marginRight: '.5rem',
529-
}}
530-
>
531-
{Object.keys(sortFns).map(key => (
532-
<option key={key} value={key}>
533-
Sort by {key}
534-
</option>
535-
))}
536-
</Select>
537-
<Button
538-
onClick={() => setSortDesc(old => !old)}
539-
style={{
540-
padding: '.2rem .4rem',
541-
}}
542-
>
543-
{sortDesc ? '⬇ Desc' : '⬆ Asc'}
544-
</Button>
523+
{!filter ? (
524+
<>
525+
<Select
526+
value={sort}
527+
onChange={e => setSort(e.target.value)}
528+
style={{
529+
flex: '1',
530+
minWidth: 75,
531+
marginRight: '.5rem',
532+
}}
533+
>
534+
{Object.keys(sortFns).map(key => (
535+
<option key={key} value={key}>
536+
Sort by {key}
537+
</option>
538+
))}
539+
</Select>
540+
<Button
541+
onClick={() => setSortDesc(old => !old)}
542+
style={{
543+
padding: '.3rem .4rem',
544+
}}
545+
>
546+
{sortDesc ? '⬇ Desc' : '⬆ Asc'}
547+
</Button>
548+
</>
549+
) : null}
545550
</div>
546551
</div>
547552
</div>

0 commit comments

Comments
 (0)