Skip to content

Commit

Permalink
rnmobile/enabling alignment from aztec android (#21803)
Browse files Browse the repository at this point in the history
* Enabling heading alignment on Android

* Passing alignment prop for mobile on quote block

* Passing align prop in verse block for use on mobile
  • Loading branch information
mchowning authored Apr 24, 2020
1 parent 3f938e4 commit a3b7ef6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
19 changes: 6 additions & 13 deletions packages/block-library/src/heading/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ import { Platform } from '@wordpress/element';
function HeadingEdit( { attributes, setAttributes, mergeBlocks, onReplace } ) {
const { align, content, level, placeholder, style } = attributes;
const tagName = 'h' + level;
const isAndroid = Platform.select( {
android: true,
native: false,
web: false,
} );

const styles = {
color: style && style.color && style.color.text,
Expand All @@ -47,14 +42,12 @@ function HeadingEdit( { attributes, setAttributes, mergeBlocks, onReplace } ) {
setAttributes( { level: newLevel } )
}
/>
{ ! isAndroid && (
<AlignmentToolbar
value={ align }
onChange={ ( nextAlign ) => {
setAttributes( { align: nextAlign } );
} }
/>
) }
<AlignmentToolbar
value={ align }
onChange={ ( nextAlign ) => {
setAttributes( { align: nextAlign } );
} }
/>
</BlockControls>
{ Platform.OS === 'web' && (
<InspectorControls>
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/quote/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export default function QuoteEdit( {
__unstableOnSplitMiddle={ () =>
createBlock( 'core/paragraph' )
}
textAlign={ align }
/>
{ ( ! RichText.isEmpty( citation ) || isSelected ) && (
<RichText
Expand All @@ -87,6 +88,7 @@ export default function QuoteEdit( {
__( 'Write citation…' )
}
className="wp-block-quote__citation"
textAlign={ align }
/>
) }
</BlockQuotation>
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/verse/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default function VerseEdit( {
[ `has-text-align-${ textAlign }` ]: textAlign,
} ) }
onMerge={ mergeBlocks }
textAlign={ textAlign }
/>
</>
);
Expand Down

0 comments on commit a3b7ef6

Please sign in to comment.