Skip to content

Commit

Permalink
[Mobile] EmptyList now uses useEditorWrapperStyles hook and removes…
Browse files Browse the repository at this point in the history
… `ReadableContentView` (#50552)

* Mobile - BlockList - EmptyList: Use useEditorWrapperStyles hook instead of ReadableContentView

* Mobile - Remove ReadableContentView component
  • Loading branch information
Gerardo Pacheco authored May 12, 2023
1 parent 07b87a1 commit f6291fc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 129 deletions.
24 changes: 11 additions & 13 deletions packages/block-editor/src/components/block-list/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { useSelect, useDispatch } from '@wordpress/data';
import { createBlock } from '@wordpress/blocks';
import {
KeyboardAwareFlatList,
ReadableContentView,
WIDE_ALIGNMENTS,
alignmentHelpers,
} from '@wordpress/components';
Expand All @@ -29,6 +28,7 @@ import {
DEFAULT_BLOCK_LIST_CONTEXT,
} from './block-list-context';
import { BlockDraggableWrapper } from '../block-draggable';
import { useEditorWrapperStyles } from '../../hooks/use-editor-wrapper-styles';
import { store as blockEditorStore } from '../../store';

const identity = ( x ) => x;
Expand Down Expand Up @@ -423,24 +423,22 @@ function EmptyList( {
! blockClientIds[ insertionPoint.index ] ),
};
} );
const align = renderAppender ? WIDE_ALIGNMENTS.alignments.full : undefined;
const [ wrapperStyles ] = useEditorWrapperStyles( { align } );

if ( renderFooterAppender || renderAppender === false ) {
return null;
}

const containerStyles = [ styles.defaultAppender, wrapperStyles ];

return (
<View style={ styles.defaultAppender }>
<ReadableContentView
align={
renderAppender ? WIDE_ALIGNMENTS.alignments.full : undefined
}
>
<BlockListAppender
rootClientId={ rootClientId }
renderAppender={ renderAppender }
showSeparator={ shouldShowInsertionPoint }
/>
</ReadableContentView>
<View style={ containerStyles }>
<BlockListAppender
rootClientId={ rootClientId }
renderAppender={ renderAppender }
showSeparator={ shouldShowInsertionPoint }
/>
</View>
);
}
1 change: 0 additions & 1 deletion packages/components/src/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ export { default as HTMLTextInput } from './mobile/html-text-input';
export { default as KeyboardAvoidingView } from './mobile/keyboard-avoiding-view';
export { default as KeyboardAwareFlatList } from './mobile/keyboard-aware-flat-list';
export { default as Picker } from './mobile/picker';
export { default as ReadableContentView } from './mobile/readable-content-view';
export { default as CycleSelectControl } from './mobile/cycle-select-control';
export { default as Gradient } from './mobile/gradient';
export { default as ColorSettings } from './mobile/color-settings';
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit f6291fc

Please sign in to comment.