mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 00:19:55 +03:00
Remove unused styling
This commit is contained in:
parent
a09e45a3de
commit
f17566c193
|
@ -1,10 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { StyleUtilsContext } from '../styles/createStylingFromTheme';
|
|
||||||
|
|
||||||
export function NoRtkQueryApi(): JSX.Element {
|
export function NoRtkQueryApi(): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<StyleUtilsContext.Consumer>
|
|
||||||
{({ styling }) => (
|
|
||||||
<div
|
<div
|
||||||
css={(theme) => ({
|
css={(theme) => ({
|
||||||
width: '100%',
|
width: '100%',
|
||||||
|
@ -30,7 +27,5 @@ export function NoRtkQueryApi(): JSX.Element {
|
||||||
</a>
|
</a>
|
||||||
.
|
.
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
</StyleUtilsContext.Consumer>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,7 +137,7 @@ export class QueryForm extends React.PureComponent<
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyleUtilsContext.Consumer>
|
<StyleUtilsContext.Consumer>
|
||||||
{({ styling, base16Theme }) => {
|
{({ base16Theme }) => {
|
||||||
return (
|
return (
|
||||||
<form
|
<form
|
||||||
id="rtk-query-monitor-query-selection-form"
|
id="rtk-query-monitor-query-selection-form"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import React, { PureComponent, ReactNode } from 'react';
|
import React, { PureComponent, ReactNode } from 'react';
|
||||||
import type { Interpolation, Theme } from '@emotion/react';
|
import type { Interpolation, Theme } from '@emotion/react';
|
||||||
import { StyleUtilsContext } from '../styles/createStylingFromTheme';
|
|
||||||
import { RtkResourceInfo, RtkQueryMonitorState } from '../types';
|
import { RtkResourceInfo, RtkQueryMonitorState } from '../types';
|
||||||
import { isQuerySelected } from '../utils/rtk-query';
|
import { isQuerySelected } from '../utils/rtk-query';
|
||||||
|
|
||||||
|
@ -50,8 +49,6 @@ export class QueryList extends PureComponent<QueryListProps> {
|
||||||
const { resInfos, selectedQueryKey, onSelectQuery } = this.props;
|
const { resInfos, selectedQueryKey, onSelectQuery } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyleUtilsContext.Consumer>
|
|
||||||
{({ styling }) => (
|
|
||||||
<ul css={{ listStyle: 'none', margin: '0', padding: '0' }}>
|
<ul css={{ listStyle: 'none', margin: '0', padding: '0' }}>
|
||||||
{resInfos.map((resInfo) => {
|
{resInfos.map((resInfo) => {
|
||||||
const isSelected = isQuerySelected(selectedQueryKey, resInfo);
|
const isSelected = isQuerySelected(selectedQueryKey, resInfo);
|
||||||
|
@ -117,8 +114,6 @@ export class QueryList extends PureComponent<QueryListProps> {
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</ul>
|
</ul>
|
||||||
)}
|
|
||||||
</StyleUtilsContext.Consumer>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import React, { ReactNode, PureComponent } from 'react';
|
import React, { ReactNode, PureComponent } from 'react';
|
||||||
import type { ShouldExpandNodeInitially } from 'react-json-tree';
|
import type { ShouldExpandNodeInitially } from 'react-json-tree';
|
||||||
import { ApiStats, QueryPreviewTabs, RtkQueryApiState } from '../types';
|
import { ApiStats, QueryPreviewTabs, RtkQueryApiState } from '../types';
|
||||||
import { StyleUtilsContext } from '../styles/createStylingFromTheme';
|
|
||||||
import { TreeView, TreeViewProps } from './TreeView';
|
import { TreeView, TreeViewProps } from './TreeView';
|
||||||
import { renderTabPanelId, renderTabPanelButtonId } from '../utils/a11y';
|
import { renderTabPanelId, renderTabPanelButtonId } from '../utils/a11y';
|
||||||
|
|
||||||
|
@ -39,8 +38,6 @@ export class QueryPreviewApi extends PureComponent<QueryPreviewApiProps> {
|
||||||
const hasQueries = Object.keys(apiState.queries).length > 0;
|
const hasQueries = Object.keys(apiState.queries).length > 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyleUtilsContext.Consumer>
|
|
||||||
{({ styling }) => (
|
|
||||||
<article
|
<article
|
||||||
{...rootProps}
|
{...rootProps}
|
||||||
css={(theme) => ({
|
css={(theme) => ({
|
||||||
|
@ -89,8 +86,6 @@ export class QueryPreviewApi extends PureComponent<QueryPreviewApiProps> {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</article>
|
</article>
|
||||||
)}
|
|
||||||
</StyleUtilsContext.Consumer>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
import { StyleUtilsContext } from '../styles/createStylingFromTheme';
|
|
||||||
import { QueryPreviewTabs, TabOption } from '../types';
|
import { QueryPreviewTabs, TabOption } from '../types';
|
||||||
import { renderTabPanelButtonId } from '../utils/a11y';
|
import { renderTabPanelButtonId } from '../utils/a11y';
|
||||||
import { emptyArray } from '../utils/object';
|
import { emptyArray } from '../utils/object';
|
||||||
|
@ -24,8 +23,6 @@ export class QueryPreviewHeader extends React.Component<QueryPreviewHeaderProps>
|
||||||
const { tabs, selectedTab, renderTabLabel } = this.props;
|
const { tabs, selectedTab, renderTabLabel } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyleUtilsContext.Consumer>
|
|
||||||
{({ styling }) => (
|
|
||||||
<div
|
<div
|
||||||
css={(theme) => ({
|
css={(theme) => ({
|
||||||
flex: '0 0 30px',
|
flex: '0 0 30px',
|
||||||
|
@ -107,15 +104,11 @@ export class QueryPreviewHeader extends React.Component<QueryPreviewHeaderProps>
|
||||||
})),
|
})),
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<span>
|
<span>{renderTabLabel ? renderTabLabel(tab) : tab.label}</span>
|
||||||
{renderTabLabel ? renderTabLabel(tab) : tab.label}
|
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
</StyleUtilsContext.Consumer>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import React, { CSSProperties } from 'react';
|
import React, { CSSProperties } from 'react';
|
||||||
import { ArrowUpIcon } from './ArrowUpIcon';
|
import { ArrowUpIcon } from './ArrowUpIcon';
|
||||||
import { StyleUtilsContext } from '../styles/createStylingFromTheme';
|
|
||||||
|
|
||||||
export interface SortOrderButtonProps {
|
export interface SortOrderButtonProps {
|
||||||
readonly isAsc?: boolean;
|
readonly isAsc?: boolean;
|
||||||
|
@ -28,8 +27,6 @@ export function SortOrderButton({
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyleUtilsContext.Consumer>
|
|
||||||
{({ styling }) => (
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
id={id}
|
id={id}
|
||||||
|
@ -61,7 +58,5 @@ export function SortOrderButton({
|
||||||
<ArrowUpIcon style={arrowStyles} />
|
<ArrowUpIcon style={arrowStyles} />
|
||||||
{buttonLabel}
|
{buttonLabel}
|
||||||
</button>
|
</button>
|
||||||
)}
|
|
||||||
</StyleUtilsContext.Consumer>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { StyleUtilsContext } from '../styles/createStylingFromTheme';
|
|
||||||
|
|
||||||
export type UListProps = React.HTMLAttributes<HTMLUListElement>;
|
export type UListProps = React.HTMLAttributes<HTMLUListElement>;
|
||||||
|
|
||||||
export function UList(props: UListProps): JSX.Element {
|
export function UList(props: UListProps): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<StyleUtilsContext.Consumer>
|
|
||||||
{({ styling }) => (
|
|
||||||
<ul
|
<ul
|
||||||
{...props}
|
{...props}
|
||||||
css={(theme) => ({
|
css={(theme) => ({
|
||||||
|
@ -29,7 +26,5 @@ export function UList(props: UListProps): JSX.Element {
|
||||||
},
|
},
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
)}
|
|
||||||
</StyleUtilsContext.Consumer>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
import type { Interpolation, Theme } from '@emotion/react';
|
import type { Interpolation, Theme } from '@emotion/react';
|
||||||
import { StyleUtilsContext } from '../styles/createStylingFromTheme';
|
|
||||||
import { createTreeItemLabelRenderer } from '../styles/tree';
|
import { createTreeItemLabelRenderer } from '../styles/tree';
|
||||||
import {
|
import {
|
||||||
QueryPreviewTabs,
|
QueryPreviewTabs,
|
||||||
|
@ -186,7 +185,7 @@ export class QueryPreview<S> extends React.PureComponent<QueryPreviewProps<S>> {
|
||||||
constructor(props: QueryPreviewProps<S>) {
|
constructor(props: QueryPreviewProps<S>) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.labelRenderer = createTreeItemLabelRenderer(this.props.styling);
|
this.labelRenderer = createTreeItemLabelRenderer();
|
||||||
}
|
}
|
||||||
|
|
||||||
renderLabelWithCounter = (
|
renderLabelWithCounter = (
|
||||||
|
@ -229,8 +228,6 @@ export class QueryPreview<S> extends React.PureComponent<QueryPreviewProps<S>> {
|
||||||
|
|
||||||
if (!resInfo) {
|
if (!resInfo) {
|
||||||
return (
|
return (
|
||||||
<StyleUtilsContext.Consumer>
|
|
||||||
{({ styling }) => (
|
|
||||||
<div css={queryPreviewCss}>
|
<div css={queryPreviewCss}>
|
||||||
<QueryPreviewHeader
|
<QueryPreviewHeader
|
||||||
selectedTab={selectedTab}
|
selectedTab={selectedTab}
|
||||||
|
@ -239,25 +236,16 @@ export class QueryPreview<S> extends React.PureComponent<QueryPreviewProps<S>> {
|
||||||
tabs.filter((tab) =>
|
tabs.filter((tab) =>
|
||||||
isTabVisible(tab, 'default'),
|
isTabVisible(tab, 'default'),
|
||||||
) as ReadonlyArray<
|
) as ReadonlyArray<
|
||||||
TabOption<
|
TabOption<QueryPreviewTabs, unknown, RtkResourceInfo['type']>
|
||||||
QueryPreviewTabs,
|
|
||||||
unknown,
|
|
||||||
RtkResourceInfo['type']
|
|
||||||
>
|
|
||||||
>
|
>
|
||||||
}
|
}
|
||||||
renderTabLabel={this.renderTabLabel}
|
renderTabLabel={this.renderTabLabel}
|
||||||
/>
|
/>
|
||||||
{hasNoApis && <NoRtkQueryApi />}
|
{hasNoApis && <NoRtkQueryApi />}
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
</StyleUtilsContext.Consumer>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
|
||||||
<StyleUtilsContext.Consumer>
|
|
||||||
{({ styling }) => {
|
|
||||||
return (
|
return (
|
||||||
<div css={queryPreviewCss}>
|
<div css={queryPreviewCss}>
|
||||||
<QueryPreviewHeader
|
<QueryPreviewHeader
|
||||||
|
@ -267,11 +255,7 @@ export class QueryPreview<S> extends React.PureComponent<QueryPreviewProps<S>> {
|
||||||
tabs.filter((tab) =>
|
tabs.filter((tab) =>
|
||||||
isTabVisible(tab, resInfo.type),
|
isTabVisible(tab, resInfo.type),
|
||||||
) as ReadonlyArray<
|
) as ReadonlyArray<
|
||||||
TabOption<
|
TabOption<QueryPreviewTabs, unknown, RtkResourceInfo['type']>
|
||||||
QueryPreviewTabs,
|
|
||||||
unknown,
|
|
||||||
RtkResourceInfo['type']
|
|
||||||
>
|
|
||||||
>
|
>
|
||||||
}
|
}
|
||||||
renderTabLabel={this.renderTabLabel}
|
renderTabLabel={this.renderTabLabel}
|
||||||
|
@ -279,8 +263,5 @@ export class QueryPreview<S> extends React.PureComponent<QueryPreviewProps<S>> {
|
||||||
<TabComponent {...(this.props as QueryPreviewTabProps)} />
|
<TabComponent {...(this.props as QueryPreviewTabProps)} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}}
|
|
||||||
</StyleUtilsContext.Consumer>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,9 +92,7 @@ export function getItemString(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createTreeItemLabelRenderer(
|
export function createTreeItemLabelRenderer(): LabelRenderer {
|
||||||
styling: StylingFunction,
|
|
||||||
): LabelRenderer {
|
|
||||||
return function labelRenderer([key], nodeType, expanded) {
|
return function labelRenderer([key], nodeType, expanded) {
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user