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

Function Expander

packages/query-devtools/src/Explorer.tsx:65–105  ·  view source on GitHub ↗
(props: { expanded: boolean })

Source from the content-addressed store, hash-verified

63}
64
65const Expander = (props: { expanded: boolean }) => {
66 const theme = useTheme()
67 const css = useQueryDevtoolsContext().shadowDOMTarget
68 ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
69 : goober.css
70 const styles = createMemo(() => {
71 return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
72 })
73
74 return (
75 <span
76 class={cx(
77 styles().expander,
78 css`
79 transform: rotate(${props.expanded ? 90 : 0}deg);
80 `,
81 props.expanded &&
82 css`
83 & svg {
84 top: -1px;
85 }
86 `,
87 )}
88 >
89 <svg
90 width="16"
91 height="16"
92 viewBox="0 0 16 16"
93 fill="none"
94 xmlns="http://www.w3.org/2000/svg"
95 >
96 <path
97 d="M6 12L10 8L6 4"
98 stroke-width="2"
99 stroke-linecap="round"
100 stroke-linejoin="round"
101 />
102 </svg>
103 </span>
104 )
105}
106
107type CopyState = 'NoCopy' | 'SuccessCopy' | 'ErrorCopy'
108const CopyButton = (props: { value: unknown }) => {

Callers

nothing calls this directly

Calls 4

useThemeFunction · 0.90
useQueryDevtoolsContextFunction · 0.90
darkStylesFunction · 0.70
lightStylesFunction · 0.70

Tested by

no test coverage detected