Skip to content

Commit

Permalink
[Native mobile] Bring release v1.0.1 back to "mobile develop" (#14075)
Browse files Browse the repository at this point in the history
* Don't allow placeholder to moves once we tap on it (#14066)

* Use platform based SCSS vars for block minHeight (#14070)
  • Loading branch information
hypest authored Feb 24, 2019
1 parent 987a5a4 commit 926ed3f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
7 changes: 4 additions & 3 deletions packages/block-library/src/heading/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ import { createBlock } from '@wordpress/blocks';
/**
* Internal dependencies
*/
import './editor.scss';

const minHeight = 24;
import styles from './style.scss';

class HeadingEdit extends Component {
constructor( props ) {
Expand All @@ -47,6 +45,9 @@ class HeadingEdit extends Component {
} = attributes;

const tagName = 'h' + level;

const minHeight = styles.blockText.minHeight;

return (
<View>
<BlockControls>
Expand Down
5 changes: 5 additions & 0 deletions packages/block-library/src/heading/style.native.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import "variables.scss";

.blockText {
min-height: $min-height-heading;
}
11 changes: 3 additions & 8 deletions packages/block-library/src/image/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,6 @@ class ImageEdit extends React.Component {
imageHeightWithinContainer,
} = sizes;

if ( imageWidthWithinContainer === undefined ) {
return (
<View style={ styles.imageContainer } >
<Dashicon icon={ 'format-image' } size={ 300 } />
</View>
);
}

let finalHeight = imageHeightWithinContainer;
if ( height > 0 && height < imageHeightWithinContainer ) {
finalHeight = height;
Expand All @@ -362,6 +354,9 @@ class ImageEdit extends React.Component {
<View style={ { flex: 1 } } >
{ getInspectorControls() }
{ getMediaOptions() }
{ ! imageWidthWithinContainer && <View style={ styles.imageContainer } >
<Dashicon icon={ 'format-image' } size={ 300 } />
</View> }
<ImageBackground
style={ { width: finalWidth, height: finalHeight, opacity } }
resizeMethod="scale"
Expand Down
4 changes: 3 additions & 1 deletion packages/block-library/src/paragraph/style.native.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import "variables.scss";

.blockText {
min-height: 24;
min-height: $min-height-paragraph;
}
4 changes: 2 additions & 2 deletions packages/editor/src/components/post-title/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import { withInstanceId, compose } from '@wordpress/compose';
*/
import styles from './style.scss';

const minHeight = 30;

class PostTitle extends Component {
constructor() {
super( ...arguments );
Expand Down Expand Up @@ -72,6 +70,8 @@ class PostTitle extends Component {
const decodedPlaceholder = decodeEntities( placeholder );
const borderColor = this.state.isSelected ? focusedBorderColor : 'transparent';

const minHeight = styles.blockText.minHeight;

return (
<View style={ [ styles.titleContainer, borderStyle, { borderColor } ] }>
<RichText
Expand Down
4 changes: 4 additions & 0 deletions packages/editor/src/components/post-title/style.native.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

@import "variables.scss";

.blockText {
min-height: $min-height-title;
}

.titleContainer {
padding-left: 16;
padding-right: 16;
Expand Down

0 comments on commit 926ed3f

Please sign in to comment.