File tree Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -359,21 +359,22 @@ import { useDispatch } from 'react-redux';
359359import { setSidebarTab, setMetadataFocus } from '@plone/volto/actions';
360360
361361const MyComponent = (/* ... */) => {
362+ // ...
363+ const dispatch = useDispatch();
364+ // ...
365+
366+ return (
362367 // ...
363- const dispatch = useDispatch();
368+ <button
369+ onClick={() => {
370+ dispatch(setSidebarTab(0));
371+ dispatch(setMetadataFocus("ownership", "allow_discussion"));
372+ }}
373+ >
374+ This button will change the sidebar to the content form and focus
375+ ownership fieldset and the allow_discussion field
376+ </button>
364377 // ...
365-
366- return (
367- // ...
368- <button
369- onClick={() => {
370- dispatch(setSidebarTab(0));
371- dispatch(setMetadataFocus('ownership', 'allow_discussion'));
372- }}
373- >
374- This button will change the sidebar to the content form and focus ownership fieldset and the allow_discussion field
375- </button>
376- // ...
377- );
378+ );
378379};
379380` ` `
You can’t perform that action at this time.
0 commit comments