Skip to content

Commit

Permalink
[RNMobile] Add content alignment options to paragraph block
Browse files Browse the repository at this point in the history
  • Loading branch information
mchowning committed Nov 5, 2019
1 parent bb0529f commit 23274e6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.

This file was deleted.

15 changes: 13 additions & 2 deletions packages/block-library/src/paragraph/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { View } from 'react-native';
import { __ } from '@wordpress/i18n';
import { Component } from '@wordpress/element';
import { createBlock } from '@wordpress/blocks';
import { RichText } from '@wordpress/block-editor';
import { AlignmentToolbar, BlockControls, RichText } from '@wordpress/block-editor';

/**
* Internal dependencies
Expand Down Expand Up @@ -47,12 +47,22 @@ class ParagraphEdit extends Component {
} = this.props;

const {
placeholder,
align,
content,
placeholder,
} = attributes;

return (
<View>
<BlockControls>
<AlignmentToolbar
isCollapsed={ false }
value={ align }
onChange={ ( nextAlign ) => {
setAttributes( { align: nextAlign } );
} }
/>
</BlockControls>
<RichText
identifier="content"
tagName="p"
Expand All @@ -78,6 +88,7 @@ class ParagraphEdit extends Component {
onReplace={ onReplace }
onRemove={ onReplace ? () => onReplace( [] ) : undefined }
placeholder={ placeholder || __( 'Start writing…' ) }
textAlign={ align }
/>
</View>
);
Expand Down

0 comments on commit 23274e6

Please sign in to comment.