MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / ToggleMode

Function ToggleMode

packages/frontend/src/structure.tsx:440–481  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

438}
439
440const ToggleMode: s.Component = () => {
441 const structure = useStructure()
442
443 const tabsContentMap: Readonly<Record<debug.TreeWalkerMode, string>> = {
444 [debug.TreeWalkerMode.Owners]: 'Owners',
445 [debug.TreeWalkerMode.Components]: 'Components',
446 [debug.TreeWalkerMode.DOM]: 'DOM',
447 }
448
449 return (
450 <div class="ml-auto h-full">
451 <ui.ToggleTabs
452 class="h-full"
453 active={structure.mode()}
454 onSelect={structure.changeTreeViewMode}
455 >
456 {Option =>
457 [debug.TreeWalkerMode.Components, debug.TreeWalkerMode.Owners, debug.TreeWalkerMode.DOM].map(mode => (
458 <Option
459 for={mode}
460 class="group"
461 style={{
462 [ui.toggle_tab_color_var]:
463 mode === debug.TreeWalkerMode.Owners ? theme.vars.text.DEFAULT
464 : mode === debug.TreeWalkerMode.DOM ? theme.vars.dom
465 : theme.vars.component,
466 }}
467 >
468 <div
469 class="w-2 h-2 rounded-full border border-solid opacity-60 transition-opacity group-hover:opacity-100 group-focus:opacity-100 group-[[aria-selected=true]]:opacity-100"
470 style={{
471 'border-color': `var(${ui.toggle_tab_color_var})`,
472 }}
473 />
474 {tabsContentMap[mode]}
475 </Option>
476 ))
477 }
478 </ui.ToggleTabs>
479 </div>
480 )
481}
482
483const getFocusedNodeData = (
484 list: Node[],

Callers

nothing calls this directly

Calls 1

useStructureFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…