Skip to content

Commit

Permalink
[RNMobile] Add block outline to all Social Link blocks when selected (#…
Browse files Browse the repository at this point in the history
…54011)

* Update native block outline component to outline all social-link blocks

* Remove unneeded container style prop

* Update CHANGELOG
  • Loading branch information
derekblank committed Aug 30, 2023
1 parent 5dbe0da commit 8c165c1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { usePreferredColorSchemeStyle } from '@wordpress/compose';
*/
import styles from './block.scss';

const BLOCKS_WITH_OUTLINE = [ 'core/social-link', 'core/missing' ];
const TEXT_BLOCKS_WITH_OUTLINE = [ 'core/missing' ];

function BlockOutline( {
blockCategory,
Expand All @@ -22,7 +22,9 @@ function BlockOutline( {
isSelected,
name,
} ) {
const textBlockWithOutline = BLOCKS_WITH_OUTLINE.includes( name );
const textBlockWithOutline = TEXT_BLOCKS_WITH_OUTLINE.includes( name );
const socialBlockWithOutline = name.includes( 'core/social-link' );

const hasBlockTextCategory =
blockCategory === 'text' && ! textBlockWithOutline;
const hasBlockMediaCategory =
Expand All @@ -47,6 +49,7 @@ function BlockOutline( {
( ( hasBlockTextCategory && hasInnerBlocks ) ||
( ! hasBlockTextCategory && hasInnerBlocks ) ||
( ! hasBlockTextCategory && isRootList ) ||
socialBlockWithOutline ||
textBlockWithOutline );

return (
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/social-link/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const SocialLinkEdit = ( {
);

return (
<View style={ styles.container }>
<View>
{ isSelected && (
<>
<BlockControls>
Expand Down
4 changes: 0 additions & 4 deletions packages/block-library/src/social-link/editor.native.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
@import "./socials-with-bg.scss";

.container {
margin: $block-selected-margin;
}

.linkSettingsPanel {
padding-left: 0;
padding-right: 0;
Expand Down
1 change: 1 addition & 0 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ For each user feature we should also add a importance categorization label to i
- [*] Search Control - Prevent calling TextInput's methods when undefined [#53745]
- [*] Improve horizontal rule styles to avoid invisible lines [#53883]
- [*] Fix horizontal rule style extensions [#53917]
- [*] Add block outline to all Social Link blocks when selected [#54011]

## 1.102.1
- [**] Fix Voice Over and assistive keyboards [#53895]
Expand Down

1 comment on commit 8c165c1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 8c165c1.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6018933171
📝 Reported issues:

Please sign in to comment.