Skip to content

Commit 66cfa19

Browse files
authored
Merge pull request #144 from alleyinteractive/feature/LEDE-2667/wp-cleanup-spacing
LEDE-2667 Remove Footer Divider & Spacing on Various Blocks
2 parents c1092bd + 4b94306 commit 66cfa19

File tree

17 files changed

+31
-33
lines changed

17 files changed

+31
-33
lines changed

blocks/footer/edit.tsx

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/
55
*/
66
import { __ } from '@wordpress/i18n';
7-
import classNames from 'classnames';
87

98
/**
109
* React hook that is used to mark the block wrapper element.
@@ -19,12 +18,6 @@ import { Spinner } from '@wordpress/components';
1918
import { useSelect } from '@wordpress/data';
2019
import { useEffect, useState } from '@wordpress/element';
2120

22-
interface EditProps {
23-
attributes: {
24-
narrow_separator: boolean,
25-
};
26-
}
27-
2821
interface FooterSettings {
2922
facebook_url: string,
3023
twitter_url: string,
@@ -42,11 +35,7 @@ interface FooterSettings {
4235
*
4336
* @return {WPElement} Element to render.
4437
*/
45-
export default function Edit({
46-
attributes: {
47-
narrow_separator: narrowSeparator = false,
48-
},
49-
}: EditProps) {
38+
export default function Edit() {
5039
const [isLoading, setIsLoading] = useState(true);
5140
const [footerSettings, setFooterSettings] = useState<FooterSettings>();
5241

@@ -79,10 +68,6 @@ export default function Edit({
7968

8069
return (
8170
<div {...useBlockProps()}>
82-
<hr className={
83-
classNames('wp-block-separator', 'has-alpha-channel-opacity', { 'is-style-wide': !narrowSeparator })
84-
}
85-
/>
8671
{isLoading
8772
? (
8873
/* @ts-ignore */

blocks/footer/render.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@
1818
$nb_image_id = $nb_footer_settings['image'] ?? 0;
1919
$nb_address = $nb_footer_settings['address'] ?? '';
2020
$nb_has_social_links = ! empty( $nb_facebook_url ) || ! empty( $nb_twitter_url ) || ! empty( $nb_instagram_url ) || ! empty( $nb_youtube_url );
21-
$nb_narrow_separator = ! empty( $attributes['narrow_separator'] );
22-
$nb_separator_class = $nb_narrow_separator ? '' : 'is-style-wide';
2321
?>
2422
<div <?php echo wp_kses_data( get_block_wrapper_attributes() ); ?> align="center">
25-
<hr class="wp-block-separator has-alpha-channel-opacity <?php echo esc_attr( $nb_separator_class ); ?>" />
26-
2723
<?php if ( $nb_has_social_links ) : ?>
2824
<div class="wp-block-wp-newsletter-builder-footer__social-links">
2925
<?php if ( ! empty( $nb_facebook_url ) ) : ?>

blocks/header/style.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
*/
1313

1414
.wp-block-wp-newsletter-builder-header {
15-
margin-bottom: 20px;
16-
margin-top: 6px;
1715
// @TODO: style alt text.
1816

1917
&__placeholder {

blocks/heading/edit.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default function Edit({
6161
/>
6262
</PanelBody>
6363
</InspectorControls>
64-
<div {...useBlockProps({ className: 'newsletter-heading', style: headingStyles })}>
64+
<div {...useBlockProps({ className: 'wp-block-wp-newsletter-builder-heading', style: headingStyles })}>
6565
<InnerBlocks
6666
// @ts-ignore
6767
template={TEMPLATE}

blocks/heading/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';
1313
*
1414
* @see https://www.npmjs.com/package/@wordpress/scripts#using-css
1515
*/
16-
// Uncomment this line if you want to import a CSS file for this block.
17-
// import './style.scss';
16+
import './style.scss';
1817

1918
/**
2019
* Internal dependencies

blocks/heading/style.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.wp-block-wp-newsletter-builder-heading {
2+
h1, h2, h3, h4, h5, h6 {
3+
margin: 0;
4+
}
5+
}

blocks/list/edit.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default function Edit({
6161
/>
6262
</PanelBody>
6363
</InspectorControls>
64-
<div {...useBlockProps({ className: 'newsletter-list', style: listStyles })}>
64+
<div {...useBlockProps({ className: 'wp-block-wp-newsletter-builder-list', style: listStyles })}>
6565
<InnerBlocks
6666
// @ts-ignore
6767
template={TEMPLATE}

blocks/list/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';
1313
*
1414
* @see https://www.npmjs.com/package/@wordpress/scripts#using-css
1515
*/
16-
// Uncomment this line if you want to import a CSS file for this block.
17-
// import './style.scss';
16+
import './style.scss';
1817

1918
/**
2019
* Internal dependencies

blocks/list/style.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.wp-block-wp-newsletter-builder-list {
2+
ul, ol {
3+
margin: 0;
4+
}
5+
}

blocks/paragraph/edit.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default function Edit({
6161
/>
6262
</PanelBody>
6363
</InspectorControls>
64-
<div {...useBlockProps({ className: 'newsletter-paragraph', style: paragraphStyles })}>
64+
<div {...useBlockProps({ className: 'wp-block-wp-newsletter-builder-paragraph', style: paragraphStyles })}>
6565
<InnerBlocks
6666
// @ts-ignore
6767
template={TEMPLATE}

0 commit comments

Comments
 (0)