(props: {
dataPath: Array<string>
activeQuery: Query
value: boolean
})
| 204 | } |
| 205 | |
| 206 | const ToggleValueButton = (props: { |
| 207 | dataPath: Array<string> |
| 208 | activeQuery: Query |
| 209 | value: boolean |
| 210 | }) => { |
| 211 | const theme = useTheme() |
| 212 | const css = useQueryDevtoolsContext().shadowDOMTarget |
| 213 | ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) |
| 214 | : goober.css |
| 215 | const styles = createMemo(() => { |
| 216 | return theme() === 'dark' ? darkStyles(css) : lightStyles(css) |
| 217 | }) |
| 218 | const queryClient = useQueryDevtoolsContext().client |
| 219 | |
| 220 | return ( |
| 221 | <button |
| 222 | class={cx( |
| 223 | styles().actionButton, |
| 224 | css` |
| 225 | width: ${tokens.size[3.5]}; |
| 226 | height: ${tokens.size[3.5]}; |
| 227 | `, |
| 228 | )} |
| 229 | title={'Toggle value'} |
| 230 | aria-label={'Toggle value'} |
| 231 | onClick={() => { |
| 232 | const oldData = props.activeQuery.state.data |
| 233 | const newData = updateNestedDataByPath( |
| 234 | oldData, |
| 235 | props.dataPath, |
| 236 | !props.value, |
| 237 | ) |
| 238 | queryClient.setQueryData(props.activeQuery.queryKey, newData) |
| 239 | }} |
| 240 | > |
| 241 | <Check theme={theme()} checked={props.value} /> |
| 242 | </button> |
| 243 | ) |
| 244 | } |
| 245 | |
| 246 | type ExplorerProps = { |
| 247 | editable?: boolean |
nothing calls this directly
no test coverage detected
searching dependent graphs…