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 outline around selected Social Link block #53377

Merged
merged 4 commits into from
Aug 9, 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 TEXT_BLOCKS_WITH_OUTLINE = [ 'core/missing' ];
const BLOCKS_WITH_OUTLINE = [ 'core/social-link', 'core/missing' ];

function BlockOutline( {
blockCategory,
Expand All @@ -22,7 +22,7 @@ function BlockOutline( {
isSelected,
name,
} ) {
const textBlockWithOutline = TEXT_BLOCKS_WITH_OUTLINE.includes( name );
const textBlockWithOutline = BLOCKS_WITH_OUTLINE.includes( name );
const hasBlockTextCategory =
blockCategory === 'text' && ! textBlockWithOutline;
const hasBlockMediaCategory =
Expand Down
3 changes: 2 additions & 1 deletion packages/block-library/src/social-link/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const SocialLinkEdit = ( {
toValue: 1,
duration: ANIMATION_DURATION,
easing: Easing.circle,
useNativeDriver: false,
Copy link
Member Author

Choose a reason for hiding this comment

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

When using Animated, it is required to specify the value of useNativeDriver. This change suppresses the LogBox warning:

Animated: useNativeDriver was not specified. This is a required option and must be explicitly set to true or false.

} ),
] ).start( () => setHasUrl( true ) );
}
Expand Down Expand Up @@ -157,7 +158,7 @@ const SocialLinkEdit = ( {
);

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

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

.linkSettingsPanel {
padding-left: 0;
padding-right: 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/social-links/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function SocialLinksEdit( {
}, [ shouldRenderFooterAppender ] );

const renderFooterAppender = useRef( () => (
<View>
<View style={ styles.footerAppenderContainer }>
<InnerBlocks.ButtonBlockAppender isFloating={ true } />
</View>
) );
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/social-links/editor.native.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@
flex-direction: row;
flex-wrap: wrap;
}

.footerAppenderContainer {
margin: $block-selected-margin 0;
}
1 change: 1 addition & 0 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ For each user feature we should also add a importance categorization label to i

## Unreleased
- [*] Display custom color value in mobile Cover Block color picker [#51414]
- [**] Display outline around selected Social Link block [#51414]

## 1.101.0
- [*] Remove visual gap in mobile toolbar when a Gallery block is selected [#52966]
Expand Down