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

Style quotes in the mobile app #15990

Merged
merged 4 commits into from
Jun 5, 2019
Merged
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 @@ -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' ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about why you need to test for child, is there any chance of that being null/undefined?

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;
}