diff --git a/src/js/components/EditMenu/EditorSidebar/actions/ShortcodeInfo.tsx b/src/js/components/EditMenu/EditorSidebar/actions/ShortcodeInfo.tsx index 1782b3e2..5bf24339 100644 --- a/src/js/components/EditMenu/EditorSidebar/actions/ShortcodeInfo.tsx +++ b/src/js/components/EditMenu/EditorSidebar/actions/ShortcodeInfo.tsx @@ -109,6 +109,8 @@ const ModalContent = () => {

{__('Shortcode Options', 'code-snippets')}

+
+ { const { snippet, updateSnippet, setCurrentNotice } = useSnippetForm() return ( -

- {snippet.id - ? <> - {`${getPageHeading(snippet)} `} - - { - event.preventDefault() - updateSnippet(({ scope }) => createSnippetObject({ scope })) - setCurrentNotice(undefined) - - window.document.title = window.document.title - .replace(__('Edit Snippet', 'code-snippets'), getAddNewHeading(snippet)) - .replace(__('Edit Condition', 'code-snippets'), getAddNewHeading(snippet)) - - window.history.pushState({}, '', window.CODE_SNIPPETS?.urls.addNew) - }} - > - {_x('Add New', 'snippet', 'code-snippets')} - - - : getAddNewHeading(snippet)} - - {OPTIONS?.pageTitleActions && Object.entries(OPTIONS.pageTitleActions).map(([label, url]) => - <> - {label}{' '} - - )} -

+ <> +

+ {snippet.id + ? <> + {`${getPageHeading(snippet)} `} + + { + event.preventDefault() + updateSnippet(({ scope }) => createSnippetObject({ scope })) + setCurrentNotice(undefined) + + window.document.title = window.document.title + .replace(__('Edit Snippet', 'code-snippets'), getAddNewHeading(snippet)) + .replace(__('Edit Condition', 'code-snippets'), getAddNewHeading(snippet)) + + window.history.pushState({}, '', window.CODE_SNIPPETS?.urls.addNew) + }} + > + {_x('Add New', 'snippet', 'code-snippets')} + + + : getAddNewHeading(snippet)} + + {OPTIONS?.pageTitleActions && Object.entries(OPTIONS.pageTitleActions).map(([label, url]) => + <> + {label}{' '} + + )} +

+ +
+ ) } diff --git a/src/js/components/ImportMenu/ImportMenu.tsx b/src/js/components/ImportMenu/ImportMenu.tsx index ea61938c..94446274 100644 --- a/src/js/components/ImportMenu/ImportMenu.tsx +++ b/src/js/components/ImportMenu/ImportMenu.tsx @@ -39,6 +39,8 @@ export const ImportMenu: React.FC = () => { <>

{__('Import Snippets', 'code-snippets')}

+
+