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] Remove parent block's icon from floating toolbar #30304

Closed
Closed
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 @@ -4,7 +4,6 @@
import { Icon } from '@wordpress/components';
import { withSelect } from '@wordpress/data';
import { compose } from '@wordpress/compose';
import { getBlockType } from '@wordpress/blocks';

/**
* External dependencies
Expand All @@ -16,16 +15,10 @@ import { View, Text, TouchableOpacity } from 'react-native';
*/
import BlockTitle from '../block-title';
import useBlockDisplayInformation from '../use-block-display-information';
import SubdirectorSVG from './subdirectory-icon';
import { store as blockEditorStore } from '../../store';
import styles from './block-selection-button.scss';

const BlockSelectionButton = ( {
clientId,
rootClientId,
rootBlockIcon,
isRTL,
} ) => {
const BlockSelectionButton = ( { clientId, rootClientId } ) => {
const blockInformation = useBlockDisplayInformation( clientId );
return (
<View
Expand All @@ -43,21 +36,6 @@ const BlockSelectionButton = ( {
true
} /* Disable temporarily since onPress function is empty */
>
{ rootClientId &&
rootBlockIcon && [
<Icon
key="parent-icon"
size={ 24 }
icon={ rootBlockIcon.src }
fill={ styles.icon.color }
/>,
<View key="subdirectory-icon" style={ styles.arrow }>
<SubdirectorSVG
fill={ styles.arrow.color }
isRTL={ isRTL }
/>
</View>,
] }
<Icon
size={ 24 }
icon={ blockInformation?.icon?.src }
Expand All @@ -78,23 +56,16 @@ const BlockSelectionButton = ( {

export default compose( [
withSelect( ( select, { clientId } ) => {
const { getBlockRootClientId, getBlockName, getSettings } = select(
blockEditorStore
);
const { getBlockRootClientId } = select( blockEditorStore );
const rootClientId = getBlockRootClientId( clientId );

if ( ! rootClientId ) {
return { clientId };
}
const rootBlockName = getBlockName( rootClientId );
const rootBlockType = getBlockType( rootBlockName );
const rootBlockIcon = rootBlockType ? rootBlockType.icon : {};

return {
clientId,
rootClientId,
rootBlockIcon,
isRTL: getSettings().isRTL,
};
} ),
] )( BlockSelectionButton );

This file was deleted.