diff --git a/code/addons/controls/src/ControlsPanel.tsx b/code/addons/controls/src/ControlsPanel.tsx index 80feaa374b51..1834c0f2f30e 100644 --- a/code/addons/controls/src/ControlsPanel.tsx +++ b/code/addons/controls/src/ControlsPanel.tsx @@ -34,6 +34,7 @@ interface ControlsParameters { sort?: SortType; expanded?: boolean; presetColors?: PresetColor[]; + disableSave?: boolean; } interface ControlsPanelProps { @@ -46,7 +47,12 @@ export const ControlsPanel = ({ saveStory, createStory }: ControlsPanelProps) => const [args, updateArgs, resetArgs, initialArgs] = useArgs(); const [globals] = useGlobals(); const rows = useArgTypes(); - const { expanded, sort, presetColors } = useParameter(PARAM_KEY, {}); + const { + expanded, + sort, + presetColors, + disableSave = false, + } = useParameter(PARAM_KEY, {}); const { path, previewInitialized } = useStorybookState(); // If the story is prepared, then show the args table @@ -70,6 +76,8 @@ export const ControlsPanel = ({ saveStory, createStory }: ControlsPanelProps) => [args, initialArgs] ); + console.log({ disableSave }); + return ( sort={sort} isLoading={isLoading} /> - {hasControls && hasUpdatedArgs && global.CONFIG_TYPE === 'DEVELOPMENT' && ( - - )} + {hasControls && + hasUpdatedArgs && + global.CONFIG_TYPE === 'DEVELOPMENT' && + disableSave !== true && } ); }; diff --git a/docs/essentials/controls.mdx b/docs/essentials/controls.mdx index 3c249c058e04..271cd3e17aaf 100644 --- a/docs/essentials/controls.mdx +++ b/docs/essentials/controls.mdx @@ -260,6 +260,12 @@ You can also update a control's value, then save the changes to the story. The s