Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RNMobile] Add block outline to all Social Link blocks when selected #54011

Merged
merged 3 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading