Skip to content

Commit d2350e9

Browse files
t-hamanoaristath
authored andcommitted
Remove unnecessary styles and classes
1 parent 9071750 commit d2350e9

File tree

2 files changed

+3
-62
lines changed

2 files changed

+3
-62
lines changed

packages/block-library/src/form/edit.js

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ import {
77
useBlockProps,
88
useInnerBlocksProps,
99
InspectorControls,
10-
__experimentalUseBorderProps as useBorderProps,
11-
__experimentalUseColorProps as useColorProps,
12-
__experimentalGetSpacingClassesAndStyles as useSpacingProps,
13-
getTypographyClassesAndStyles as useTypographyProps,
1410
store as blockEditorStore,
1511
} from '@wordpress/block-editor';
1612
import { TextControl, SelectControl, PanelBody } from '@wordpress/components';
@@ -24,11 +20,6 @@ import {
2420
formSubmissionNotificationError,
2521
} from './utils.js';
2622

27-
/**
28-
* External dependencies
29-
*/
30-
import classNames from 'classnames';
31-
3223
const ALLOWED_BLOCKS = [
3324
'core/paragraph',
3425
'core/heading',
@@ -69,7 +60,7 @@ const TEMPLATE = [
6960
[ 'core/form-submit-button', {} ],
7061
];
7162

72-
const Edit = ( { attributes, setAttributes, className, clientId } ) => {
63+
const Edit = ( { attributes, setAttributes, clientId } ) => {
7364
const { action, method, email, submissionMethod } = attributes;
7465
const blockProps = useBlockProps();
7566

@@ -92,11 +83,6 @@ const Edit = ( { attributes, setAttributes, className, clientId } ) => {
9283
: InnerBlocks.ButtonBlockAppender,
9384
} );
9485

95-
const borderProps = useBorderProps( attributes );
96-
const colorProps = useColorProps( attributes );
97-
const spacingProps = useSpacingProps( attributes );
98-
const typographyProps = useTypographyProps( attributes );
99-
10086
return (
10187
<>
10288
<InspectorControls>
@@ -186,20 +172,6 @@ const Edit = ( { attributes, setAttributes, className, clientId } ) => {
186172
) }
187173
<form
188174
{ ...innerBlocksProps }
189-
style={ {
190-
...borderProps.style,
191-
...colorProps.style,
192-
...spacingProps.style,
193-
...typographyProps.style,
194-
} }
195-
className={ classNames(
196-
className,
197-
'wp-block-form',
198-
colorProps.className,
199-
borderProps.className,
200-
spacingProps.className,
201-
typographyProps.className
202-
) }
203175
encType={ submissionMethod === 'email' ? 'text/plain' : null }
204176
/>
205177
</>

packages/block-library/src/form/save.js

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,15 @@
11
/**
22
* WordPress dependencies
33
*/
4-
import {
5-
InnerBlocks,
6-
useBlockProps,
7-
__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,
8-
__experimentalGetColorClassesAndStyles as getColorClassesAndStyles,
9-
__experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles,
10-
getTypographyClassesAndStyles as useTypographyProps,
11-
} from '@wordpress/block-editor';
4+
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';
125

13-
/**
14-
* External dependencies
15-
*/
16-
import classNames from 'classnames';
17-
18-
const Save = ( { attributes, className } ) => {
6+
const Save = ( { attributes } ) => {
197
const blockProps = useBlockProps.save();
208
const { submissionMethod } = attributes;
219

22-
const borderProps = getBorderClassesAndStyles( attributes );
23-
const colorProps = getColorClassesAndStyles( attributes );
24-
const spacingProps = getSpacingClassesAndStyles( attributes );
25-
const typographyProps = useTypographyProps( attributes );
26-
2710
return (
2811
<form
2912
{ ...blockProps }
30-
style={ {
31-
...borderProps.style,
32-
...colorProps.style,
33-
...spacingProps.style,
34-
...typographyProps.style,
35-
} }
36-
className={ classNames(
37-
className,
38-
'wp-block-form',
39-
colorProps.className,
40-
borderProps.className,
41-
spacingProps.className,
42-
typographyProps.className
43-
) }
4413
encType={ submissionMethod === 'email' ? 'text/plain' : null }
4514
>
4615
<InnerBlocks.Content />

0 commit comments

Comments
 (0)