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

Function Expander

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

Source from the content-addressed store, hash-verified

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