redux-devtools/packages/redux-devtools-inspector-monitor-test-tab/demo/src/DevTools.tsx
Nathan Bierema 158ba2ce12
[inspector-monitor] Replace jss with Emotion (#1560)
* Setup Emotion

* Fix setup

* Start conversion

* actionList

* actionListHeader

* actionListRows

* actionListHeaderSelector

* actionListItem

* actionListItemTime

* actionListItemSelector

* actionListItemName

* actionListHeaderSearch

* actionListHeaderWrapper

* actionPreview

* Remaining css

* Format

* Propagate Emotion dependencies

* Fix tests

* Remove styling prop

* Remove jss

* Remove themeState

* Use color map as Emotion theme

* Rework theme resolution

* Inline CSS

* Remove usage of className

* Fix warning

* Create large-spoons-yell.md
2023-12-12 04:02:35 +00:00

41 lines
1.3 KiB
TypeScript

import React from 'react';
import { createDevTools } from '@redux-devtools/core';
import { InspectorMonitor, Tab } from '@redux-devtools/inspector-monitor';
import type { Base16ThemeName } from '@redux-devtools/inspector-monitor';
import { DockMonitor } from '@redux-devtools/dock-monitor';
import { useLocation } from 'react-router-dom';
import getOptions from './getOptions';
import { TestTab } from '@redux-devtools/inspector-monitor-test-tab';
import { Action } from 'redux';
export const getDevTools = (location: { search: string }) =>
createDevTools(
<DockMonitor
defaultIsVisible
toggleVisibilityKey="ctrl-h"
changePositionKey="ctrl-q"
changeMonitorKey="ctrl-m"
>
<InspectorMonitor
theme={getOptions(location).theme as Base16ThemeName}
invertTheme={!getOptions(location).dark}
supportImmutable={getOptions(location).supportImmutable}
tabs={(defaultTabs) =>
[
{
name: 'Test',
component: TestTab,
},
...defaultTabs,
] as Tab<unknown, Action<string>>[]
}
/>
</DockMonitor>,
);
export function ConnectedDevTools() {
const location = useLocation();
const DevTools = getDevTools(location);
return <DevTools />;
}