redux-devtools/packages/redux-devtools-inspector-monitor/src/tabs/StateTab.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

35 lines
906 B
TypeScript

import React from 'react';
import { JSONTree } from 'react-json-tree';
import { Action } from 'redux';
import getItemString from './getItemString';
import getJsonTreeTheme from './getJsonTreeTheme';
import { TabComponentProps } from '../ActionPreview';
const StateTab: React.FunctionComponent<
TabComponentProps<any, Action<string>>
> = ({
nextState,
base16Theme,
invertTheme,
labelRenderer,
dataTypeKey,
isWideLayout,
sortStateTreeAlphabetically,
disableStateTreeCollection,
}) => (
<JSONTree
labelRenderer={labelRenderer}
theme={getJsonTreeTheme(base16Theme)}
data={nextState}
getItemString={(type, data) =>
getItemString(type, data, dataTypeKey, isWideLayout)
}
invertTheme={invertTheme}
hideRoot
sortObjectKeys={sortStateTreeAlphabetically}
{...(disableStateTreeCollection ? { collectionLimit: 0 } : {})}
/>
);
export default StateTab;