Skip to content

Commit

Permalink
Style quotes in the mobile app (#15990)
Browse files Browse the repository at this point in the history
* Add spacer between BlockQuotation elements.

* Use citation identifier to style rich-text

* Remove margin on quote bar.
  • Loading branch information
SergioEstevao authored Jun 5, 2019
1 parent 941c6ec commit 0f2b948
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ export class RichText extends Component {
color={ 'black' }
maxImagesWidth={ 200 }
fontFamily={ this.props.fontFamily || styles[ 'block-editor-rich-text' ].fontFamily }
fontSize={ this.props.fontSize }
fontSize={ this.props.fontSize || ( style && style.fontSize ) }
fontWeight={ this.props.fontWeight }
fontStyle={ this.props.fontStyle }
disableEditingMenu={ this.props.disableEditingMenu }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,25 @@
* External dependencies
*/
import { View } from 'react-native';
/**
* WordPress dependencies
*/
import { Children, cloneElement } from '@wordpress/element';
/**
* Internal dependencies
*/
import styles from './style.scss';

export const BlockQuotation = ( props ) => {
const newChildren = Children.map( props.children, ( child ) => {
if ( child && child.props.identifier === 'citation' ) {
return cloneElement( child, { style: styles.wpBlockQuoteCitation } );
}
return child;
} );
return (
<View style={ styles.wpBlockQuote } >
{ props.children }
{ newChildren }
</View>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
border-left-color: $black;
border-left-style: solid;
padding-left: 8px;
margin-left: 8px;
margin-left: 0;
}

.wpBlockQuoteCitation {
margin-top: 16px;
font-size: 14px;
}

0 comments on commit 0f2b948

Please sign in to comment.