diff --git a/packages/redux-devtools-rtk-query-monitor/src/components/NoRtkQueryApi.tsx b/packages/redux-devtools-rtk-query-monitor/src/components/NoRtkQueryApi.tsx index f8c19f34..9f9d14ee 100644 --- a/packages/redux-devtools-rtk-query-monitor/src/components/NoRtkQueryApi.tsx +++ b/packages/redux-devtools-rtk-query-monitor/src/components/NoRtkQueryApi.tsx @@ -5,7 +5,19 @@ export function NoRtkQueryApi(): JSX.Element { return ( {({ styling }) => ( -
+
({ + width: '100%', + textAlign: 'center', + color: theme.TEXT_COLOR, + padding: '1.4em', + '& a': { + fontSize: 'inherit', + color: theme.TEXT_COLOR, + textDecoration: 'underline', + }, + })} + > No rtk-query api found.
Make sure to follow{' '} diff --git a/packages/redux-devtools-rtk-query-monitor/src/components/QueryForm.tsx b/packages/redux-devtools-rtk-query-monitor/src/components/QueryForm.tsx index de7cbf6c..24e21749 100644 --- a/packages/redux-devtools-rtk-query-monitor/src/components/QueryForm.tsx +++ b/packages/redux-devtools-rtk-query-monitor/src/components/QueryForm.tsx @@ -143,7 +143,10 @@ export class QueryForm extends React.PureComponent< id="rtk-query-monitor-query-selection-form" action="#" onSubmit={this.handleSubmit} - {...styling('queryForm')} + css={{ + display: 'flex', + flexFlow: 'column nowrap', + }} >
({ @@ -160,7 +163,42 @@ export class QueryForm extends React.PureComponent< -
+
({ + maxWidth: '65%', + backgroundColor: theme.BACKGROUND_COLOR, + display: 'flex', + alignItems: 'center', + flexFlow: 'row nowrap', + flex: '1 1 auto', + paddingRight: 6, + '& input': { + outline: 'none', + border: 'none', + width: '100%', + flex: '1 1 auto', + padding: '5px 10px', + fontSize: '1em', + position: 'relative', + fontFamily: + 'monaco, Consolas, "Lucida Console", monospace', + + backgroundColor: theme.BACKGROUND_COLOR, + color: theme.TEXT_COLOR, + + '&::-webkit-input-placeholder': { + color: theme.TEXT_PLACEHOLDER_COLOR, + }, + + '&::-moz-placeholder': { + color: theme.TEXT_PLACEHOLDER_COLOR, + }, + '&::-webkit-search-cancel-button': { + WebkitAppearance: 'none', + }, + }, + })} + > ({ + WebkitAppearance: 'none', + border: 'none', + outline: 'none', + boxShadow: 'none', + display: 'block', + flex: '0 0 auto', + cursor: 'pointer', + background: 'transparent', + position: 'relative', + fontSize: 'inherit', + '&[data-invisible="1"]': { + visibility: 'hidden !important' as 'hidden', + }, + '&::after': { + content: '"\u00d7"', + display: 'block', + padding: 4, + fontSize: '1.2em', + color: theme.TEXT_PLACEHOLDER_COLOR, + background: 'transparent', + }, + '&:hover::after': { + color: theme.TEXT_COLOR, + }, + })} /> @@ -203,7 +295,24 @@ export class QueryForm extends React.PureComponent< onChange={this.handleSelectFilterChange} />
-
+
:last-child': { + flex: '0 0 auto', + marginLeft: '0.4em', + }, + }} + > > id={selectId} diff --git a/packages/redux-devtools-rtk-query-monitor/src/components/QueryPreviewApi.tsx b/packages/redux-devtools-rtk-query-monitor/src/components/QueryPreviewApi.tsx index de378a03..9c65c105 100644 --- a/packages/redux-devtools-rtk-query-monitor/src/components/QueryPreviewApi.tsx +++ b/packages/redux-devtools-rtk-query-monitor/src/components/QueryPreviewApi.tsx @@ -41,7 +41,23 @@ export class QueryPreviewApi extends PureComponent { return ( {({ styling }) => ( -
+
({ + display: 'block', + overflowY: 'auto', + padding: '0.5em 0', + color: theme.TAB_CONTENT_COLOR, + '& h2': { + color: theme.ULIST_STRONG_COLOR, + padding: '0.5em 1em', + fontWeight: 700, + }, + '& h3': { + color: theme.ULIST_STRONG_COLOR, + }, + })} + >

{apiState.config.reducerPath}

State} diff --git a/packages/redux-devtools-rtk-query-monitor/src/components/QueryPreviewHeader.tsx b/packages/redux-devtools-rtk-query-monitor/src/components/QueryPreviewHeader.tsx index d4546ae8..b1b1f816 100644 --- a/packages/redux-devtools-rtk-query-monitor/src/components/QueryPreviewHeader.tsx +++ b/packages/redux-devtools-rtk-query-monitor/src/components/QueryPreviewHeader.tsx @@ -26,7 +26,18 @@ export class QueryPreviewHeader extends React.Component return ( {({ styling }) => ( -
+
({ + flex: '0 0 30px', + padding: '5px 4px', + alignItems: 'center', + borderBottomWidth: '1px', + borderBottomStyle: 'solid', + + backgroundColor: theme.HEADER_BACKGROUND_COLOR, + borderBottomColor: theme.HEADER_BORDER_COLOR, + })} + >
({ + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + flexFlow: 'row nowrap', + cursor: 'pointer', + position: 'relative', + padding: '0 8px', + color: theme.TEXT_COLOR, + borderStyle: 'solid', + borderWidth: '1px', + borderRadius: '3px', + backgroundColor: theme.TAB_BACK_COLOR, + borderColor: theme.TAB_BORDER_COLOR, + height: 30, + fontSize: 12, + width: 64, + + '&:active': { + backgroundColor: theme.TAB_BACK_SELECTED_COLOR, + }, + })} > {buttonLabel} diff --git a/packages/redux-devtools-rtk-query-monitor/src/components/TreeView.tsx b/packages/redux-devtools-rtk-query-monitor/src/components/TreeView.tsx index 128f132a..ecbeb3dc 100644 --- a/packages/redux-devtools-rtk-query-monitor/src/components/TreeView.tsx +++ b/packages/redux-devtools-rtk-query-monitor/src/components/TreeView.tsx @@ -90,7 +90,14 @@ export class TreeView extends React.PureComponent { {({ styling, invertTheme, base16Theme }) => { return ( -
+
{before} ; export function UList(props: UListProps): JSX.Element { return ( - {({ styling }) =>
    } + {({ styling }) => ( +
      ({ + listStyle: 'none', + padding: '0 0 0 1em', + color: theme.ULIST_COLOR, + '& > li': { + listStyle: 'none', + }, + '& > li::before': { + content: '"\\2022"', + display: 'inline-block', + paddingRight: '0.5em', + color: theme.ULIST_DISC_COLOR, + fontSize: '0.8em', + }, + + '& strong': { + color: theme.ULIST_STRONG_COLOR, + }, + })} + /> + )} ); } diff --git a/packages/redux-devtools-rtk-query-monitor/src/containers/QueryPreview.tsx b/packages/redux-devtools-rtk-query-monitor/src/containers/QueryPreview.tsx index 6dc16852..2655777d 100644 --- a/packages/redux-devtools-rtk-query-monitor/src/containers/QueryPreview.tsx +++ b/packages/redux-devtools-rtk-query-monitor/src/containers/QueryPreview.tsx @@ -1,4 +1,5 @@ import React, { ReactNode } from 'react'; +import type { Interpolation, Theme } from '@emotion/react'; import { StyleUtilsContext } from '../styles/createStylingFromTheme'; import { createTreeItemLabelRenderer } from '../styles/tree'; import { @@ -38,6 +39,23 @@ import { QueryPreviewDataProps, } from '../components/QueryPreviewData'; +const queryPreviewCss: Interpolation = (theme) => ({ + flex: '1 1 50%', + overflowX: 'hidden', + oveflowY: 'auto', + display: 'flex', + flexDirection: 'column', + overflowY: 'hidden', + '& pre': { + border: 'inherit', + borderRadius: '3px', + lineHeight: 'inherit', + color: 'inherit', + }, + + backgroundColor: theme.BACKGROUND_COLOR, +}); + export interface QueryPreviewProps { readonly selectedTab: QueryPreviewTabs; readonly hasNoApis: boolean; @@ -213,7 +231,7 @@ export class QueryPreview extends React.PureComponent> { return ( {({ styling }) => ( -
      +
      extends React.PureComponent> { {({ styling }) => { return ( -
      +
      { - const appearanceNone = { - '-webkit-appearance': 'none', - }; - - return { - sortButton: { - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - flexFlow: 'row nowrap', - cursor: 'pointer', - position: 'relative', - padding: '0 8px', - color: map.TEXT_COLOR, - borderStyle: 'solid', - borderWidth: '1px', - borderRadius: '3px', - backgroundColor: map.TAB_BACK_COLOR, - borderColor: map.TAB_BORDER_COLOR, - height: 30, - fontSize: 12, - width: 64, - - '&:active': { - backgroundColor: map.TAB_BACK_SELECTED_COLOR, - }, - }, - - toggleButton: { - width: '24px', - height: '24px', - display: 'inline-block', - flex: '0 0 auto', - color: map.TEXT_PLACEHOLDER_COLOR, - cursor: 'pointer', - padding: 0, - fontSize: '0.7em', - letterSpacing: '-0.7px', - outline: 'none', - boxShadow: 'none', - fontWeight: '700', - border: 'none', - - '&:hover': { - color: map.TEXT_COLOR, - }, - - backgroundColor: 'transparent', - '&[aria-pressed="true"]': { - color: map.BACKGROUND_COLOR, - backgroundColor: map.TEXT_COLOR, - }, - - '&[data-type="error"]': { - color: map.TEXT_COLOR, - backgroundColor: map.TOGGLE_BUTTON_ERROR, - }, - }, - - queryForm: { - display: 'flex', - flexFlow: 'column nowrap', - }, - sortBySection: { - display: 'flex', - padding: '0.4em', - '& label': { - display: 'flex', - flex: '0 0 auto', - whiteSpace: 'noWrap', - alignItems: 'center', - paddingRight: '0.4em', - }, - - '& > :last-child': { - flex: '0 0 auto', - marginLeft: '0.4em', - }, - }, - - querySearch: { - maxWidth: '65%', - 'background-color': map.BACKGROUND_COLOR, - display: 'flex', - alignItems: 'center', - flexFlow: 'row nowrap', - flex: '1 1 auto', - paddingRight: 6, - '& input': { - outline: 'none', - border: 'none', - width: '100%', - flex: '1 1 auto', - padding: '5px 10px', - 'font-size': '1em', - position: 'relative', - fontFamily: 'monaco, Consolas, "Lucida Console", monospace', - - 'background-color': map.BACKGROUND_COLOR, - color: map.TEXT_COLOR, - - '&::-webkit-input-placeholder': { - color: map.TEXT_PLACEHOLDER_COLOR, - }, - - '&::-moz-placeholder': { - color: map.TEXT_PLACEHOLDER_COLOR, - }, - '&::-webkit-search-cancel-button': appearanceNone, - }, - }, - - closeButton: { - ...appearanceNone, - border: 'none', - outline: 'none', - boxShadow: 'none', - display: 'block', - flex: '0 0 auto', - cursor: 'pointer', - background: 'transparent', - position: 'relative', - fontSize: 'inherit', - '&[data-invisible="1"]': { - visibility: 'hidden !important', - }, - '&::after': { - content: '"\u00d7"', - display: 'block', - padding: 4, - fontSize: '1.2em', - color: map.TEXT_PLACEHOLDER_COLOR, - background: 'transparent', - }, - '&:hover::after': { - color: map.TEXT_COLOR, - }, - }, - - noApiFound: { - width: '100%', - textAlign: 'center', - color: map.TEXT_COLOR, - padding: '1.4em', - '& a': { - fontSize: 'inherit', - color: map.TEXT_COLOR, - textDecoration: 'underline', - }, - }, - - searchSelectLabel: { - display: 'inline-block', - padding: 4, - borderLeft: '1px solid currentColor', - }, - - queryPreview: { - flex: '1 1 50%', - overflowX: 'hidden', - oveflowY: 'auto', - display: 'flex', - 'flex-direction': 'column', - 'overflow-y': 'hidden', - '& pre': { - border: 'inherit', - 'border-radius': '3px', - 'line-height': 'inherit', - color: 'inherit', - }, - - 'background-color': map.BACKGROUND_COLOR, - }, - - previewHeader: { - flex: '0 0 30px', - padding: '5px 4px', - 'align-items': 'center', - 'border-bottom-width': '1px', - 'border-bottom-style': 'solid', - - 'background-color': map.HEADER_BACKGROUND_COLOR, - 'border-bottom-color': map.HEADER_BORDER_COLOR, - }, - - treeItemPin: { - 'font-size': '0.7em', - 'padding-left': '5px', - cursor: 'pointer', - '&:hover': { - 'text-decoration': 'underline', - }, - - color: map.PIN_COLOR, - }, - - treeItemKey: { - color: map.TEXT_PLACEHOLDER_COLOR, - }, - - treeWrapper: { - overflowX: 'auto', - overflowY: 'auto', - padding: '0.5em 1em', - }, - - tabContent: { - display: 'block', - overflowY: 'auto', - padding: '0.5em 0', - color: map.TAB_CONTENT_COLOR, - '& h2': { - color: map.ULIST_STRONG_COLOR, - padding: '0.5em 1em', - fontWeight: 700, - }, - '& h3': { - color: map.ULIST_STRONG_COLOR, - }, - }, - - uList: { - listStyle: 'none', - padding: '0 0 0 1em', - color: map.ULIST_COLOR, - '& > li': { - listStyle: 'none', - }, - '& > li::before': { - content: '"\\2022"', - display: 'inline-block', - paddingRight: '0.5em', - color: map.ULIST_DISC_COLOR, - fontSize: '0.8em', - }, - - '& strong': { - color: map.ULIST_STRONG_COLOR, - }, - }, - }; -}; +const getSheetFromColorMap = (map: ColorMap) => ({}); let themeSheet: StyleSheet; diff --git a/packages/redux-devtools-rtk-query-monitor/src/styles/tree.tsx b/packages/redux-devtools-rtk-query-monitor/src/styles/tree.tsx index 65b9237c..27ed90be 100644 --- a/packages/redux-devtools-rtk-query-monitor/src/styles/tree.tsx +++ b/packages/redux-devtools-rtk-query-monitor/src/styles/tree.tsx @@ -98,7 +98,9 @@ export function createTreeItemLabelRenderer( return function labelRenderer([key], nodeType, expanded) { return ( - {key} + ({ color: theme.TEXT_PLACEHOLDER_COLOR })}> + {key} + {!expanded && ': '} );