MCPcopy Create free account
hub / github.com/TanStack/query / ParentPanel

Function ParentPanel

packages/query-devtools/src/Devtools.tsx:368–397  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

366export const ParentPanel: Component<{
367 children: JSX.Element
368}> = (props) => {
369 const { panelWidth, setPanelWidth } = useDevtoolsState()
370
371 const theme = useTheme()
372 const themed = createThemed(theme)
373
374 let panelRef!: HTMLDivElement
375
376 onMount(() => {
377 attachStyles(panelRef, useQueryDevtoolsContext().shadowDOMTarget)
378 createResizeObserver(panelRef, ({ width }, el) => {
379 if (el === panelRef) {
380 setPanelWidth(width)
381 }
382 })
383 })
384
385 return (
386 <div
387 dir="ltr"
388 style={{
389 '--tsqd-font-size': '16px',
390 }}
391 ref={panelRef}
392 class={`${themed('tsqd-style-parent-panel')} ${themed(panelWidth() < secondBreakpoint ? 'tsqd-style-panel-column' : 'tsqd-style-panel-row')} ${panelWidth() < thirdBreakpoint ? 'tsqd-style-panel-min-content' : ''} tsqd-main-panel`}
393 >
394 {props.children}
395 </div>
396 )
397}
398
399const DraggablePanel: Component<DevtoolsPanelProps> = (props) => {
400 const { setSelectedQueryHash, panelWidth, setPanelWidth } = useDevtoolsState()

Callers

nothing calls this directly

Calls 5

useDevtoolsStateFunction · 0.90
useThemeFunction · 0.90
createThemedFunction · 0.90
attachStylesFunction · 0.90
useQueryDevtoolsContextFunction · 0.90

Tested by

no test coverage detected