Skip to content

Commit 5eefef6

Browse files
committed
Remove the hidding of the post title and the rename command
1 parent 2801f02 commit 5eefef6

File tree

4 files changed

+5
-205
lines changed

4 files changed

+5
-205
lines changed

projects/packages/forms/src/blocks/contact-form/editor.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb;
22

3-
// Hide the post title for jetpack_form post type
4-
.post-type-jetpack_form .edit-post-visual-editor__post-title-wrapper,
5-
.post-type-jetpack_form .editor-post-title,
6-
.post-type-jetpack_form .editor-post-title__input,
7-
.post-type-jetpack_form .editor-visual-editor__post-title-wrapper {
8-
display: none !important;
9-
}
10-
113
.wp-block-jetpack-contact-form {
124
box-sizing: border-box;
135

projects/packages/forms/src/form-editor/index.tsx

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
*/
99

1010
import { subscribe, select, dispatch } from '@wordpress/data';
11-
import { unregisterPlugin, registerPlugin } from '@wordpress/plugins';
11+
import { unregisterPlugin } from '@wordpress/plugins';
1212
import { FORM_POST_TYPE } from '../blocks/shared/util/constants.js';
13-
import { useFormRenameCommand } from './use-form-rename-command.tsx';
1413
import {
1514
findFormBlock,
1615
getInsertionIndex,
@@ -24,21 +23,6 @@ import {
2423

2524
import './style.scss';
2625

27-
/**
28-
* Form Rename Command Component
29-
* Renders the rename modal and registers the command
30-
*
31-
* @return {JSX.Element|null} The rename modal component or null
32-
*/
33-
function FormRenameCommand() {
34-
return useFormRenameCommand();
35-
}
36-
37-
// Register the rename command plugin
38-
registerPlugin( 'jetpack-form-rename-command', {
39-
render: FormRenameCommand,
40-
} );
41-
4226
/**
4327
* Move the Jetpack contact form block category to the front in the editor.
4428
*/
@@ -101,7 +85,6 @@ const lockFormBlock = () => {
10185
}
10286

10387
if ( shouldLockBlock( formBlock ) ) {
104-
// Lock the block to prevent removal and moving
10588
updateBlockAttributes( formBlockClientId, {
10689
lock: {
10790
remove: true,
@@ -199,9 +182,6 @@ const setupFormEditorSubscription = () => {
199182
const { getCurrentPostType } = select( 'core/editor' );
200183
const isCurrentPostTypeJetpackForm = getCurrentPostType() === FORM_POST_TYPE;
201184
if ( isCurrentPostTypeJetpackForm ) {
202-
if ( ! formBlockClientId ) {
203-
locateFormBlock(); // Locate the form block if we haven't
204-
}
205185
// Check if root blocks changed by comparing their IDs
206186
// This detects when blocks are added, removed, or reordered at the root level
207187
const { getBlocks } = select( 'core/block-editor' );
@@ -235,6 +215,10 @@ const setupFormEditorSubscription = () => {
235215
}
236216
}
237217

218+
if ( ! formBlockClientId ) {
219+
locateFormBlock();
220+
}
221+
238222
if ( ! categoriesFiltered ) {
239223
categoriesFiltered = true;
240224
moveFormsCategoryToFront();

projects/packages/forms/src/form-editor/style.scss

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,3 @@
99
.post-type-jetpack_form .block-editor-block-list__layout .block-editor-block-list__block.is-selected {
1010
box-shadow: none;
1111
}
12-
13-
// Rename modal styles
14-
.jetpack-forms-rename-modal {
15-
16-
.components-modal__content {
17-
padding: 24px;
18-
min-width: 400px;
19-
}
20-
21-
.components-text-control__input {
22-
margin-bottom: 24px;
23-
}
24-
25-
&__actions {
26-
display: flex;
27-
justify-content: flex-end;
28-
gap: 12px;
29-
margin-top: 24px;
30-
}
31-
}

projects/packages/forms/src/form-editor/use-form-rename-command.tsx

Lines changed: 0 additions & 156 deletions
This file was deleted.

0 commit comments

Comments
 (0)