(props)
| 436 | export const ParentPanel: Component<{ |
| 437 | children: JSX.Element |
| 438 | }> = (props) => { |
| 439 | const { panelWidth, setPanelWidth } = useDevtoolsState() |
| 440 | |
| 441 | const theme = useTheme() |
| 442 | const css = useQueryDevtoolsContext().shadowDOMTarget |
| 443 | ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) |
| 444 | : goober.css |
| 445 | const styles = createMemo(() => { |
| 446 | return theme() === 'dark' ? darkStyles(css) : lightStyles(css) |
| 447 | }) |
| 448 | |
| 449 | let panelRef!: HTMLDivElement |
| 450 | |
| 451 | onMount(() => { |
| 452 | createResizeObserver(panelRef, ({ width }, el) => { |
| 453 | if (el === panelRef) { |
| 454 | setPanelWidth(width) |
| 455 | } |
| 456 | }) |
| 457 | }) |
| 458 | |
| 459 | const getPanelDynamicStyles = () => { |
| 460 | const { colors } = tokens |
| 461 | const t = (light: string, dark: string) => |
| 462 | theme() === 'dark' ? dark : light |
| 463 | if (panelWidth() < secondBreakpoint) { |
| 464 | return css` |
| 465 | flex-direction: column; |
| 466 | background-color: ${t(colors.gray[300], colors.gray[600])}; |
| 467 | ` |
| 468 | } |
| 469 | return css` |
| 470 | flex-direction: row; |
| 471 | background-color: ${t(colors.gray[200], colors.darkGray[900])}; |
| 472 | ` |
| 473 | } |
| 474 | |
| 475 | return ( |
| 476 | <div |
| 477 | dir="ltr" |
| 478 | style={{ |
| 479 | '--tsqd-font-size': '16px', |
| 480 | }} |
| 481 | ref={panelRef} |
| 482 | class={cx( |
| 483 | styles().parentPanel, |
| 484 | getPanelDynamicStyles(), |
| 485 | { |
| 486 | [css` |
| 487 | min-width: min-content; |
| 488 | `]: panelWidth() < thirdBreakpoint, |
| 489 | }, |
| 490 | 'tsqd-main-panel', |
| 491 | )} |
| 492 | > |
| 493 | {props.children} |
| 494 | </div> |
| 495 | ) |
nothing calls this directly
no test coverage detected