Skip to content

Commit

Permalink
s/inputsActionOrder/actionOrder
Browse files Browse the repository at this point in the history
  • Loading branch information
ovidiuch committed Mar 2, 2024
1 parent 6ed0909 commit 196eb1a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import { SetInputsFixtureState } from './shared.js';

type Props = {
fixtureState: InputsFixtureState | undefined;
inputsActionOrder: string[];
actionOrder: string[];
onFixtureStateChange: SetInputsFixtureState;
};

export function InputsPanel({
fixtureState,
inputsActionOrder,
actionOrder,
onFixtureStateChange,
}: Props) {
const handleInputsReset = React.useCallback(
Expand All @@ -44,10 +44,7 @@ export function InputsPanel({
disabled={areInputsUnchanged(inputs)}
onClick={handleInputsReset}
/>
<InputsActionSlot
slotProps={{ inputs }}
plugOrder={inputsActionOrder}
/>
<InputsActionSlot slotProps={{ inputs }} plugOrder={actionOrder} />
</SidePanelActions>
</SidePanelHeader>
<SidePanelBody>
Expand Down
6 changes: 3 additions & 3 deletions packages/react-cosmos-ui/src/plugins/InputsPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import { InputsPanelSpec } from './spec.js';
const { namedPlug, register } = createPlugin<InputsPanelSpec>({
name: 'inputsPanel',
defaultConfig: {
inputsActionOrder: [],
actionOrder: [],
},
});

namedPlug<SidePanelRowSlotProps>(
'sidePanelRow',
'values',
({ pluginContext, slotProps }) => {
const { inputsActionOrder } = pluginContext.getConfig();
const { actionOrder } = pluginContext.getConfig();
const { getFixtureState, setFixtureState } = slotProps;

const fixtureState = getFixtureState<InputsFixtureState>('inputs');
Expand All @@ -29,7 +29,7 @@ namedPlug<SidePanelRowSlotProps>(
return (
<InputsPanel
fixtureState={fixtureState}
inputsActionOrder={inputsActionOrder}
actionOrder={actionOrder}
onFixtureStateChange={onFixtureStateChange}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/react-cosmos-ui/src/plugins/InputsPanel/spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type InputsPanelSpec = {
name: 'inputsPanel';
config: {
inputsActionOrder: string[];
actionOrder: string[];
};
};
2 changes: 1 addition & 1 deletion packages/react-cosmos-ui/src/shared/defaultPluginConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export const DEFAULT_PLUGIN_CONFIG = {
rendererActionOrder: ['openFixture', 'fullScreen', 'responsivePreview'],
},
inputsPanel: {
inputsActionOrder: ['expandCollapse'],
actionOrder: ['expandCollapse'],
},
};

0 comments on commit 196eb1a

Please sign in to comment.