UNPKG

@redux-devtools/rtk-query-monitor

Version:
42 lines 1.32 kB
import React, { Component } from 'react'; import { ThemeProvider } from '@emotion/react'; import RtkQueryInspector from './RtkQueryInspector'; import { reducer } from '../reducers'; import { createRtkQueryMonitorThemeFromBase16Theme, resolveBase16Theme, StyleUtilsContext } from '../styles/themes'; import { jsx as ___EmotionJSX } from "@emotion/react"; class RtkQueryMonitor extends Component { static update = (() => reducer)(); static defaultProps = { theme: 'nicinabox', invertTheme: false }; render() { const { currentStateIndex, computedStates, monitorState, dispatch, actionsById, theme, invertTheme } = this.props; const base16Theme = resolveBase16Theme(theme); const styleUtils = { base16Theme, invertTheme }; const rtkQueryMonitorTheme = createRtkQueryMonitorThemeFromBase16Theme(base16Theme, invertTheme); return ___EmotionJSX(StyleUtilsContext.Provider, { value: styleUtils }, ___EmotionJSX(ThemeProvider, { theme: rtkQueryMonitorTheme }, ___EmotionJSX(RtkQueryInspector, { computedStates: computedStates, currentStateIndex: currentStateIndex, monitorState: monitorState, dispatch: dispatch, actionsById: actionsById }))); } } export default RtkQueryMonitor;