Skip to content

Commit

Permalink
fix(ras-acc): remove social icons container conditional padding
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenn00dle committed Aug 14, 2024
1 parent a654998 commit 15045ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions includes/class-newspack-newsletters-renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -853,17 +853,14 @@ function ( $block ) {
'icon-size' => '24px',
'mode' => 'horizontal',
'border-radius' => '999px',
'icon-padding' => 'is-style-filled-primary-text' === $attrs['className'] ? '0px' : '7px',
'icon-padding' => isset( $attrs['className'] ) && 'is-style-filled-primary-text' === $attrs['className'] ? '0px' : '7px',
'padding' => '0',
);
if ( isset( $attrs['align'] ) ) {
$social_wrapper_attrs['align'] = $attrs['align'];
} else {
$social_wrapper_attrs['align'] = 'left';
}
if ( isset( $attrs['padding'] ) ) {
$social_wrapper_attrs['padding'] = $attrs['padding'];
}

$markup = '<mj-social ' . self::array_to_attributes( $social_wrapper_attrs ) . '>';
foreach ( $inner_blocks as $index => $link_block ) {
Expand Down
2 changes: 1 addition & 1 deletion tests/test-renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public function test_render_social_icons() {
'innerHTML' => '<div></div>',
]
),
'<mj-section padding="0"><mj-column padding="12px" width="100%"><mj-social icon-size="24px" mode="horizontal" padding="0" border-radius="999px" align="left"><mj-social-element href="https://x.com/hi" src="' . $plugin_path . 'assets/white-x.png" background-color="#000000" css-class="social-element" padding="8px" padding-left="0" padding-right="8px"/></mj-social></mj-column></mj-section>',
'<mj-section padding="0"><mj-column padding="12px" width="100%"><mj-social icon-size="24px" mode="horizontal" border-radius="999px" icon-padding="7px" padding="0" align="left"><mj-social-element href="https://x.com/hi" src="' . $plugin_path . 'assets/white-x.png" background-color="#000000" css-class="social-element" padding="8px" padding-left="0" padding-right="8px"/></mj-social></mj-column></mj-section>',
'Renders social icons'
);
}
Expand Down

0 comments on commit 15045ff

Please sign in to comment.