actionPreview

This commit is contained in:
Nathan Bierema 2023-12-11 20:18:49 -05:00
parent 6f7649b169
commit e85caa5759
2 changed files with 17 additions and 16 deletions

View File

@ -10,6 +10,7 @@ import ActionPreviewHeader from './ActionPreviewHeader';
import DiffTab from './tabs/DiffTab'; import DiffTab from './tabs/DiffTab';
import StateTab from './tabs/StateTab'; import StateTab from './tabs/StateTab';
import ActionTab from './tabs/ActionTab'; import ActionTab from './tabs/ActionTab';
import { actionPreviewCss } from './utils/createStylingFromTheme';
export interface TabComponentProps<S, A extends Action<string>> { export interface TabComponentProps<S, A extends Action<string>> {
labelRenderer: LabelRenderer; labelRenderer: LabelRenderer;
@ -121,7 +122,7 @@ class ActionPreview<S, A extends Action<string>> extends Component<
renderedTabs.find((tab) => tab.name === DEFAULT_STATE.tabName)!; renderedTabs.find((tab) => tab.name === DEFAULT_STATE.tabName)!;
return ( return (
<div key="actionPreview" {...styling('actionPreview')}> <div key="actionPreview" css={actionPreviewCss}>
<ActionPreviewHeader <ActionPreviewHeader
tabs={renderedTabs as unknown as Tab<unknown, Action<string>>[]} tabs={renderedTabs as unknown as Tab<unknown, Action<string>>[]}
{...{ styling, inspectedPath, onInspectPath, tabName, onSelectTab }} {...{ styling, inspectedPath, onInspectPath, tabName, onSelectTab }}

View File

@ -184,24 +184,24 @@ export const actionListHeaderWrapperCss = css({
height: '20px', height: '20px',
}); });
const getSheetFromColorMap = (map: ColorMap) => ({ export const actionPreviewCss: Interpolation<Theme> = (theme) => ({
actionPreview: {
flex: 1, flex: 1,
display: 'flex', display: 'flex',
'flex-direction': 'column', flexDirection: 'column',
'flex-grow': 1, flexGrow: 1,
'overflow-y': 'hidden', overflowY: 'hidden',
'& pre': { '& pre': {
border: 'inherit', border: 'inherit',
'border-radius': '3px', borderRadius: '3px',
'line-height': 'inherit', lineHeight: 'inherit',
color: 'inherit', color: 'inherit',
}, },
'background-color': map.BACKGROUND_COLOR, backgroundColor: colorMap(theme).BACKGROUND_COLOR,
}, });
const getSheetFromColorMap = (map: ColorMap) => ({
actionPreviewContent: { actionPreviewContent: {
flex: 1, flex: 1,
'overflow-y': 'auto', 'overflow-y': 'auto',